Skip to content

Commit 5859017

Browse files
committed
feat: MemeQuizResult 컴포넌트의 결과 집계 애니메이션 추가
- 결과 화면에 '결과 집계중' 메시지와 애니메이션 효과를 추가하여 사용자 경험을 향상시킴 - 결과 표시 지연 시간을 1000ms에서 2500ms로 변경하여 애니메이션 효과를 개선함
1 parent 984c89c commit 5859017

File tree

1 file changed

+88
-7
lines changed
  • apps/web/src/pages/MemeQuizPage/components/MemeQuizResult

1 file changed

+88
-7
lines changed

apps/web/src/pages/MemeQuizPage/components/MemeQuizResult/index.tsx

Lines changed: 88 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect, useRef, useState } from 'react';
2-
import { AnimatePresence } from 'motion/react';
2+
import { AnimatePresence, motion } from 'motion/react';
33
import { LinkCopiedIcon } from '@/assets/icons';
44
import MemeQuizResultBackground from '@/assets/images/MemeQuizResultBackground.png';
55
import {
@@ -56,7 +56,7 @@ const MemeQuizResult = ({ rightCount }: MemeQuizResultPageProps) => {
5656
// 결과 화면 애니메이션 시작
5757
const timer = setTimeout(() => {
5858
setShowResult(true);
59-
}, 1000);
59+
}, 2500);
6060

6161
return () => {
6262
clearTimeout(timer);
@@ -88,11 +88,92 @@ const MemeQuizResult = ({ rightCount }: MemeQuizResultPageProps) => {
8888
}, []);
8989

9090
return (
91-
<Container
92-
initial={{ opacity: 0 }}
93-
animate={{ opacity: 1 }}
94-
transition={{ duration: 0.5 }}
95-
>
91+
<Container>
92+
{!showResult && (
93+
<motion.div
94+
style={{
95+
position: 'fixed',
96+
top: 0,
97+
left: '50%',
98+
transform: 'translateX(-50%)',
99+
width: '100%',
100+
maxWidth: '425px',
101+
height: '100%',
102+
background: 'black',
103+
display: 'flex',
104+
flexDirection: 'column',
105+
alignItems: 'center',
106+
justifyContent: 'center',
107+
gap: '20px',
108+
zIndex: 100,
109+
}}
110+
>
111+
<motion.div
112+
style={{
113+
width: '200px',
114+
height: '200px',
115+
borderRadius: '50%',
116+
background:
117+
'radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%)',
118+
position: 'absolute',
119+
}}
120+
animate={{
121+
scale: [1, 1.2, 1],
122+
opacity: [0.3, 0.7, 0.3],
123+
}}
124+
transition={{
125+
duration: 2,
126+
repeat: Infinity,
127+
ease: 'easeInOut',
128+
}}
129+
/>
130+
<motion.p
131+
style={{
132+
color: 'white',
133+
fontSize: '24px',
134+
fontWeight: 'bold',
135+
textAlign: 'center',
136+
}}
137+
animate={{
138+
opacity: [0.5, 1, 0.5],
139+
}}
140+
transition={{
141+
duration: 1.5,
142+
repeat: Infinity,
143+
ease: 'easeInOut',
144+
}}
145+
>
146+
결과 집계중
147+
</motion.p>
148+
<motion.div
149+
style={{
150+
display: 'flex',
151+
gap: '8px',
152+
}}
153+
>
154+
{[0, 1, 2].map((i) => (
155+
<motion.div
156+
key={i}
157+
style={{
158+
width: '8px',
159+
height: '8px',
160+
borderRadius: '50%',
161+
background: 'white',
162+
}}
163+
animate={{
164+
y: [-4, 4, -4],
165+
}}
166+
transition={{
167+
duration: 0.6,
168+
repeat: Infinity,
169+
ease: 'easeInOut',
170+
delay: i * 0.2,
171+
}}
172+
/>
173+
))}
174+
</motion.div>
175+
</motion.div>
176+
)}
96177
<ResultCard
97178
initial={{ scale: 0.9, opacity: 0 }}
98179
animate={{

0 commit comments

Comments
 (0)