mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-23 11:55:41 +03:00
42 lines
759 B
Elm
42 lines
759 B
Elm
module Route.Hex.Hex_ exposing (Data, Model, Msg, route)
|
|
|
|
import ColorHelpers
|
|
import DataSource exposing (DataSource)
|
|
import RouteBuilder exposing (StatelessRoute, StaticPayload)
|
|
|
|
|
|
type alias Model =
|
|
{}
|
|
|
|
|
|
type alias Msg =
|
|
()
|
|
|
|
|
|
type alias RouteParams =
|
|
{ hex : String }
|
|
|
|
|
|
type alias Data =
|
|
ColorHelpers.Data
|
|
|
|
|
|
route : StatelessRoute RouteParams Data
|
|
route =
|
|
RouteBuilder.preRenderWithFallback
|
|
{ head = ColorHelpers.head toCssVal
|
|
, pages = pages
|
|
, data = ColorHelpers.data
|
|
}
|
|
|> RouteBuilder.buildNoState { view = ColorHelpers.view toCssVal }
|
|
|
|
|
|
toCssVal : RouteParams -> String
|
|
toCssVal routeParams =
|
|
"#" ++ routeParams.hex
|
|
|
|
|
|
pages : DataSource (List RouteParams)
|
|
pages =
|
|
DataSource.succeed []
|