elm/Examples/elm-yesod/elm_source/clock.elm
Vincent Ambo 3bd18e19c7 * updated the elm-yesod example
Added a slightly more sophisticated elm-page to the elm-yesod example.
2012-05-29 00:39:25 +02:00

12 lines
No EOL
432 B
Elm

clockColor = rgb (6/16) (11/16) (14/16)
hand clr len time =
let t = Math.PI * time / 30 - Math.PI / 2 in
solid clr $ line [(200,200), (200 + len * cos t, 200 + len * sin t)]
clock t = collage 400 400 [ filled clockColor $ ngon 12 110 (200, 200)
, hand red 100 t
, hand black 100 (t/60)
, hand black 60 (t/720) ]
main = lift clock $ Time.every 1