From e00fba297d7e22a2e2726fa4aeaae51ebebbe2ae Mon Sep 17 00:00:00 2001 From: nflnkr <105123049+nflnkr@users.noreply.github.com> Date: Sat, 24 Dec 2022 15:36:05 +0300 Subject: [PATCH] add animations --- src/components/CardWithLink.tsx | 40 ++++++++++++++++++++++++++------- src/pages/Landing/Section1.tsx | 30 ++++++++++++++++--------- src/pages/Landing/Section2.tsx | 18 ++++++++++----- src/react-app-env.d.ts | 5 +++++ 4 files changed, 68 insertions(+), 25 deletions(-) diff --git a/src/components/CardWithLink.tsx b/src/components/CardWithLink.tsx index 0c58635..344fdd4 100644 --- a/src/components/CardWithLink.tsx +++ b/src/components/CardWithLink.tsx @@ -5,7 +5,9 @@ import CustomButton from "./CustomButton"; interface Props { - image: string; + image?: string; + video?: string; + poster?: string; headerText: string; text: string; linkHref: string; @@ -18,6 +20,8 @@ interface Props { export default function CardWithLink({ image, + video, + poster, headerText, text, linkHref, @@ -31,11 +35,11 @@ export default function CardWithLink({ const boxShadow: string = shadowType === "dark" ? `0px 100px 309px rgba(37, 39, 52, 0.24), - 0px 41.7776px 129.093px rgba(37, 39, 52, 0.172525), - 0px 22.3363px 69.0192px rgba(37, 39, 52, 0.143066), - 0px 12.5216px 38.6916px rgba(37, 39, 52, 0.12), - 0px 6.6501px 20.5488px rgba(37, 39, 52, 0.0969343), - 0px 2.76726px 8.55082px rgba(37, 39, 52, 0.0674749)` + 0px 41.7776px 129.093px rgba(37, 39, 52, 0.172525), + 0px 22.3363px 69.0192px rgba(37, 39, 52, 0.143066), + 0px 12.5216px 38.6916px rgba(37, 39, 52, 0.12), + 0px 6.6501px 20.5488px rgba(37, 39, 52, 0.0969343), + 0px 2.76726px 8.55082px rgba(37, 39, 52, 0.0674749)` : `0px 100px 80px rgba(126, 42, 234, 0.07), 0px 41.7776px 33.4221px rgba(126, 42, 234, 0.0503198), @@ -63,7 +67,7 @@ export default function CardWithLink({ > + display: "flex", + alignItems: "center", + overflow: "hidden", + }}> + {video && + + } + {headerText} {text} {buttonType === "link" ? diff --git a/src/pages/Landing/Section1.tsx b/src/pages/Landing/Section1.tsx index 06dd2e6..375c6e2 100644 --- a/src/pages/Landing/Section1.tsx +++ b/src/pages/Landing/Section1.tsx @@ -1,8 +1,9 @@ import { Box, Typography, useMediaQuery, useTheme } from "@mui/material"; -import pena_illustration02 from "../../assets/pena_illustration02.png"; import CustomButton from "../../components/CustomButton"; import PenaLogo from "../../components/PenaLogo"; import SectionWrapper from "../../components/SectionWrapper"; +import mainShapeVideo from "../../assets/animations/main.webm"; +import previewMain from "../../assets/animations/preview_main.png"; export default function Section1() { @@ -18,8 +19,8 @@ export default function Section1() { }} sx={{ display: "flex", - pt: "70px", - pb: upMd ? "40px" : "70px", + pt: upMd ? "70px" : "20px", + pb: "70px", justifyContent: "space-between", flexDirection: upMd ? "row" : "column", }} @@ -43,8 +44,8 @@ export default function Section1() { textAlign: "center", order: upMd ? 2 : 1, mx: upMd ? "30px" : 0, - mt: upMd ? undefined : "-70px", - mb: upMd ? undefined : "-30px", + // mt: upMd ? undefined : "-70px", + // mb: upMd ? undefined : "-30px", alignSelf: "center", aspectRatio: "1 / 1", width: upMd ? undefined : "100%", @@ -52,14 +53,21 @@ export default function Section1() { maxHeight: "301px", }} > - pena illustration + > + + Your browser doesn't support HTML5 video tag. + diff --git a/src/react-app-env.d.ts b/src/react-app-env.d.ts index 6431bc5..ec6e206 100644 --- a/src/react-app-env.d.ts +++ b/src/react-app-env.d.ts @@ -1 +1,6 @@ /// + +declare module "*.webm" { + const src: string; + export default src; + } \ No newline at end of file