elm-pages-v3-beta/examples/pokedex/app/Page/Hex/Hex_.elm

42 lines
726 B
Elm
Raw Normal View History

module Page.Hex.Hex_ exposing (Data, Model, Msg, page)
import ColorHelpers
import DataSource exposing (DataSource)
import Page exposing (Page, PageWithState, StaticPayload)
type alias Model =
{}
type alias Msg =
()
type alias RouteParams =
{ hex : String }
type alias Data =
ColorHelpers.Data
page : Page RouteParams Data
page =
Page.preRenderWithFallback
{ head = ColorHelpers.head toCssVal
, pages = pages
, data = ColorHelpers.data
}
|> Page.buildNoState { view = ColorHelpers.view toCssVal }
toCssVal : RouteParams -> String
toCssVal routeParams =
"#" ++ routeParams.hex
pages : DataSource (List RouteParams)
pages =
DataSource.succeed []