website/frontend/src/Pages/Debate.elm

326 lines
8.6 KiB
Elm
Raw Normal View History

2024-12-15 02:31:26 -06:00
module Pages.Debate exposing
( Model
, Msg
, debateArguments
, debateCuckList
, debateGibberish
, page
)
2024-12-08 02:18:36 -06:00
2024-12-15 02:31:26 -06:00
import Config.Data.Identity
exposing
( pageNames
)
import Config.Helpers.CardFormat
exposing
( cardContentSpacing
, cardFormatter
, cardMaker
, cardTitleMaker
, desktopCardMaker
, desktopImageBoxSize
, desktopImageSize
, fieldSpacer
, mobileCardMaker
, mobileImageBoxSize
, mobileImageSize
, topLevelBox
)
import Config.Helpers.Converters exposing (formatName)
import Config.Helpers.Format
exposing
( paragraphFontSize
, paragraphSpacing
)
2024-12-11 03:48:49 -06:00
import Config.Helpers.Response
2024-12-09 19:53:09 -06:00
exposing
2024-12-09 20:30:04 -06:00
( pageList
2024-12-09 19:53:09 -06:00
, topLevelContainer
)
import Config.Helpers.Viewport exposing (resetViewport)
2024-12-15 02:31:26 -06:00
import Config.Pages.Debate.Arguments.List exposing (argumentListNumber)
import Config.Pages.Debate.Cuckery.List exposing (cuckListNumber)
import Config.Pages.Debate.Gibberish.List exposing (gibberishListNumber)
import Config.Pages.Debate.Types exposing (..)
2024-12-09 19:53:09 -06:00
import Config.Pages.Headers.Helpers exposing (headerMaker)
2024-12-15 02:31:26 -06:00
import Config.Pages.Headers.Records.Arguments exposing (argumentHeader)
import Config.Pages.Headers.Records.CuckList exposing (cuckListHeader)
import Config.Pages.Headers.Records.Debate exposing (debateHeader)
import Config.Pages.Headers.Records.Gibberish exposing (gibberishHeader)
2024-12-09 19:53:09 -06:00
import Config.Style.Colour as T exposing (colourTheme)
2024-12-15 02:31:26 -06:00
import Config.Style.Glow
exposing
( glowDeepDarkGrey
, glowDeepDarkOrange
)
import Config.Style.Transitions
exposing
( transitionStyleSlow
)
2024-12-08 02:18:36 -06:00
import Effect exposing (Effect)
import Element as E exposing (..)
2024-12-15 02:31:26 -06:00
import Element.Background as B
import Element.Border as D
import Element.Font as F
import Html exposing (label)
import Html.Attributes as H
2024-12-08 02:18:36 -06:00
import Layouts
import Page exposing (Page)
import Route exposing (Route)
2024-12-15 02:31:26 -06:00
import Route.Path as Path
2024-12-08 02:18:36 -06:00
import Shared exposing (..)
import Task
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.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 : Shared.Model -> Model -> View Msg
view shared model =
2024-12-14 23:59:50 -06:00
{ title = pageNames.pageDebate
2024-12-08 02:18:36 -06:00
, attributes = []
, element = debateContainer shared.device
}
debateContainer : Device -> Element msg
debateContainer device =
topLevelContainer (debateList device)
debateList : Device -> Element msg
debateList device =
2024-12-09 19:53:09 -06:00
column
2024-12-08 02:18:36 -06:00
(case ( device.class, device.orientation ) of
_ ->
2024-12-09 20:30:04 -06:00
pageList
2024-12-08 02:18:36 -06:00
)
2024-12-09 19:53:09 -06:00
<|
List.concat
[ List.map headerMaker
[ debateHeader ]
, (case ( device.class, device.orientation ) of
( Phone, Portrait ) ->
List.map mobileDebateMaker
( Tablet, Portrait ) ->
List.map mobileDebateMaker
_ ->
List.map desktopDebateMaker
)
[ debateArguments
, debateCuckList
, debateGibberish
]
]
2024-12-15 02:31:26 -06:00
desktopDebateMaker : Debate -> Element msg
desktopDebateMaker debate =
row
topLevelBox
[ desktopCardMaker desktopImageBoxSize desktopImageSize (debateImage debate) debate.debateLink
, cardMaker
[ cardTitleMaker debate.debateTitle
, cardFormatter
[ cardContentSpacing
[ column
fieldSpacer
[ descriptionMaker debate ]
]
]
]
]
mobileDebateMaker : Debate -> Element msg
mobileDebateMaker debate =
row
topLevelBox
[ column [] []
, cardMaker
[ cardTitleMaker debate.debateTitle
, cardFormatter
[ cardContentSpacing
[ column
fieldSpacer
[ row [ width fill, spacing 10 ]
[ mobileCardMaker mobileImageBoxSize mobileImageSize (debateImage debate) debate.debateLink
, column
[ width fill ]
[]
]
]
]
]
]
]
debateImage :
Debate
->
{ src : String
, description : String
}
debateImage debate =
{ src = "debate/" ++ debate.debateImage ++ ".png"
, description = debate.debateTitle
}
descriptionMaker : Debate -> Element msg
descriptionMaker debate =
column
[ E.width fill
, centerX
, spacing 3
]
[ row []
[ paragraph
[ F.color colourTheme.textLightOrange
, paragraphSpacing
, paragraphFontSize
, F.bold
, F.size 18
, E.width fill
]
[ if debate.debateTitle == "Arguments" then
text "Inferences: "
else if debate.debateTitle == "Cucklist" then
text "Cucks: "
else if debate.debateTitle == "Gibberish" then
text "Gibberations: "
else
text ""
, text (String.fromInt debate.debateCount)
|> el
[ F.color colourTheme.textLightGrey
, F.regular
, F.size 16
]
]
]
, row [ width fill ]
[ paragraph
[ F.color colourTheme.textLightGrey
, paragraphSpacing
, paragraphFontSize
, spacing 3
, F.regular
, F.alignLeft
, F.size 16
]
[ text debate.debateDescription
]
]
]
debateArguments : Debate
debateArguments =
let
name =
"Arguments"
in
{ debateTitle = name
, debateLink = Path.toString Path.Debate_Arguments
, debateCount = argumentListNumber
, debateImage = formatName name
, isNewTabLink = False
, debateDescription = "This page features arguments that I hold to be sound, though with varying degrees of confidence. I'm open to hearing all challenges, as I am ready to engage with any substantive critiques and defend any argument listed. I have additionally included a confidence meter with each argument to give readers a clearer understanding of how strongly I hold to the argument."
}
debateCuckList : Debate
debateCuckList =
let
name =
"Cucklist"
in
{ debateTitle = name
, debateLink = Path.toString Path.Debate_Cucklist
, debateCount = cuckListNumber
, debateImage = formatName name
, isNewTabLink = False
, debateDescription = "This page features a list of complete fucking morons who wrote cheques with their mouths that their asses ultimately couldn't cash. Each person included in this list has dodged debating me in some way, shape, or form. Whether it's simply ignoring invitations, or outright refusing to engage, or agreeing to debate and then subsequently withdrawing. All such instances are catalogued here."
}
debateGibberish : Debate
debateGibberish =
let
name =
"Gibberish"
in
{ debateTitle = name
, debateLink = Path.toString Path.Debate_Gibberish
, debateCount = gibberishListNumber
, debateImage = formatName name
, isNewTabLink = False
, debateDescription = "This page is specifically for terms and ostensible concepts that I don't have a good reason to believe are understandable from at least one viewpoint. If the clarification of a philosophical term is unsatisfying or unsuccessful, and my interlocutor has exhausted all means of rendering the concept to me, the term ends up here until someone explains to me what the fuck it even means."
}