2013-02-22 23:19:40 +00:00
|
|
|
|
|
|
|
module Window where
|
|
|
|
|
2013-09-08 20:33:48 +00:00
|
|
|
{-| Provides information about the container that your Elm program lives in.
|
|
|
|
When you embed Elm in a `<div>` it gives the dimensions of the container, not
|
|
|
|
the whole window.
|
|
|
|
|
|
|
|
# Dimensions
|
|
|
|
@docs dimensions, width, height
|
|
|
|
|
|
|
|
-}
|
|
|
|
|
2013-07-29 17:26:53 +00:00
|
|
|
import Signal (Signal)
|
2013-07-29 21:23:04 +00:00
|
|
|
import Native.Window
|
2013-03-13 07:00:02 +00:00
|
|
|
|
2013-09-08 20:33:48 +00:00
|
|
|
{-| The current width and height of the window (i.e. the area viewable to the
|
|
|
|
user, not including scroll bars). -}
|
2013-02-22 23:19:40 +00:00
|
|
|
dimensions : Signal (Int,Int)
|
2013-07-29 21:23:04 +00:00
|
|
|
dimensions = Native.Window.dimensions
|
2013-02-22 23:19:40 +00:00
|
|
|
|
2013-09-08 20:33:48 +00:00
|
|
|
{-| The current width of the window. -}
|
2013-02-22 23:19:40 +00:00
|
|
|
width : Signal Int
|
2013-07-29 21:23:04 +00:00
|
|
|
width = Native.Window.width
|
2013-02-22 23:19:40 +00:00
|
|
|
|
2013-09-08 20:33:48 +00:00
|
|
|
{-| The current height of the window. -}
|
2013-02-22 23:19:40 +00:00
|
|
|
height : Signal Int
|
2013-07-29 21:23:04 +00:00
|
|
|
height = Native.Window.height
|