Fix some hlint warnings, and more consistency in examples (#167)

* Remove redundant brackets

* Various hlint fixes

* Remove unused language pragrams and other fixes

* Use addStatic more consistently in examples

* Rename remaining usages of sceneAnimation to scene
This commit is contained in:
Jan Hrcek 2020-09-20 16:51:22 +02:00 committed by GitHub
commit 0aca2333e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
63 changed files with 240 additions and 275 deletions

View file

@ -17,9 +17,9 @@ import System.Random
import "random-shuffle" System.Random.Shuffle
main :: IO ()
main = reanimate $ parA bg latexExample
main = reanimate $ addStatic bg latexExample
where
bg = animate $ const $ mkBackgroundPixel (PixelRGBA8 252 252 252 0xFF)
bg = mkBackgroundPixel (PixelRGBA8 252 252 252 0xFF)
latexExample :: Animation
latexExample = scene $ do
@ -29,11 +29,11 @@ latexExample = scene $ do
newSpriteSVG $ fn elt
-- Yoink each glyph
forM_ (reverse sprites) $ \sprite -> do
spriteE sprite (overBeginning 1 $ aroundCenterE $ highlightE)
spriteE sprite (overBeginning 1 $ aroundCenterE highlightE)
wait 0.5
-- Flash glyphs randomly with color
forM_ (shuffleList (sprites++sprites)) $ \sprite -> do
spriteE sprite (overBeginning 0.5 $ aroundCenterE $ flashE)
spriteE sprite (overBeginning 0.5 $ aroundCenterE flashE)
wait 0.1
wait 0.5
mapM_ destroySprite sprites
@ -80,7 +80,7 @@ drawAnimation' mbSeed fillDur step svg = scene $ do
_ -> defaultStrokeWidth
fork $ do
wait (n*step)
play $ mapA fn $ (animate (\t -> withFillOpacity 0 $ partialSvg t tree)
play $ mapA fn (animate (\t -> withFillOpacity 0 $ partialSvg t tree)
& applyE (overEnding fillDur $ fadeLineOutE sWidth))
fork $ do
wait (n*step+(1-fillDur))