Skip to content

Instantly share code, notes, and snippets.

@chuck0523
Created April 18, 2016 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuck0523/fdf7822b409d81e7d508e5294aaac05d to your computer and use it in GitHub Desktop.
Save chuck0523/fdf7822b409d81e7d508e5294aaac05d to your computer and use it in GitHub Desktop.
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