Update valentine animation.

This commit is contained in:
David Himmelstrup 2019-03-01 14:54:41 +01:00 committed by GitHub
commit 7cc0742191
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -159,15 +159,16 @@ animation =
all_red \`before\` all_red \`before\`
( background \`sim\` ( background \`sim\`
(backgroundDelay \`before\` (backgroundDelay \`before\`
foldr1 sim [ pause p \`before\` fallingLove x | (p, x) <- falling ] foldr1 sim [ pause p \`before\` fallingLove p x | (p, x) <- falling ]
) \`sim\` ) \`sim\`
(heart_ani \`before\` heart_disappear) \`sim\` (heart_ani \`before\` heart_disappear) \`sim\`
(pause 5 \`before\` message ai) (pause 1 \`before\` repeatAnimation 10 (message ai))
) )
where where
falling = [(6.4, 0.09), (4.9, 0.12), (4.5, 0.88), (0.3, 0.43), (5.3, 0.93) falling = [(6.4, 0.09), (4.9, 0.12), (4.5, 0.88), (0.3, 0.43), (5.3, 0.93)
,(0.1, 0.80), (1.1, 0.39), (2.3, 0.21), (2.9, 0.77), (3.4, 0.46) ,(0.1, 0.80), (1.1, 0.39), (2.3, 0.21), (2.9, 0.77), (3.4, 0.46)
,(6.2, 0.19), (5.9, 0.53), (3.2, 0.14), (7.7, 0.99) ] ,(6.2, 0.88), (5.9, 0.80), (3.2, 0.14), (7.7, 0.99), (3.4, 0.35)
,(0.4, 0.51), (7.1, 0.60), (7.7, 0.65)]
ai = center $ xelatex "爱" ai = center $ xelatex "爱"
all_red = mkAnimation 1 $ emit $ mkBackground "red" all_red = mkAnimation 1 $ emit $ mkBackground "red"
background = mkAnimation 2 $ do background = mkAnimation 2 $ do
@ -179,12 +180,14 @@ animation =
mapF (scale n) $ drawHeart mapF (scale n) $ drawHeart
heart_disappear = mkAnimation 3 $ do heart_disappear = mkAnimation 3 $ do
n <- signal 0.9 10 n <- signal 0.9 10
o <- oscillate $ signal 0 1.5
mapF (scale n) drawHeart mapF (scale n) drawHeart
fallingLove xPos = mkAnimation 2 $ do mapF (scale (n*4)) $ emit $ withFillOpacity o $ withFillColor "white" ai
n <- signal (-100) 100 fallingLove rand xPos = mkAnimation 2 $ do
n <- signal (-100) 90
o <- oscillate $ signal (-1) 1 o <- oscillate $ signal (-1) 1
emit $ scale 2 $ withFillColor "red" $ emit $ withStrokeColor "black" $ withFillColor "red" $
translate ((xPos*2-1)*60) n $ rotate (45*o) ai translate ((xPos*2-1)*(320/2)) n $ scale 0.3 $ rotate (60*(o+rand+xPos)) heartShape
message txt = mkAnimation 1 $ do message txt = mkAnimation 1 $ do
o <- oscillate $ signal 0 1 o <- oscillate $ signal 0 1
n <- oscillate $ signalSCurve 2 0.9 1.1 n <- oscillate $ signalSCurve 2 0.9 1.1