|
1 | 1 | import { useEffect, useRef, useState } from 'react'; |
2 | | -import { AnimatePresence } from 'motion/react'; |
| 2 | +import { AnimatePresence, motion } from 'motion/react'; |
3 | 3 | import { LinkCopiedIcon } from '@/assets/icons'; |
4 | 4 | import MemeQuizResultBackground from '@/assets/images/MemeQuizResultBackground.png'; |
5 | 5 | import { |
@@ -56,7 +56,7 @@ const MemeQuizResult = ({ rightCount }: MemeQuizResultPageProps) => { |
56 | 56 | // 결과 화면 애니메이션 시작 |
57 | 57 | const timer = setTimeout(() => { |
58 | 58 | setShowResult(true); |
59 | | - }, 1000); |
| 59 | + }, 2500); |
60 | 60 |
|
61 | 61 | return () => { |
62 | 62 | clearTimeout(timer); |
@@ -88,11 +88,92 @@ const MemeQuizResult = ({ rightCount }: MemeQuizResultPageProps) => { |
88 | 88 | }, []); |
89 | 89 |
|
90 | 90 | 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 | + )} |
96 | 177 | <ResultCard |
97 | 178 | initial={{ scale: 0.9, opacity: 0 }} |
98 | 179 | animate={{ |
|
0 commit comments