website/frontend/src/Pages/Services.elm

167 lines
3.7 KiB
Elm
Raw Normal View History

2024-11-11 03:57:54 -06:00
module Pages.Services exposing (Model, Msg, page)
2024-11-11 00:43:03 -06:00
2024-11-11 21:57:27 -06:00
import Config.Colour as T exposing (..)
import Config.Format as O exposing (..)
import Config.Identity as I exposing (..)
import Config.Response exposing (..)
2024-12-03 04:59:27 -06:00
import Config.Viewport exposing (..)
2024-11-11 03:57:54 -06:00
import Effect exposing (Effect)
2024-11-11 00:43:03 -06:00
import Element exposing (..)
import Element.Font as F
2024-12-01 02:56:13 -06:00
import Headers.Helpers exposing (headerMaker)
import Headers.Pages.Services exposing (servicesHeader)
2024-11-11 03:57:54 -06:00
import Html.Attributes as H exposing (style)
import Layouts
import Page exposing (Page)
import Route exposing (Route)
2024-11-26 04:32:11 -06:00
import Services.Helpers exposing (..)
2024-11-28 19:28:24 -06:00
import Services.Offerings.DebateAnalysis exposing (..)
import Services.Offerings.DebateTutoring exposing (..)
import Services.Offerings.ElmBuilds exposing (..)
import Services.Offerings.NixBuilds exposing (..)
import Services.Offerings.NutritionScience exposing (..)
2024-11-16 17:48:59 -06:00
import Shared exposing (..)
2024-11-11 00:43:03 -06:00
import View exposing (View)
2024-11-11 03:57:54 -06:00
page : Shared.Model -> Route () -> Page Model Msg
page shared route =
Page.new
{ init = init
, update = update
, subscriptions = subscriptions
, view = view shared
2024-11-11 03:57:54 -06:00
}
|> Page.withLayout toLayout
toLayout : Model -> Layouts.Layout Msg
toLayout model =
Layouts.Navbar { currentRoute = servicesName }
2024-11-11 03:57:54 -06:00
-- INIT
type alias Model =
{}
init : () -> ( Model, Effect Msg )
init () =
( {}
2024-12-03 04:59:27 -06:00
, Effect.map
(\_ -> NoOp)
(Effect.sendCmd resetViewport)
2024-11-11 03:57:54 -06:00
)
-- 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
view : Shared.Model -> Model -> View Msg
view shared model =
2024-11-11 00:43:03 -06:00
{ title = servicesName
2024-11-11 03:57:54 -06:00
, attributes = []
, element = servicesContainer shared.device
2024-11-11 00:43:03 -06:00
}
servicesContainer : Device -> Element msg
servicesContainer device =
topLevelContainer (servicesList device)
2024-11-11 00:43:03 -06:00
servicesList : Device -> Element msg
servicesList device =
2024-11-11 00:43:03 -06:00
column
(case ( device.class, device.orientation ) of
( Phone, Portrait ) ->
pageListDesktop
( Phone, Landscape ) ->
pageListDesktop
( Tablet, Portrait ) ->
pageListDesktop
( Tablet, Landscape ) ->
pageListDesktop
( Desktop, Portrait ) ->
pageListDesktop
( Desktop, Landscape ) ->
pageListDesktop
( BigDesktop, Portrait ) ->
pageListDesktop
( BigDesktop, Landscape ) ->
pageListDesktop
)
2024-11-16 17:28:46 -06:00
<|
2024-12-01 02:56:13 -06:00
List.concat
[ List.map headerMaker
[ servicesHeader ]
, (case ( device.class, device.orientation ) of
( Phone, Portrait ) ->
List.map serviceMakerMobile
( Phone, Landscape ) ->
List.map serviceMakerMobile
( Tablet, Portrait ) ->
List.map serviceMakerMobile
( Tablet, Landscape ) ->
List.map serviceMakerMobile
( Desktop, Portrait ) ->
List.map serviceMaker
( Desktop, Landscape ) ->
List.map serviceMaker
( BigDesktop, Portrait ) ->
List.map serviceMaker
( BigDesktop, Landscape ) ->
List.map serviceMaker
)
2024-12-01 02:56:13 -06:00
[ servicesDebateAnalysis
, servicesDebateTutoring
, servicesNutritionScience
, servicesNixBuilds
, servicesElmBuilds
]
2024-11-11 00:43:03 -06:00
]