reanimate/examples/latex_basic.hs
David Himmelstrup 7833212e19 Move examples into separate executables.
Former-commit-id: 8e5ede8a2eb27373c5a2582de65b8a832bd6261e
2019-07-28 14:03:04 +08:00

24 lines
795 B
Haskell
Executable file

#!/usr/bin/env stack
-- stack --resolver lts-13.14 runghc --package reanimate
{-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import Control.Lens
import Graphics.SvgTree (Number(..))
import Reanimate.Driver (reanimate)
import Reanimate.LaTeX
import Reanimate.Monad
import Reanimate.Svg
import Reanimate.Signal
main :: IO ()
main = reanimate $ autoReverse $ mkAnimation 2 $ do
s <- getSignal signalLinear
emit $ mkGroup
[ mkBackground "black"
, withStrokeColor "white" $ withFillOpacity 0 $ withStrokeWidth (Num 0.1) text
, withFillColor "white" $ withFillOpacity s text ]
where
text = scale 4 $ center $ latexAlign
"\\sum_{k=1}^\\infty {1 \\over k^2} = {\\pi^2 \\over 6}"