website/frontend/src/Pages/Dodgers.elm

220 lines
5.3 KiB
Elm
Raw Normal View History

2024-11-11 03:57:54 -06:00
module Pages.Dodgers 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 (..)
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-11-11 03:57:54 -06:00
import Html.Attributes as H exposing (style)
import Layouts
import Page exposing (Page)
import Route exposing (Route)
import Shared
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
}
|> 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 = dodgersName
, attributes = []
2024-11-11 00:43:03 -06:00
, element = dodgersContainer
}
2024-11-11 03:57:54 -06:00
2024-11-11 00:43:03 -06:00
dodgersContainer : Element msg
2024-11-11 03:57:54 -06:00
dodgersContainer =
topLevelContainer dodgersList
2024-11-11 00:43:03 -06:00
dodgersList : Element msg
dodgersList =
column
2024-11-11 18:57:51 -06:00
pageList
2024-11-11 00:43:03 -06:00
dodgers
2024-11-11 03:57:54 -06:00
2024-11-11 18:57:51 -06:00
type alias MakeRowInput =
{ cuckImage : String
, cuckName : String
, cuckSocial : String
, cuckDodges : List DodgeEntry
}
type alias DodgeEntry =
{ dodgeLink : String
, dodgeDescription : String
, dodgeProposition : String
}
makeRow : MakeRowInput -> Element msg
makeRow makeRowInput =
let
cuckImageFormat : List (Attribute msg)
cuckImageFormat =
[ width <| px 80 ]
dodgeRows : List (Element msg)
dodgeRows =
List.indexedMap
(\index dodgeEntry ->
column paragraphAlignLeft
[ row paragraphFormat
[ text " "
, text (String.fromInt (index + 1) ++ ". ")
, paragraphLinkFormat
{ url = dodgeEntry.dodgeLink
, label =
row []
[ transitionHighlightedLinkHover <| text dodgeEntry.dodgeDescription
, text "." |> el [ F.color colourTheme.nonHighlightedText ]
]
}
]
, row paragraphBoldFormat
[ text " Proposition:"
, row [ F.regular ]
[ text dodgeEntry.dodgeProposition ]
]
]
)
makeRowInput.cuckDodges
in
row [ imageSpacer, alignLeft ]
[ image cuckImageFormat
{ src = makeRowInput.cuckImage
, description = makeRowInput.cuckName
}
, column
paragraphAlignLeft
[ row nonHighlightedTitleFormat [ text makeRowInput.cuckName ]
, row paragraphBoldFormat
[ text "Social:"
, paragraphLinkFormat
{ url = makeRowInput.cuckSocial
, label = transitionHighlightedLinkHover <| text makeRowInput.cuckName
}
]
, row paragraphBoldFormat [ text "Dodges:" ]
, column [ spacing 8 ] dodgeRows
2024-11-11 18:57:51 -06:00
]
]
type alias DodgeType =
{ noReply : String
, ranAway : String
, ghostedMe : String
, outrightNo : String
, inTooDeep : String
}
type alias PropType =
{ noClearProp : String
}
dodgers : List (Element msg)
2024-11-11 03:57:54 -06:00
dodgers =
2024-11-11 18:57:51 -06:00
let
dodgeType : DodgeType
dodgeType =
{ noReply = "Invitation extended with no response"
, ranAway = "Engaged in written debate and dodged when cornered"
, ghostedMe = "Debate invitation accepted with no follow-up"
, outrightNo = "Debate invitation declined"
, inTooDeep = "Debate invitation accepted and subsequently retracted"
}
propType : PropType
propType =
{ noClearProp = "failed to state position clearly."
}
in
List.map makeRow
[ { cuckImage = "cucks/adamsinger"
, cuckName = "Adam Singer"
, cuckSocial = "https://twitter.com/AdamSinger"
, cuckDodges =
[ { dodgeLink = "https://twitter.com/TheNutrivore/status/1566491269194719232?s=20"
, dodgeDescription = dodgeType.noReply
, dodgeProposition = propType.noClearProp
}
]
}
, { cuckImage = "cucks/"
, cuckName = ""
, cuckSocial = ""
, cuckDodges =
[ { dodgeLink = ""
, dodgeDescription = dodgeType.noReply
, dodgeProposition = propType.noClearProp
}
]
}
]