File tree Expand file tree Collapse file tree 2 files changed +43
-10
lines changed
apps/web/src/pages/MemeQuizPage/components/MemeQuizStart Expand file tree Collapse file tree 2 files changed +43
-10
lines changed Original file line number Diff line number Diff line change 11import styled from '@emotion/styled' ;
2+ import { motion } from 'motion/react' ;
23
3- const Container = styled . div `
4+ const Container = styled ( motion . div ) `
45 position: relative;
56 width: 100%;
67 height: 100%;
@@ -14,7 +15,7 @@ const Container = styled.div`
1415 );
1516` ;
1617
17- const TextSection = styled . div `
18+ const TextSection = styled ( motion . div ) `
1819 margin-top: 158px;
1920 text-align: center;
2021 width: 100%;
@@ -33,7 +34,7 @@ const Subtitle = styled.p`
3334 color: ${ ( { theme } ) => theme . palette . common . white } ;
3435` ;
3536
36- const IconSection = styled . div `
37+ const IconSection = styled ( motion . div ) `
3738 margin-top: 61px;
3839 width: 100%;
3940 height: 240px;
@@ -42,7 +43,7 @@ const IconSection = styled.div`
4243 align-items: center;
4344` ;
4445
45- const ButtonWrapper = styled . div `
46+ const ButtonWrapper = styled ( motion . div ) `
4647 position: fixed;
4748 bottom: 0;
4849 left: 0;
Original file line number Diff line number Diff line change @@ -8,26 +8,58 @@ import {
88 ButtonWrapper ,
99 StartButton ,
1010} from './MemeQuizStart.styles' ;
11+ import { AnimatePresence } from 'motion/react' ;
1112
1213interface MemeQuizStartProps {
1314 onNext : ( ) => void ;
1415}
1516
1617const MemeQuizStart = ( { onNext } : MemeQuizStartProps ) => {
1718 return (
18- < Container >
19- < TextSection >
19+ < Container
20+ initial = { { opacity : 0 } }
21+ animate = { { opacity : 1 } }
22+ transition = { { duration : 0.5 } }
23+ >
24+ < TextSection
25+ initial = { { opacity : 0 , y : 30 } }
26+ animate = { { opacity : 1 , y : 0 } }
27+ transition = { { duration : 0.6 , delay : 0.2 } }
28+ >
2029 < Title > { `나 어쩌면 \n밈잘알일지도?!` } </ Title >
2130 < Subtitle > 과연 나는 밈잘알일까? 밈퀴즈 풀고 알아보자!</ Subtitle >
2231 </ TextSection >
2332
24- < IconSection >
33+ < IconSection
34+ initial = { { opacity : 0 , scale : 0.8 } }
35+ animate = { { opacity : 1 , scale : 1 } }
36+ transition = { {
37+ duration : 0.8 ,
38+ delay : 0.4 ,
39+ type : 'spring' ,
40+ bounce : 0.4 ,
41+ } }
42+ >
2543 < MemeQuizStartIcon />
2644 </ IconSection >
2745
28- < ButtonWrapper >
29- < StartButton onClick = { onNext } > 밈퀴즈 시작하기</ StartButton >
30- </ ButtonWrapper >
46+ < AnimatePresence >
47+ < ButtonWrapper
48+ initial = { { opacity : 0 , y : 40 } }
49+ animate = { { opacity : 1 , y : 0 } }
50+ exit = { { opacity : 0 , y : 40 } }
51+ transition = { {
52+ duration : 0.6 ,
53+ delay : 0.6 ,
54+ type : 'spring' ,
55+ stiffness : 100 ,
56+ } }
57+ >
58+ < StartButton onClick = { onNext } style = { { position : 'relative' } } >
59+ 밈퀴즈 시작하기
60+ </ StartButton >
61+ </ ButtonWrapper >
62+ </ AnimatePresence >
3163 </ Container >
3264 ) ;
3365} ;
You can’t perform that action at this time.
0 commit comments