diff --git a/.env b/.env index 8640fec..8549272 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ VITE_URL="robo-school" -VITE_NODE_ENV="development" \ No newline at end of file +VITE_NODE_ENV="production" \ No newline at end of file diff --git a/src/Components/Before/Before.tsx b/src/Components/Before/Before.tsx index 4f6427e..267626a 100644 --- a/src/Components/Before/Before.tsx +++ b/src/Components/Before/Before.tsx @@ -1,17 +1,31 @@ +import { motion } from "framer-motion" +import { blockAnim } from "../../constants/animation" import Title from "../ui/Title/Title" import "./Before.sass" import BeforeItem from "./BeforeItem/BeforeItem" import { beforeData } from "./before.data" + const Before = () => { return (
Что вы получите после курса -
+ {beforeData.map(({ text, title }, index) => ( - + ))} -
+
) diff --git a/src/Components/Before/BeforeItem/BeforeItem.tsx b/src/Components/Before/BeforeItem/BeforeItem.tsx index 3e51bc9..36076ca 100644 --- a/src/Components/Before/BeforeItem/BeforeItem.tsx +++ b/src/Components/Before/BeforeItem/BeforeItem.tsx @@ -1,13 +1,16 @@ -import { FC } from "react" +import { motion } from "framer-motion" +import { FC, LegacyRef, forwardRef } from "react" import { IBefore } from "../before.data" -const BeforeItem: FC = ({ text, title }) => { - return ( -
-

{title}

-

{text}

-
- ) -} - +const MBeforeItem: FC = forwardRef( + ({ text, title }, ref: LegacyRef) => { + return ( +
+

{title}

+

{text}

+
+ ) + } +) +const BeforeItem = motion(MBeforeItem) export default BeforeItem diff --git a/src/Components/Feedback/Feedback.tsx b/src/Components/Feedback/Feedback.tsx index 59f2c6c..08596b9 100644 --- a/src/Components/Feedback/Feedback.tsx +++ b/src/Components/Feedback/Feedback.tsx @@ -1,23 +1,15 @@ -import { IMG_URL } from "../../constants/sys" import "./Feedback.sass" import Form from "./Form/Form" +import Img from "./Img/Img" +import Text from "./Text/Text" const Feedback = () => { return (
-
-

Запишитесь на курс со скидкой 10%

-

Акция действительна до 10 марта 2022 года

-
+
-
- Procents -
+
) } diff --git a/src/Components/Feedback/Img/Img.tsx b/src/Components/Feedback/Img/Img.tsx new file mode 100644 index 0000000..09768fa --- /dev/null +++ b/src/Components/Feedback/Img/Img.tsx @@ -0,0 +1,15 @@ +import { IMG_URL } from "../../../constants/sys" + +const Img = () => { + return ( +
+ Procents +
+ ) +} + +export default Img diff --git a/src/Components/Feedback/Text/Text.tsx b/src/Components/Feedback/Text/Text.tsx new file mode 100644 index 0000000..7451701 --- /dev/null +++ b/src/Components/Feedback/Text/Text.tsx @@ -0,0 +1,22 @@ +import { motion } from "framer-motion" +import { textAnim } from "../../../constants/animation" + +const Text = () => { + return ( + + + Запишитесь на курс со скидкой 10% + + + Акция действительна до 10 марта 2022 года + + + ) +} + +export default Text diff --git a/src/Components/Info/Info.tsx b/src/Components/Info/Info.tsx index a13447b..97d6e24 100644 --- a/src/Components/Info/Info.tsx +++ b/src/Components/Info/Info.tsx @@ -1,15 +1,23 @@ +import { motion } from "framer-motion" +import { textAnim } from "../../constants/animation" import "./Info.sass" import Statistics from "./Statistics/Statistics" + const Info = () => { return (
-
-

+ + Robo School – учреждение для формирования кадрового педагогического резерва в сфере робототехники программирования -

+ -
+
) } diff --git a/src/Components/Info/Statistics/Statistic/Statistic.tsx b/src/Components/Info/Statistics/Statistic/Statistic.tsx index d2df843..b1a58c8 100644 --- a/src/Components/Info/Statistics/Statistic/Statistic.tsx +++ b/src/Components/Info/Statistics/Statistic/Statistic.tsx @@ -1,13 +1,16 @@ -import { FC } from "react" +import { motion } from "framer-motion" +import { FC, LegacyRef, forwardRef } from "react" import { IStatistic } from "../statistics.data" -const Statistic: FC = ({ count, text }) => { - return ( -
-

{count.toLocaleString()}

-

{text}

-
- ) -} - +const MStatistic: FC = forwardRef( + ({ count, text }, ref: LegacyRef) => { + return ( +
+

{count.toLocaleString()}

+

{text}

+
+ ) + } +) +const Statistic = motion(MStatistic) export default Statistic diff --git a/src/Components/Info/Statistics/Statistics.tsx b/src/Components/Info/Statistics/Statistics.tsx index bb134fb..c6f4e38 100644 --- a/src/Components/Info/Statistics/Statistics.tsx +++ b/src/Components/Info/Statistics/Statistics.tsx @@ -1,3 +1,4 @@ +import { blockAnim } from "../../../constants/animation" import Statistic from "./Statistic/Statistic" import { statisticsData } from "./statistics.data" import "./Statistics.sass" @@ -5,7 +6,13 @@ const Statistics = () => { return (
{statisticsData.map(({ count, text }, index) => ( - + ))}
) diff --git a/src/Components/Landing/Landing.tsx b/src/Components/Landing/Landing.tsx index f25763f..965685f 100644 --- a/src/Components/Landing/Landing.tsx +++ b/src/Components/Landing/Landing.tsx @@ -1,18 +1,30 @@ +import { motion } from "framer-motion" +import { textAnim } from "../../constants/animation" import { IMG_URL } from "../../constants/sys" import Button from "../ui/Button/Button" import "./Landing.sass" + const Landing = () => { return (
-
-

ROBO SCHOOL

-

+ + + ROBO SCHOOL + + Курсы повышения квалификации по робототехнике для педагогов начальной школы -

- -
+ + + logo
diff --git a/src/Components/Packets/Packet/Packet.tsx b/src/Components/Packets/Packet/Packet.tsx index f39ec34..68602b4 100644 --- a/src/Components/Packets/Packet/Packet.tsx +++ b/src/Components/Packets/Packet/Packet.tsx @@ -1,22 +1,25 @@ -import { FC } from "react" +import { motion } from "framer-motion" +import { FC, LegacyRef, forwardRef } from "react" import Button from "../../ui/Button/Button" import { IPacket } from "../packet.data" import "./Packet.sass" -const Packet: FC = ({ description, isActive, price, rang }) => { - return ( -
-

– {rang} –

-
-
-

{price.toLocaleString()} ₽

-

{description}

+const MPacket: FC = forwardRef( + ({ description, isActive, price, rang }, ref: LegacyRef) => { + return ( +
+

– {rang} –

+
+
+

{price.toLocaleString()} ₽

+

{description}

+
-
-
- -
-
- ) -} - +
+ +
+ + ) + } +) +const Packet = motion(MPacket) export default Packet diff --git a/src/Components/Packets/Packets.tsx b/src/Components/Packets/Packets.tsx index b7f2373..648a81e 100644 --- a/src/Components/Packets/Packets.tsx +++ b/src/Components/Packets/Packets.tsx @@ -1,14 +1,25 @@ +import { motion } from "framer-motion" +import { blockAnim } from "../../constants/animation" import Title from "../ui/Title/Title" import Packet from "./Packet/Packet" import "./Packets.sass" import { packetsData } from "./packet.data" + const Packets = () => { return (
Выберите нужный пакет -
+ + {packetsData.map(({ description, isActive, price, rang }, index) => ( { key={index} /> ))} -
+
) } diff --git a/src/Components/ui/Button/Button.tsx b/src/Components/ui/Button/Button.tsx index 974f8a2..bdbfa82 100644 --- a/src/Components/ui/Button/Button.tsx +++ b/src/Components/ui/Button/Button.tsx @@ -1,13 +1,25 @@ -import { ButtonHTMLAttributes, FC, PropsWithChildren } from "react" +import { motion } from "framer-motion" +import { + ButtonHTMLAttributes, + FC, + LegacyRef, + PropsWithChildren, + forwardRef, +} from "react" import "./Button.sass" -const Button: FC< - PropsWithChildren> -> = ({ children, className, ...rest }) => { - return ( - +const MButton: FC>> = + forwardRef( + ({ children, className, ...rest }, ref: LegacyRef) => { + return ( + + ) + } ) -} - +const Button = motion(MButton) export default Button diff --git a/src/Components/ui/Title/Title.tsx b/src/Components/ui/Title/Title.tsx index 6caa0b7..c9db828 100644 --- a/src/Components/ui/Title/Title.tsx +++ b/src/Components/ui/Title/Title.tsx @@ -1,5 +1,15 @@ -import type { PropsWithChildren } from "react" -import "./Title.sass" -export default function Title({ children }: PropsWithChildren) { - return

{children}

+import { motion } from "framer-motion" +import { FC, LegacyRef, ReactNode, forwardRef } from "react" +interface IProps { + children: ReactNode + ref: LegacyRef } +const MTitle: FC = forwardRef(({ children, ref }) => { + return ( +

+ {children} +

+ ) +}) +const Title = motion(MTitle) +export default Title diff --git a/src/constants/animation.ts b/src/constants/animation.ts new file mode 100644 index 0000000..c85d02b --- /dev/null +++ b/src/constants/animation.ts @@ -0,0 +1,22 @@ +export const textAnim = { + hidden: { + x: -100, + opacity: 0, + }, + visible: (custom: number) => ({ + x: 0, + opacity: 1, + transition: { delay: custom * 0.3 }, + }), +} +export const blockAnim = { + hidden: { + y: 100, + opacity: 0, + }, + visible: (custom: number) => ({ + y: 0, + opacity: 1, + transition: { delay: custom * 0.3 }, + }), +}