Created
April 18, 2016 21:22
-
-
Save chuck0523/fdf7822b409d81e7d508e5294aaac05d to your computer and use it in GitHub Desktop.
This file contains 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
view : Signal.Address Action -> Model -> Html | |
view address model = | |
div [ style [ ("width", "200px")] ] | |
[ h2 [headerStyle] [text model.topic] | |
, div [imgStyle model.gifUrl] [] | |
, button [ onClick address RequestMore ] [ text "More Please!" ] | |
] | |
headerStyle : Attribute | |
headerStyle = | |
style | |
[ ("width", "200px") | |
, ("text-align", "center") | |
] | |
imgStyle : String -> Attribute | |
imgStyle url = | |
style | |
[ ("display", "inline-block") | |
, ("width", "200px") | |
, ("height", "200px") | |
, ("background-position", "center center") | |
, ("background-size", "cover") | |
, ("background-image", "url('" ++ url ++ "')") | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment