mirror of
https://gitlab.com/upRootNutrition/website.git
synced 2025-06-16 04:25:11 -05:00
128 lines
2.5 KiB
Elm
Executable file
128 lines
2.5 KiB
Elm
Executable file
module Pages.Blog.Bigfatsurprise exposing (Model, Msg, page)
|
|
|
|
import Config.Data.Identity exposing (pageNames)
|
|
import Config.Helpers.Articles.Article exposing (articleMaker)
|
|
import Config.Helpers.CardFormat
|
|
exposing
|
|
( cardContentSpacing
|
|
, cardFormatter
|
|
, cardMaker
|
|
, cardSubTitleMaker
|
|
, cardTitleMaker
|
|
, desktopCardMaker
|
|
, desktopImageBoxSize
|
|
, desktopImageSize
|
|
, fieldSpacer
|
|
, mobileCardMaker
|
|
, mobileImageBoxSize
|
|
, mobileImageSize
|
|
, topLevelBox
|
|
)
|
|
import Config.Helpers.Headers.Types exposing (Header)
|
|
import Config.Helpers.Response
|
|
exposing
|
|
( pageList
|
|
, topLevelContainer
|
|
)
|
|
import Config.Helpers.Viewport exposing (resetViewport)
|
|
import Config.Pages.Blog.Records.BigFatSurprise exposing (articleBigFatSurprise)
|
|
import Effect exposing (Effect)
|
|
import Element as E exposing (..)
|
|
import Layouts
|
|
import Page exposing (Page)
|
|
import Route exposing (Route)
|
|
import Shared exposing (..)
|
|
import View exposing (View)
|
|
|
|
|
|
page : Shared.Model -> Route () -> Page Model Msg
|
|
page shared route =
|
|
Page.new
|
|
{ init = init
|
|
, update = update
|
|
, subscriptions = subscriptions
|
|
, view = view shared
|
|
}
|
|
|> Page.withLayout toLayout
|
|
|
|
|
|
toLayout : Model -> Layouts.Layout Msg
|
|
toLayout model =
|
|
Layouts.Navbar {}
|
|
|
|
|
|
|
|
-- INIT
|
|
|
|
|
|
type alias Model =
|
|
{}
|
|
|
|
|
|
init : () -> ( Model, Effect Msg )
|
|
init () =
|
|
( {}
|
|
, Effect.map
|
|
(\_ -> NoOp)
|
|
(Effect.sendCmd resetViewport)
|
|
)
|
|
|
|
|
|
|
|
-- 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 =
|
|
{ title = pageNames.pageHyperBlog ++ " (bigFatSurprise)"
|
|
, attributes = []
|
|
, element = articleContainer shared.device
|
|
}
|
|
|
|
|
|
articleContainer : Device -> Element msg
|
|
articleContainer device =
|
|
topLevelContainer (articleList device)
|
|
|
|
|
|
articleList : Device -> Element msg
|
|
articleList device =
|
|
column
|
|
(case ( device.class, device.orientation ) of
|
|
_ ->
|
|
pageList
|
|
)
|
|
<|
|
|
List.concat
|
|
[ (case ( device.class, device.orientation ) of
|
|
_ ->
|
|
List.map articleMaker
|
|
)
|
|
[ articleBigFatSurprise ]
|
|
]
|