From f76aaedd794f15d9f049f53a081710b9565fb8b1 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 1 Nov 2015 12:24:51 +0100 Subject: Add an opacity animation at signIn and loggedIn overture --- src/server/Design/Animation/Keyframes.hs | 26 ++++++++++++++++++++++++++ src/server/Design/Animation/Opacity.hs | 17 +++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 src/server/Design/Animation/Keyframes.hs create mode 100644 src/server/Design/Animation/Opacity.hs (limited to 'src/server/Design/Animation') diff --git a/src/server/Design/Animation/Keyframes.hs b/src/server/Design/Animation/Keyframes.hs new file mode 100644 index 0000000..3ea5575 --- /dev/null +++ b/src/server/Design/Animation/Keyframes.hs @@ -0,0 +1,26 @@ +{-# LANGUAGE OverloadedStrings #-} + +module Design.Animation.Keyframes + ( Keyframes(..) + , allKeyframes + ) where + +import Data.String (fromString) + +import Clay + +data Keyframes = + OpacityKeyframes + deriving (Eq, Show) + +allKeyframes :: Css +allKeyframes = + keyframes + (fromString . show $ OpacityKeyframes) + [ ( 0 + , opacity 0 + ) + , ( 100 + , opacity 1 + ) + ] diff --git a/src/server/Design/Animation/Opacity.hs b/src/server/Design/Animation/Opacity.hs new file mode 100644 index 0000000..cc720fd --- /dev/null +++ b/src/server/Design/Animation/Opacity.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE OverloadedStrings #-} + +module Design.Animation.Opacity + ( opacityAnimation + ) where + +import Data.String (fromString) + +import Clay + +import Design.Animation.Keyframes + +opacityAnimation :: Css +opacityAnimation = do + animationName (fromString . show $ OpacityKeyframes) + animationDuration (sec 0.2) + animationTimingFunction ease -- cgit v1.2.3