diff --git a/Test.elm b/Test.elm index 09ecd19..43f915d 100644 --- a/Test.elm +++ b/Test.elm @@ -1,15 +1,22 @@ import Graphics.Element (Element,container, middle,widthOf,heightOf) import Signal import Mouse -import Time (fps) +import Window +import Time (fps,timestamp,Time) import Html (..) +import Html.Attributes (..) htmlToElement w h el = container w h middle (toElement w h el) main : Signal Element -main = Signal.map view (Signal.foldp (+) 0 (fps 10)) +main = Signal.map2 view Window.dimensions + (Signal.foldp (+) 0 (fps 10)) -view t = htmlToElement 100 100 <| text ("coucou " ++ toString t) +view dim t = htmlToElement ((fst dim) - 50) ((snd dim) - 50) <| + div [class "chart"] [text ("Loading... " ++ toString t)] port xpos : Signal Int port xpos = Signal.map fst Mouse.position + +port point : Signal (Time,(Int,Int)) +port point = timestamp Mouse.position diff --git a/index.html b/index.html index fcb3c13..d10a6af 100644 --- a/index.html +++ b/index.html @@ -11,21 +11,9 @@ - -

TEST

-

This is a test.

-
Loading...
-
-
- +