mirror of
https://gitlab.com/upRootNutrition/website.git
synced 2025-06-16 04:25:11 -05:00
refactor: map abuse
This commit is contained in:
parent
718a9ecaa7
commit
7c0577d3d9
7 changed files with 590 additions and 196 deletions
|
@ -1,18 +1,83 @@
|
|||
module Pages.Services exposing (page)
|
||||
module Pages.Services exposing (Model, Msg, page)
|
||||
|
||||
import Config.Identity as ID exposing (..)
|
||||
import Config.Theme as T exposing (..)
|
||||
import Effect exposing (Effect)
|
||||
import Element exposing (..)
|
||||
import Element.Background as B
|
||||
import Element.Font as F
|
||||
import Element.Region exposing (description)
|
||||
import Html.Attributes as H exposing (style)
|
||||
import Layouts
|
||||
import Page exposing (Page)
|
||||
import Route exposing (Route)
|
||||
import Shared
|
||||
import View exposing (View)
|
||||
|
||||
|
||||
page : View msg
|
||||
page =
|
||||
page : Shared.Model -> Route () -> Page Model Msg
|
||||
page shared route =
|
||||
Page.new
|
||||
{ init = init
|
||||
, update = update
|
||||
, subscriptions = subscriptions
|
||||
, view = view
|
||||
}
|
||||
|> Page.withLayout toLayout
|
||||
|
||||
|
||||
toLayout : Model -> Layouts.Layout Msg
|
||||
toLayout model =
|
||||
Layouts.Navbar {}
|
||||
|
||||
|
||||
|
||||
-- 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
|
||||
|
||||
|
||||
view : Model -> View Msg
|
||||
view model =
|
||||
{ title = servicesName
|
||||
, attributes = [ F.family [ spartanFont ] ]
|
||||
, attributes = []
|
||||
, element = servicesContainer
|
||||
}
|
||||
|
||||
|
@ -25,15 +90,25 @@ servicesContainer =
|
|||
servicesList : Element msg
|
||||
servicesList =
|
||||
column
|
||||
[ spacing 20
|
||||
[ spacing 40
|
||||
, centerX
|
||||
, centerY
|
||||
]
|
||||
services
|
||||
|
||||
|
||||
services : List (Element msg)
|
||||
services =
|
||||
type alias MakeRowInput =
|
||||
{ logoImage : String
|
||||
, logoDescription : String
|
||||
, servicesLink : String
|
||||
, servicesTitle : String
|
||||
, servicesRate : String
|
||||
, servicesDescription : String
|
||||
}
|
||||
|
||||
|
||||
makeRow : MakeRowInput -> Element msg
|
||||
makeRow makeRowInput =
|
||||
let
|
||||
servicesImageFormat : List (Attribute msg)
|
||||
servicesImageFormat =
|
||||
|
@ -41,71 +116,59 @@ services =
|
|||
, alignTop
|
||||
]
|
||||
in
|
||||
[ column
|
||||
[ spacing 40 ]
|
||||
[ row [ imageSpacer ]
|
||||
[ image servicesImageFormat
|
||||
{ src = "debate.png"
|
||||
, description = "debate logo"
|
||||
}
|
||||
, column paragraphColumnFormat
|
||||
[ row [ spacing 8 ]
|
||||
[ newTabLink titleFormat
|
||||
{ url = "https://the-nutrivore.social/"
|
||||
, label = text "DEBATE COACHING"
|
||||
}
|
||||
, paragraph [ F.color colourTheme.nonHighlightedText ] [ text "$60/hr" ]
|
||||
]
|
||||
, paragraph paragraphFormat [ text "Participate in a structured course consisting of five one-hour modules, covering critical thinking, debate strategy, propositional logic, and more. Throughout the course you will receive both personalized and generalizable advice on how to improve your debate performance." ]
|
||||
]
|
||||
]
|
||||
, row [ imageSpacer ]
|
||||
[ image servicesImageFormat
|
||||
{ src = "analysis.png"
|
||||
, description = "analysis logo"
|
||||
}
|
||||
, column paragraphColumnFormat
|
||||
[ row [ spacing 8 ]
|
||||
[ newTabLink titleFormat
|
||||
{ url = "https://the-nutrivore.social/"
|
||||
, label = text "DEBATE ANALYSIS"
|
||||
}
|
||||
, paragraph [ F.color colourTheme.nonHighlightedText ] [ text "$80/hr" ]
|
||||
]
|
||||
, paragraph paragraphFormat [ text "Participate in focused one-hour sessions wherein your own recorded debates are analyzed for constructive feedback and advice to help you improve as a debater. You may also participate in mock debates, staged debates, and other exercises to help you get more comfortable with debate and verbal confrontation." ]
|
||||
]
|
||||
]
|
||||
, row [ imageSpacer ]
|
||||
[ image servicesImageFormat
|
||||
{ src = "nutrition.png"
|
||||
, description = "analysis logo"
|
||||
}
|
||||
, column paragraphColumnFormat
|
||||
[ row [ spacing 8 ]
|
||||
[ newTabLink titleFormat
|
||||
{ url = "https://the-nutrivore.social/"
|
||||
, label = text "NUTRITION SCIENCE"
|
||||
}
|
||||
, paragraph [ F.color colourTheme.nonHighlightedText ] [ text "$40/hr" ]
|
||||
]
|
||||
, paragraph paragraphFormat [ text "Participate in a one-hour Q&A session specifically to inquire about nutrition science. Ask questions about research design, methodology, epistemology, and study interpretation. Also, by participating you will also gain access to nutrition science interpretation cheat-sheets that will streamline and simply the research appraisal process." ]
|
||||
]
|
||||
]
|
||||
, row [ imageSpacer ]
|
||||
[ image servicesImageFormat
|
||||
{ src = "nixos.png"
|
||||
, description = "debate logo"
|
||||
}
|
||||
, column paragraphColumnFormat
|
||||
[ row [ spacing 8 ]
|
||||
[ newTabLink titleFormat
|
||||
{ url = "https://the-nutrivore.social/"
|
||||
, label = text "CUSTOM NIX BUILDS"
|
||||
}
|
||||
, paragraph [ F.color colourTheme.nonHighlightedText ] [ text "$40/hr" ]
|
||||
]
|
||||
, paragraph paragraphFormat [ text "NixOS has become popular in my community, with many people choosing to explore it over Windows, MacOS, and other Linux distributions. Naturally, as a consequence of this, I receive numerous requests for help regarding the Nix programming language and NixOS system configuration. So, to fast-track newcomers and to make my life a little bit easier for both of us, I'm offering to build custom NixOS configurations for interested clients." ]
|
||||
row [ imageSpacer ]
|
||||
[ image servicesImageFormat
|
||||
{ src = makeRowInput.logoImage
|
||||
, description = makeRowInput.logoDescription
|
||||
}
|
||||
, column paragraphColumnFormat
|
||||
[ row [ spacing 8 ]
|
||||
[ newTabLink titleFormat
|
||||
{ url = makeRowInput.servicesLink
|
||||
, label =
|
||||
el
|
||||
[ mouseOver [ F.color (rgb255 255 50 0) ]
|
||||
, htmlAttribute <| style "transition" "all .2s"
|
||||
]
|
||||
<|
|
||||
text makeRowInput.servicesTitle
|
||||
}
|
||||
, paragraph [ F.color colourTheme.nonHighlightedText ] [ text makeRowInput.servicesRate ]
|
||||
]
|
||||
, paragraph paragraphFormat [ text makeRowInput.servicesDescription ]
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
services : List (Element msg)
|
||||
services =
|
||||
List.map makeRow
|
||||
[ { logoImage = "debate.png"
|
||||
, logoDescription = "debate logo"
|
||||
, servicesLink = "https://the-nutrivore.social/"
|
||||
, servicesTitle = "DEBATE COACHING"
|
||||
, servicesRate = "$60/hr"
|
||||
, servicesDescription = "Participate in a structured course consisting of five one-hour modules, covering critical thinking, debate strategy, propositional logic, and more. Throughout the course you will receive both personalized and generalizable advice on how to improve your debate performance."
|
||||
}
|
||||
, { logoImage = "analysis.png"
|
||||
, logoDescription = "analysis logo"
|
||||
, servicesLink = "https://the-nutrivore.social/"
|
||||
, servicesTitle = "DEBATE ANALYSIS"
|
||||
, servicesRate = "$80/hr"
|
||||
, servicesDescription = "Participate in focused one-hour sessions wherein your own recorded debates are analyzed for constructive feedback and advice to help you improve as a debater. You may also participate in mock debates, staged debates, and other exercises to help you get more comfortable with debate and verbal confrontation."
|
||||
}
|
||||
, { logoImage = "nutrition.png"
|
||||
, logoDescription = "nutrition logo"
|
||||
, servicesLink = "https://the-nutrivore.social/"
|
||||
, servicesTitle = "NUTRITION SCIENCE"
|
||||
, servicesRate = "$40/hr"
|
||||
, servicesDescription = "Participate in a one-hour Q&A session specifically to inquire about nutrition science. Ask questions about research design, methodology, epistemology, and study interpretation. Also, by participating you will also gain access to nutrition science interpretation cheat-sheets that will streamline and simply the research appraisal process."
|
||||
}
|
||||
, { logoImage = "nixos.png"
|
||||
, logoDescription = "debate logo"
|
||||
, servicesLink = "https://the-nutrivore.social/"
|
||||
, servicesTitle = "CUSTOM NIX BUILDS"
|
||||
, servicesRate = "$40/hr"
|
||||
, servicesDescription = "NixOS has become popular in my community, with many people choosing to explore it over Windows, MacOS, and other Linux distributions. Naturally, as a consequence of this, I receive numerous requests for help regarding the Nix programming language and NixOS system configuration. So, to fast-track newcomers and to make my life a little bit easier for both of us, I'm offering to build custom NixOS configurations for interested clients."
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue