File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
components/home/AnimatedTextSection Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change 77 RECRUIT_BANNER ,
88 RECRUIT_BANNER_ACTIVE ,
99} from 'database/recruit' ;
10- import lottie from 'lottie-web' ;
10+
1111import { useRouter } from 'next/router' ;
1212import type { ReactElement } from 'react' ;
1313import { useEffect , useRef } from 'react' ;
@@ -22,13 +22,18 @@ function AnimatedTextSection(): ReactElement {
2222
2323 const router = useRouter ( ) ;
2424 useEffect ( ( ) => {
25- lottie . loadAnimation ( {
26- container : animatedTextRef . current as HTMLDivElement ,
27- renderer : 'svg' ,
28- loop : true ,
29- autoplay : true ,
30- animationData : require ( 'public/assets/lottie/motion.json' ) ,
31- } ) ;
25+ const loadAnimation = async ( ) => {
26+ const lottie = await import ( 'lottie-web' ) ;
27+ const animationData = await import ( 'public/assets/lottie/motion.json' ) ;
28+ lottie . default . loadAnimation ( {
29+ container : animatedTextRef . current as HTMLDivElement ,
30+ renderer : 'svg' ,
31+ loop : true ,
32+ autoplay : true ,
33+ animationData : animationData . default ,
34+ } ) ;
35+ } ;
36+ loadAnimation ( ) ;
3237 } , [ ] ) ;
3338
3439 return (
You can’t perform that action at this time.
0 commit comments