elm/Examples/elm-yesod/elm_source/clock.elm
ngunn 346ff6bb5d Update Examples/elm-yesod to better match online interactive examples
see http://elm-lang.org/edit/examples/

index.elm
    remove "box" fns (obsolete)
    disambiguate "link" fns (Text or Graphics)

tested against ghc-7.4.1, Elm-0.7.1.1, yesod-1.1.7.1, elm-yesod-0.1.3
2013-03-02 15:24:43 +00:00

11 lines
399 B
Elm

hand clr len time =
let t = pi * inSeconds time / 30 - pi / 2 in
solid clr $ line [(200,200), (200 + len * cos t, 200 + len * sin t)]
clock t = collage 400 400 [ filled (rgb 96 176 224) $ ngon 12 110 (200, 200)
, hand red 100 t
, hand black 100 (t/60)
, hand black 60 (t/720) ]
main = lift clock (every second)