Created
January 9, 2016 04:19
-
-
Save robwhitaker/d94f2bced7923a3341c7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Graphics.Element exposing (..) | |
import Window | |
import Graphics.Input exposing (..) | |
main : Signal Element | |
main = Signal.map content Window.dimensions | |
divI a b = round (toFloat a / b) | |
content : (Int, Int) -> Element | |
content (x,y) = | |
let w = x // 2 | |
h = y | |
in | |
flow outward | |
[ | |
flow right | |
[ fittedImage w h "http://cdn.onextrapixel.com/wp-content/uploads/2013/07/clean-coding-best-practices.jpg" | |
, fittedImage w h "http://cdn1.theodysseyonline.com/files/2015/11/27/635841957604688445-623502608_power-of-words-by-antonio-litterio-creative-commons-attribution-share-alike-3-0.jpg" | |
] | |
, container x y middle <| flow right | |
[ container (divI w 2) h middle (button (Signal.message mailbox.address ()) "Developer") | |
, container (max 200 <| divI w 3) h middle (image (max 200 <| divI w 3) (max 200 <| divI w 3) "http://robertjwhitaker.com/img/me.png") | |
, container (divI w 2) h middle (button (Signal.message mailbox.address ()) "Writer") | |
] | |
] | |
mailbox = Signal.mailbox () |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment