FormidableLabs / react-animations

🎊 A collection of animations for inline style libraries
MIT License
3.06k stars 160 forks source link

fade in from black #35

Open MarcDAFrame opened 4 years ago

MarcDAFrame commented 4 years ago

how do you fade in from black?

I tried using backgroundColor but it doesn't work

...
import Radium, { StyleRoot } from 'radium';
import { fadeIn } from 'react-animations'
...
const animations = {
  fadein: {
    animation: 'x 3s',
    animationName: Radium.keyframes(fadeIn, 'bounce'),
    backgroundColor: 'black',
  }
}
...
<StyleRoot>
   <img style={animations.fadein as React.CSSProperties} src={background_img} className={style.calltoaction_image} />
</StyleRoot>