2022-03-05 20:05:12 +03:00
|
|
|
module Route.Hex.Hex_ exposing (Data, Model, Msg, page)
|
2021-12-28 01:22:59 +03:00
|
|
|
|
|
|
|
import ColorHelpers
|
|
|
|
import DataSource exposing (DataSource)
|
2022-03-05 20:50:01 +03:00
|
|
|
import RouteBuilder exposing (StatelessRoute, StaticPayload)
|
2021-12-28 01:22:59 +03:00
|
|
|
|
|
|
|
|
|
|
|
type alias Model =
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
type alias Msg =
|
2022-01-06 01:09:37 +03:00
|
|
|
()
|
2021-12-28 01:22:59 +03:00
|
|
|
|
|
|
|
|
|
|
|
type alias RouteParams =
|
|
|
|
{ hex : String }
|
|
|
|
|
|
|
|
|
|
|
|
type alias Data =
|
|
|
|
ColorHelpers.Data
|
|
|
|
|
|
|
|
|
2022-03-05 20:50:01 +03:00
|
|
|
page : StatelessRoute RouteParams Data
|
2021-12-28 01:22:59 +03:00
|
|
|
page =
|
2022-03-05 20:50:01 +03:00
|
|
|
RouteBuilder.preRenderWithFallback
|
2021-12-28 01:22:59 +03:00
|
|
|
{ head = ColorHelpers.head toCssVal
|
|
|
|
, pages = pages
|
|
|
|
, data = ColorHelpers.data
|
|
|
|
}
|
2022-03-05 20:50:01 +03:00
|
|
|
|> RouteBuilder.buildNoState { view = ColorHelpers.view toCssVal }
|
2021-12-28 01:22:59 +03:00
|
|
|
|
|
|
|
|
|
|
|
toCssVal : RouteParams -> String
|
|
|
|
toCssVal routeParams =
|
|
|
|
"#" ++ routeParams.hex
|
|
|
|
|
|
|
|
|
|
|
|
pages : DataSource (List RouteParams)
|
|
|
|
pages =
|
|
|
|
DataSource.succeed []
|