reanimate/examples/slow.hs
David Himmelstrup 6b24b06271 Fix warnings.
Former-commit-id: 629b9769ede15212759b677c02a751c81de671cb
2019-12-16 09:25:23 +08:00

25 lines
728 B
Haskell
Executable file

#!/usr/bin/env stack
-- stack runghc --package reanimate
module Main (main) where
import Control.Concurrent
import Control.Exception
import Control.Lens
import qualified Data.Text as T
import Graphics.SvgTree
import Reanimate
import System.IO.Unsafe
main :: IO ()
main = reanimate $ mkAnimation dur $ \t -> unsafePerformIO $ do
let frame = round (t*dur*fromIntegral pFPS) :: Integer
threadDelay (10^(6::Integer))
evaluate $ mkGroup
[ mkBackground "black"
, translate (-4) 0 $
withFillColor "white" $
mkText (T.pack $ "Frame: " ++ show frame)
& textAnchor .~ pure TextAnchorStart
]
where
dur = 2