Files
elm-0.19-workshop/intro/part2/src/Main.elm
2018-08-14 03:48:43 -04:00

51 lines
1.2 KiB
Elm
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
module Main exposing (main)
import Html exposing (..)
import Html.Attributes exposing (..)
viewTags tags =
let
renderedTags =
List.map viewTag tags
in
div [ class "tag-list" ] renderedTags
viewTag tagName =
button [ class "tag-pill tag-default" ] [ text tagName ]
main =
let
tags =
[ "elm", "fun", "programming", "compilers" ]
in
div [ class "home-page" ]
[ viewBanner
, div [ class "container page" ]
[ div [ class "row" ]
[ div [ class "col-md-9" ] [ viewFeed ]
, div [ class "col-md-3" ]
[ div [ class "sidebar" ]
[ p [] [ text "Popular Tags" ]
, viewTags tags
]
]
]
]
]
viewBanner =
div [ class "banner" ]
[ div [ class "container" ]
[ h1 [ class "logo-font" ] [ text "conduit" ]
, p [] [ text "A place to share your knowledge." ]
]
]
viewFeed =
div [ class "feed-toggle" ] [ text "(Well display some articles here later.)" ]