Update valentine animation.

Former-commit-id: 919c11326021039a51a6586311b287a88a6d9aec
This commit is contained in:
David Himmelstrup 2019-03-01 14:54:41 +01:00 committed by GitHub
commit 17e096f5c5

View file

@ -159,15 +159,16 @@ animation =
all_red \`before\`
( background \`sim\`
(backgroundDelay \`before\`
foldr1 sim [ pause p \`before\` fallingLove x | (p, x) <- falling ]
foldr1 sim [ pause p \`before\` fallingLove p x | (p, x) <- falling ]
) \`sim\`
(heart_ani \`before\` heart_disappear) \`sim\`
(pause 5 \`before\` message ai)
(pause 1 \`before\` repeatAnimation 10 (message ai))
)
where
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)
,(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 "爱"
all_red = mkAnimation 1 $ emit $ mkBackground "red"
background = mkAnimation 2 $ do
@ -179,12 +180,14 @@ animation =
mapF (scale n) $ drawHeart
heart_disappear = mkAnimation 3 $ do
n <- signal 0.9 10
o <- oscillate $ signal 0 1.5
mapF (scale n) drawHeart
fallingLove xPos = mkAnimation 2 $ do
n <- signal (-100) 100
mapF (scale (n*4)) $ emit $ withFillOpacity o $ withFillColor "white" ai
fallingLove rand xPos = mkAnimation 2 $ do
n <- signal (-100) 90
o <- oscillate $ signal (-1) 1
emit $ scale 2 $ withFillColor "red" $
translate ((xPos*2-1)*60) n $ rotate (45*o) ai
emit $ withStrokeColor "black" $ withFillColor "red" $
translate ((xPos*2-1)*(320/2)) n $ scale 0.3 $ rotate (60*(o+rand+xPos)) heartShape
message txt = mkAnimation 1 $ do
o <- oscillate $ signal 0 1
n <- oscillate $ signalSCurve 2 0.9 1.1