File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -24,12 +24,17 @@ function App() {
24
24
25
25
const isDarkMode = queryParams . get ( 'isDarkMode' ) === 'true' ;
26
26
27
+ const animationSpeed = queryParams . get ( 'animationSpeed' )
28
+ ? parseFloat ( queryParams . get ( 'animationSpeed' ) ! )
29
+ : undefined ;
30
+
27
31
return (
28
32
< div className = 'min-h-screen flex items-center justify-center p-4' >
29
33
< EnumerationDemo
30
34
demoType = { demoType }
31
35
customColors = { customColors }
32
36
isDarkMode = { isDarkMode }
37
+ animationSpeed = { animationSpeed }
33
38
/>
34
39
</ div >
35
40
) ;
Original file line number Diff line number Diff line change @@ -54,12 +54,14 @@ interface EnumerationDemoProps extends React.HTMLAttributes<HTMLDivElement> {
54
54
demoType ?: EnumerationType ;
55
55
isDarkMode ?: boolean ;
56
56
customColors ?: ThemeColors ;
57
+ animationSpeed ?: number ;
57
58
}
58
59
59
60
const EnumerationDemo : React . FC < EnumerationDemoProps > = ( {
60
61
demoType,
61
62
isDarkMode = false ,
62
63
customColors = { } ,
64
+ animationSpeed = 0.18 ,
63
65
className,
64
66
...props
65
67
} ) => {
@@ -94,7 +96,7 @@ const EnumerationDemo: React.FC<EnumerationDemoProps> = ({
94
96
const animationRef = useRef < number | null > ( null ) ;
95
97
96
98
const EXPLOSION_DURATION = 500 ;
97
- const ANIMATION_STEP = 0.18 ;
99
+ const ANIMATION_STEP = animationSpeed ;
98
100
const FRAME_DURATION = 16 ;
99
101
const MAX_PROGRESS = 150 ;
100
102
const isEven = ( n : number ) : boolean => n % 2 === 0 ;
You can’t perform that action at this time.
0 commit comments