website/frontend/src/Pages/Services/Elm.elm

404 lines
13 KiB
Elm
Raw Normal View History

2024-12-11 02:38:42 -06:00
module Pages.Services.Elm exposing (Model, Msg, page)
2024-12-22 04:36:03 -06:00
import Config.Helpers.Cards.Helpers exposing (cardMaker)
import Config.Helpers.Cards.Types as C
2024-12-12 01:36:31 -06:00
import Config.Helpers.Format exposing (..)
2024-12-22 04:36:03 -06:00
import Config.Helpers.Headers.Helpers exposing (..)
2024-12-18 20:11:04 -06:00
import Config.Helpers.Headers.Types exposing (Header)
2024-12-12 01:36:31 -06:00
import Config.Helpers.Response
exposing
( pageList
, topLevelContainer
)
2024-12-18 20:11:04 -06:00
import Config.Helpers.ServiceFormat exposing (..)
2024-12-12 01:36:31 -06:00
import Config.Helpers.ToolTip exposing (..)
2024-12-15 02:31:26 -06:00
import Config.Pages.Services.Records.ElmBuilds exposing (servicesElmBuilds)
2024-12-12 22:48:20 -06:00
import Config.Style.Colour exposing (..)
2024-12-12 01:36:31 -06:00
import Config.Style.Transitions
exposing
( hoverFontDarkOrange
, transitionStyleFast
, transitionStyleSlow
)
2024-12-11 02:38:42 -06:00
import Effect exposing (Effect)
2024-12-12 01:36:31 -06:00
import Element as E exposing (..)
import Element.Background as B
import Element.Border as D
import Element.Font as F
2024-12-11 02:38:42 -06:00
import Html
2024-12-12 01:36:31 -06:00
import Html.Attributes as H exposing (style)
import Layouts
2024-12-11 02:38:42 -06:00
import Page exposing (Page)
2024-12-12 01:36:31 -06:00
import Route exposing (Route)
import Route.Path as Path
2024-12-11 02:38:42 -06:00
import Shared
import View exposing (View)
page : Shared.Model -> Route () -> Page Model Msg
page shared route =
Page.new
{ init = init
, update = update
, subscriptions = subscriptions
2024-12-12 01:36:31 -06:00
, view = view shared
2024-12-11 02:38:42 -06:00
}
2024-12-12 01:36:31 -06:00
|> Page.withLayout toLayout
toLayout : Model -> Layouts.Layout Msg
toLayout model =
Layouts.Navbar {}
2024-12-11 02:38:42 -06:00
-- INIT
type alias Model =
{}
init : () -> ( Model, Effect Msg )
init () =
( {}
, Effect.none
)
-- UPDATE
type Msg
= NoOp
update : Msg -> Model -> ( Model, Effect Msg )
update msg model =
case msg of
NoOp ->
( model
, Effect.none
)
-- SUBSCRIPTIONS
subscriptions : Model -> Sub Msg
subscriptions model =
Sub.none
-- VIEW
2024-12-12 01:36:31 -06:00
view : Shared.Model -> Model -> View Msg
view shared model =
{ title = "services (elmBuilds)"
, attributes = []
, element = elmBuildsContainer shared.device
}
elmBuildsContainer : Device -> Element msg
elmBuildsContainer device =
topLevelContainer (elmBuildsList device)
elmBuildsList : Device -> Element msg
elmBuildsList device =
2024-12-22 04:36:03 -06:00
column
2024-12-21 23:23:59 -06:00
(case ( device.class, device.orientation ) of
_ ->
pageList
)
<|
2024-12-12 01:36:31 -06:00
List.concat
2024-12-22 04:36:03 -06:00
[ List.map
2024-12-21 23:23:59 -06:00
(\service ->
2024-12-22 04:36:03 -06:00
cardMaker device (C.ServicePage service) contentList
2024-12-21 23:23:59 -06:00
)
2024-12-22 04:36:03 -06:00
[ servicesElmBuilds ]
2024-12-21 23:23:59 -06:00
]
contentList : List (Element msg)
contentList =
[ column
bodyFormat
[ chunkMaker servicesElmBuilds.serviceArticle.articleParagraph.paragraph1
, chunkMaker servicesElmBuilds.serviceArticle.articleParagraph.paragraph2
, chunkMaker servicesElmBuilds.serviceArticle.articleParagraph.paragraph3
, titleMaker servicesElmBuilds.serviceArticle.articleTitles.title1
, numberMaker servicesElmBuilds.serviceArticle.articleListEntries.list1
, titleMaker servicesElmBuilds.serviceArticle.articleTitles.title2
, bulletPointMaker servicesElmBuilds.serviceArticle.articleListEntries.list2
, titleMaker servicesElmBuilds.serviceArticle.articleTitles.title3
, elmCodeRenderer
2024-12-12 01:36:31 -06:00
]
]
2024-12-12 22:48:20 -06:00
elmCodeRenderer : Element msg
elmCodeRenderer =
el
[ paddingEach
{ top = 15
, bottom = 15
, left = 20
, right = 20
}
, B.color colourTheme.backgroundLightGrey
, D.rounded 10
, width fill
, spacing 8
]
<|
column
[ F.size 14
, spacing 5
, width fill
]
[ renderCodeLine syntaxTheme
[ text ""
|> el [ paddingXY 0 0 ]
, text "barMaker"
|> el [ F.color syntaxTheme.key ]
, text " : "
|> el [ F.color syntaxTheme.operator ]
, text "("
|> el [ F.color syntaxTheme.punctuation ]
, text "Int"
|> el [ F.color syntaxTheme.keyword ]
, text " -> "
|> el [ F.color syntaxTheme.operator ]
, text "String"
|> el [ F.color syntaxTheme.keyword ]
, text ")"
|> el [ F.color syntaxTheme.punctuation ]
, text " -> "
|> el [ F.color syntaxTheme.operator ]
, text "Int"
|> el [ F.color syntaxTheme.keyword ]
, text " -> "
|> el [ F.color syntaxTheme.operator ]
, text "Element"
|> el [ F.color syntaxTheme.keyword ]
, text " msg"
]
, renderCodeLine syntaxTheme
[ text ""
|> el [ paddingXY 0 0 ]
, text "barMaker"
|> el [ F.color syntaxTheme.key ]
, text " getToolTip"
, text " num"
, text " ="
|> el [ F.color syntaxTheme.operator ]
]
, renderCodeLine syntaxTheme
[ text ""
|> el [ paddingXY 16 0 ]
, text "el"
]
, renderCodeLine syntaxTheme
[ text ""
|> el [ paddingXY 28 0 ]
, text "("
|> el [ F.color syntaxTheme.punctuation ]
, text "["
|> el [ F.color syntaxTheme.punctuation ]
, text " Element"
|> el [ F.color syntaxTheme.keyword ]
, text "."
|> el [ F.color syntaxTheme.punctuation ]
, text "height"
, text " <| "
|> el [ F.color syntaxTheme.operator ]
, text "px"
, text " 12"
|> el [ F.color syntaxTheme.string ]
]
, renderCodeLine syntaxTheme
[ text ""
|> el [ paddingXY 32 0 ]
, text ","
|> el [ F.color syntaxTheme.punctuation ]
, text " Element"
|> el [ F.color syntaxTheme.keyword ]
, text "."
|> el [ F.color syntaxTheme.punctuation ]
, text "width"
, text " fill"
]
, renderCodeLine syntaxTheme
[ text ""
|> el [ paddingXY 32 0 ]
, text ","
|> el [ F.color syntaxTheme.punctuation ]
, text " Border"
|> el [ F.color syntaxTheme.keyword ]
, text "."
|> el [ F.color syntaxTheme.punctuation ]
, text "rounded"
, text " 10"
|> el [ F.color syntaxTheme.string ]
]
, renderCodeLine syntaxTheme
[ text ""
|> el [ paddingXY 32 0 ]
, text ","
|> el [ F.color syntaxTheme.punctuation ]
, text " Border"
|> el [ F.color syntaxTheme.keyword ]
, text "."
|> el [ F.color syntaxTheme.punctuation ]
, text "color"
, text " colourTheme"
, text "."
|> el [ F.color syntaxTheme.punctuation ]
, text "textDarkGrey"
]
, renderCodeLine syntaxTheme
[ text ""
|> el [ paddingXY 32 0 ]
, text ","
|> el [ F.color syntaxTheme.punctuation ]
, text " Border"
|> el [ F.color syntaxTheme.keyword ]
, text "."
|> el [ F.color syntaxTheme.punctuation ]
, text "width"
, text " 2"
]
, renderCodeLine syntaxTheme
[ text ""
|> el [ paddingXY 32 0 ]
, text ","
|> el [ F.color syntaxTheme.punctuation ]
, text " Background"
|> el [ F.color syntaxTheme.keyword ]
, text "."
|> el [ F.color syntaxTheme.punctuation ]
, text "gradient"
]
, renderCodeLine syntaxTheme
[ text ""
|> el [ paddingXY 48 0 ]
, text "{"
|> el [ F.color syntaxTheme.punctuation ]
, text " angle"
, text " = "
|> el [ F.color syntaxTheme.operator ]
, text "1.57"
|> el [ F.color syntaxTheme.string ]
]
, renderCodeLine syntaxTheme
[ text ""
|> el [ paddingXY 48 0 ]
, text ","
|> el [ F.color syntaxTheme.punctuation ]
, text " steps"
, text " = "
]
, renderCodeLine syntaxTheme
[ text ""
|> el [ paddingXY 56 0 ]
, text "List"
|> el [ F.color syntaxTheme.keyword ]
, text "."
|> el [ F.color syntaxTheme.punctuation ]
, text "concat"
]
, renderCodeLine syntaxTheme
[ text ""
|> el [ paddingXY 62 0 ]
, text "[ "
|> el [ F.color syntaxTheme.punctuation ]
, text "List"
|> el [ F.color syntaxTheme.keyword ]
, text "."
|> el [ F.color syntaxTheme.punctuation ]
, text "repeat"
, text " num "
, text "colourTheme"
, text "."
|> el [ F.color syntaxTheme.punctuation ]
, text "barGreen"
]
, renderCodeLine syntaxTheme
[ text ""
|> el [ paddingXY 62 0 ]
, text ", "
|> el [ F.color syntaxTheme.punctuation ]
, text "List"
|> el [ F.color syntaxTheme.keyword ]
, text "."
|> el [ F.color syntaxTheme.punctuation ]
, text "repeat"
, text " ("
|> el [ F.color syntaxTheme.punctuation ]
, text "10"
|> el [ F.color syntaxTheme.string ]
, text " - "
|> el [ F.color syntaxTheme.operator ]
, text "num"
, text " )"
|> el [ F.color syntaxTheme.punctuation ]
, text " colourTheme"
, text "."
|> el [ F.color syntaxTheme.punctuation ]
, text "barRed"
]
, renderCodeLine syntaxTheme
[ text ""
|> el [ paddingXY 62 0 ]
, text "]"
|> el [ F.color syntaxTheme.punctuation ]
]
, renderCodeLine syntaxTheme
[ text ""
|> el [ paddingXY 48 0 ]
, text "}"
|> el [ F.color syntaxTheme.punctuation ]
]
, renderCodeLine syntaxTheme
[ text ""
|> el [ paddingXY 40 0 ]
, text "]"
|> el [ F.color syntaxTheme.punctuation ]
]
, renderCodeLine syntaxTheme
[ text ""
|> el [ paddingXY 48 0 ]
, text "++"
|> el [ F.color syntaxTheme.operator ]
, text " [ "
|> el [ F.color syntaxTheme.punctuation ]
, text "tooltip"
, text " ("
|> el [ F.color syntaxTheme.punctuation ]
, text "getToolTip"
, text " num"
, text ")"
|> el [ F.color syntaxTheme.punctuation ]
, text " ]"
|> el [ F.color syntaxTheme.punctuation ]
]
, renderCodeLine syntaxTheme
[ text ""
|> el [ paddingXY 28 0 ]
, text ")"
|> el [ F.color syntaxTheme.punctuation ]
]
, renderCodeLine syntaxTheme
[ text ""
|> el [ paddingXY 28 0 ]
, text "none"
]
]