Skip to content

Instantly share code, notes, and snippets.

@seanhess
Created August 12, 2016 17:54
Show Gist options
  • Save seanhess/4b77a3018736017ff5f3e8cd3e1ff5e2 to your computer and use it in GitHub Desktop.
Save seanhess/4b77a3018736017ff5f3e8cd3e1ff5e2 to your computer and use it in GitHub Desktop.
fade : Bool -> Float -> Styles
fade isShown splashHeight =
[ transition "opacity 250ms, margin-top 250ms 250ms"
, opacity (float 0)
, marginTop (px -splashHeight)
]
++ if isShown then
fadeShown
else
[]
fadeShown : Styles
fadeShown =
[ opacity (float 1)
, transition "opacity 250ms 250ms, margin-top 250ms"
, marginTop (px 0)
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment