add motion

This commit is contained in:
2024-12-11 13:39:57 +04:00
parent 54ac7aa870
commit fb64dfa1b7
10 changed files with 152 additions and 14 deletions

View File

@@ -9,7 +9,7 @@ $adaptive: (
size: 250px,
),
mobile: (
size: auto,
size: 100%,
),
);

View File

@@ -3,6 +3,7 @@ import TV from '@shared/assets/images/tv.png';
import Laptop from '@shared/assets/images/laptop.png';
import { HomeButton } from './components/home.button';
import { useNavigate } from 'react-router-dom';
import { motion } from 'framer-motion';
const HomePage = () => {
const navigation = useNavigate();
@@ -15,13 +16,37 @@ const HomePage = () => {
navigation('/tv');
};
const titleVariants = {
hidden: { y: 100, opacity: 0 },
visible: { y: 0, opacity: 1 },
};
const containerVariants = {
hidden: { y: 100, opacity: 0 },
visible: { y: 0, opacity: 1 },
};
return (
<div className={classes.home}>
<h1 className={classes.title}>Выберите тип обученной модели</h1>
<div className={classes.container}>
<motion.h1
className={classes.title}
initial="hidden"
animate="visible"
variants={titleVariants}
transition={{ duration: 0.5 }}
>
Select the type of trained model
</motion.h1>
<motion.div
className={classes.container}
initial="hidden"
animate="visible"
variants={containerVariants}
transition={{ duration: 0.5 }}
>
<HomeButton imgSrc={Laptop} onClick={handleLaptopRedirect} />
<HomeButton imgSrc={TV} onClick={handleTVRedirect} />
</div>
</motion.div>
</div>
);
};

1
src/pages/home/index.ts Normal file
View File

@@ -0,0 +1 @@
export { default as HomePage } from './home.page';

View File

@@ -1,4 +1,17 @@
@use '@shared/assets/styles/fonts' as fonts;
@use '@shared/assets/styles/adaptive' as adaptive;
$adaptive: (
desktop: (
flex-direction: row,
),
table: (
flex-direction: row,
),
mobile: (
flex-direction: column,
),
);
.home {
display: flex;
@@ -16,5 +29,6 @@
display: flex;
margin: 0 auto;
gap: 24px;
@include adaptive.set-adaptive($adaptive, flex-direction, flex-direction);
}
}