Created
May 29, 2019 09:13
-
-
Save roeib/569d1134b9695fc2a5ba4893ae03f876 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { useSpring, animated } from "react-spring"; | |
const FadeFromTopAndcounter = () => { | |
const fadeFromtop = useSpring({ | |
to: { opacity: 1, marginTop: 0 }, | |
from: { opacity: 0, marginTop: -5000 }, | |
delay: "2000" | |
}); | |
const counter = useSpring({ | |
number: 1, | |
from: { number: 0 }, | |
delay: "2700" | |
}); | |
return ( | |
<animated.div style={fadeFromtop}> | |
<div style={c2style}> | |
<div style={title}>Hi im fade in from margin top</div> | |
<p> | |
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quaerat nu | |
mquam, nulla nostrum, offic | |
</p> | |
<animated.div >{counter.number}</animated.div> | |
</div> | |
</animated.div> | |
); | |
} | |
const c2style = { | |
background: "#F9CE21", | |
height: "300px", | |
display: 'flex', | |
justifyContent:'center', | |
alignItems:'center', | |
flexDirection:'column' | |
}; | |
const title ={ | |
fontWeight:'bold', | |
fontSize:'50px' | |
} | |
export default FadeFromTopAndcounter; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment