mirror of
https://github.com/reanimate/reanimate.git
synced 2026-09-12 00:23:08 +00:00
Improve README examples (#68)
- Move examples higher, above any technical details. - Use a consistent off-white background color. - Use more interesting and less trivial examples. - Play at 50fps rather than 25fps. - Host offsite (imgur) as to not take up repo space. - Link to source file for each example. Former-commit-id: 7e62a3a1ca99e9abc5781568ff920066c94783ee
This commit is contained in:
parent
a753342955
commit
fd2935c2ba
14 changed files with 159 additions and 201 deletions
|
|
@ -22,7 +22,8 @@ import System.Random.Shuffle
|
|||
|
||||
|
||||
main :: IO ()
|
||||
main = reanimate $ parA bg $ sceneAnimation $ do
|
||||
main = reanimate $ sceneAnimation $ do
|
||||
newSpriteSVG $ mkBackgroundPixel $ PixelRGBA8 252 252 252 0xFF
|
||||
zPos <- newVar 0
|
||||
xRot <- newVar 0
|
||||
zRot <- newVar 0
|
||||
|
|
@ -41,8 +42,6 @@ main = reanimate $ parA bg $ sceneAnimation $ do
|
|||
fork $ tweenVar zRot 9 $ \v -> fromToS v 360 . curveS 2
|
||||
wait 10
|
||||
tweenVar zPos 2 $ \v -> fromToS v 0 . curveS 3
|
||||
where
|
||||
bg = animate $ const $ mkBackgroundPixel $ PixelRGBA8 252 252 252 0xFF
|
||||
|
||||
texture :: Double -> SVG
|
||||
texture t = frameAt (t*duration latexExample) latexExample
|
||||
|
|
@ -92,7 +91,7 @@ latexExample = sceneAnimation $ do
|
|||
-- Draw equation
|
||||
play $ drawAnimation strokedSvg
|
||||
sprites <- forM glyphs $ \(fn, _, elt) ->
|
||||
newSpriteA $ animate $ const $ fn elt
|
||||
newSpriteSVG $ fn elt
|
||||
-- Yoink each glyph
|
||||
forM_ (reverse sprites) $ \sprite -> do
|
||||
spriteE sprite (overBeginning 1 $ aroundCenterE $ highlightE)
|
||||
|
|
|
|||
Loading…
Reference in a new issue