|
|
@@ -0,0 +1,45 @@
|
|
|
+// components
|
|
|
+import Lottie from 'lottie-react';
|
|
|
+import Spring from '@components/Spring';
|
|
|
+
|
|
|
+// assets
|
|
|
+// import ball from '@assets/logo.json';
|
|
|
+import logo from '@assets/dropcoin.json';
|
|
|
+import flycoin from '@assets/flycoin.json';
|
|
|
+import {useRef} from "react";
|
|
|
+import styled from "styled-components/macro";
|
|
|
+
|
|
|
+
|
|
|
+const DropCoins = ({...props}) => {
|
|
|
+ const coinRef = useRef(null);
|
|
|
+ const coins = [useRef(null),useRef(null),useRef(null),useRef(null)]
|
|
|
+ setTimeout(()=>{
|
|
|
+ coinRef.current.setSpeed(1.5);
|
|
|
+ coinRef.current.play()
|
|
|
+ },100)
|
|
|
+
|
|
|
+ coins.forEach((coin,i)=>{
|
|
|
+ setTimeout(()=>{
|
|
|
+ coin.current.play();
|
|
|
+ // coin.current.setSpeed(1.4+i*0.2);
|
|
|
+ },i*500)
|
|
|
+ setTimeout(()=>{
|
|
|
+ coin.current.play();
|
|
|
+ coin.current.setSpeed(0.9-(3-i)*0.1);
|
|
|
+ },i*500+100)
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ return (
|
|
|
+ <Spring {...props} className="d-flex align-items-center justify-content-center flex-1 w-100 h-100 top_view">
|
|
|
+ <Lottie lottieRef={coinRef} loop={false} autoplay={false} className="top_view" animationData={logo} speed={1.5} />
|
|
|
+ {/*<Lottie loop={false} animationData={flycoin} className="top_view" style={{marginLeft:"-15rem"}} />*/}
|
|
|
+ <Lottie loop={false} lottieRef={coins[0]} autoplay={false} animationData={flycoin} className="top_view" style={{marginLeft:"-70%",marginTop:"-25rem",width:"25rem"}} />
|
|
|
+ <Lottie loop={false} lottieRef={coins[1]} autoplay={false} animationData={flycoin} className="top_view" style={{marginLeft:"-20%",marginTop:"-35rem",width:"18rem"}} />
|
|
|
+ <Lottie loop={false} lottieRef={coins[2]} autoplay={false} animationData={flycoin} className="top_view" style={{marginRight:"-20%",marginTop:"-15rem",width:"20rem"}} />
|
|
|
+ <Lottie loop={false} lottieRef={coins[3]} autoplay={false} animationData={flycoin} className="top_view" style={{marginRight:"-60%",marginTop:"-20rem",width:"22rem"}}/>
|
|
|
+ </Spring>
|
|
|
+ )
|
|
|
+}
|
|
|
+
|
|
|
+export default DropCoins
|