Skip to content

Commit 9d11317

Browse files
committed
Animate demo site via a function
1 parent b1409f4 commit 9d11317

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

site/Main.purs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,8 @@ blue2 = rgb 238 238 255
6565
backgroundGradient :: forall a. Angle a -> Css
6666
backgroundGradient a = backgroundImage $ linearGradient a (ColorPoint white (pct 0)) [] (ColorPoint blue2 (pct 100))
6767

68-
shakeLeft :: Css
69-
shakeLeft = transforms [translate (px (-3)) nil, rotate (deg (-2))]
70-
71-
shakeRight :: Css
72-
shakeRight = transforms [translate (px 3) nil, rotate (deg 2)]
68+
shake :: (Number -> Number) -> Css
69+
shake f = transforms [translate (px (f 3)) nil, rotate (deg (f 2))]
7370

7471
style :: Css
7572
style = do
@@ -81,7 +78,7 @@ style = do
8178
, FontFaceSrcUrl "http://fonts.gstatic.com/s/lato/v11/EsvMC5un3kjyUhB9ZEPPwg.woff2" (Just WOFF2)
8279
]
8380

84-
keyframes "buzz-button" $ tuple2 50 shakeRight NEL.:| [tuple2 100 shakeLeft]
81+
keyframes "buzz-button" $ tuple2 50 (shake id) NEL.:| [tuple2 100 (shake negate)]
8582

8683
html ? height (pct 100)
8784
body ? do

0 commit comments

Comments
 (0)