website/frontend/src/Pages/Debate/Cucklist.elm

528 lines
12 KiB
Elm
Raw Normal View History

2024-12-11 02:38:42 -06:00
module Pages.Debate.Cucklist exposing (Model, Msg, page)
2024-11-11 00:43:03 -06:00
2024-12-09 19:53:09 -06:00
import Config.Data.Identity exposing (pageNames)
2024-12-22 04:36:03 -06:00
import Config.Helpers.Cards.Helpers exposing (cardMaker)
import Config.Helpers.Cards.Types as C
2024-12-15 02:31:26 -06:00
import Config.Helpers.Converters exposing (formatSocial)
import Config.Helpers.Format
exposing
2024-12-19 01:43:02 -06:00
( headerFontSizeSmall
, paragraphFontSize
2024-12-15 02:31:26 -06:00
, paragraphSpacing
)
2024-12-22 04:36:03 -06:00
import Config.Helpers.Headers.Helpers exposing (..)
import Config.Helpers.Headers.Records exposing (cuckListHeader)
import Config.Helpers.Headers.Types as R exposing (..)
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
)
2024-12-19 01:43:02 -06:00
import Config.Helpers.ToolTip exposing (tooltipImage)
2024-12-09 19:53:09 -06:00
import Config.Helpers.Viewport exposing (resetViewport)
2024-12-15 02:31:26 -06:00
import Config.Pages.Debate.Cuckery.List
exposing
( cuckList
, cuckListNumber
)
import Config.Pages.Debate.Cuckery.Types exposing (..)
import Config.Style.Colour exposing (colourTheme)
import Config.Style.Transitions
exposing
( hoverFontDarkOrange
, transitionStyleFast
, transitionStyleSlow
)
2024-11-11 03:57:54 -06:00
import Effect exposing (Effect)
2024-12-09 19:53:09 -06:00
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.Attributes as H
2024-11-11 03:57:54 -06:00
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 shared
2024-11-11 03:57:54 -06:00
}
|> Page.withLayout toLayout
toLayout : Model -> Layouts.Layout Msg
toLayout model =
2024-12-07 15:43:26 -06:00
Layouts.Navbar {}
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-12-08 02:18:36 -06:00
{ title = "debate (" ++ pageNames.pageCucks ++ ")"
2024-11-11 03:57:54 -06:00
, attributes = []
2024-12-11 02:38:42 -06:00
, element = cucksContainer shared.device
2024-11-11 00:43:03 -06:00
}
2024-11-11 03:57:54 -06:00
2024-12-11 02:38:42 -06:00
cucksContainer : Device -> Element msg
cucksContainer device =
topLevelContainer (cucksList device)
2024-11-11 03:57:54 -06:00
2024-11-11 00:43:03 -06:00
2024-12-11 02:38:42 -06:00
cucksList : Device -> Element msg
cucksList device =
2024-11-11 00:43:03 -06:00
column
(case ( device.class, device.orientation ) of
2024-12-07 15:43:26 -06:00
_ ->
2024-12-09 20:30:04 -06:00
pageList
)
2024-11-13 23:29:50 -06:00
<|
2024-12-01 02:56:13 -06:00
List.concat
2024-12-22 04:36:03 -06:00
[ [ headerMaker (R.CuckList cuckListHeader) ]
, List.map
2024-12-21 23:23:59 -06:00
(\cuck ->
cardMaker device (C.Cuck cuck) (contentList cuck)
)
2024-12-08 02:18:36 -06:00
cuckList
2024-11-13 23:29:50 -06:00
]
2024-12-15 02:31:26 -06:00
contentList : Cuck -> List (Element msg)
contentList cuck =
[ socialMaker cuck
, dodgeTitle cuck
, dodgeMaker cuck
]
2024-12-15 02:31:26 -06:00
dodgeMaker : Cuck -> Element msg
dodgeMaker cuck =
column
[ spacing 10
, width fill
]
<|
2024-12-19 01:43:02 -06:00
List.map2 (\x y -> makeDodge cuck x y)
2024-12-15 02:31:26 -06:00
cuck.cuckDodges
(List.range 1 (List.length cuck.cuckDodges))
socialMaker : Cuck -> Element msg
socialMaker cuck =
paragraph
[ F.color colourTheme.textLightGrey
, paragraphSpacing
, paragraphFontSize
, F.bold
, F.size 18
, spacing 8
]
[ text "Social: "
, newTabLink
[ paragraphFontSize
, F.color colourTheme.textLightOrange
]
{ url = cuck.cuckSocial
, label =
el
[ transitionStyleSlow
, hoverFontDarkOrange
]
<|
text (formatSocial cuck.cuckSocial)
}
]
dodgeTitle : Cuck -> Element msg
dodgeTitle cuck =
paragraph
[ F.color colourTheme.textLightGrey
, paragraphSpacing
, paragraphFontSize
, F.bold
, F.size 18
]
[ text "Dodges: " ]
2024-12-19 01:43:02 -06:00
makeDodge : Cuck -> Dodge -> Int -> Element msg
makeDodge cuck dodge index =
2024-12-15 02:31:26 -06:00
column
[ F.color colourTheme.textLightGrey
, paragraphSpacing
, paragraphFontSize
, alignLeft
, spacing 8
, width fill
]
[ row
[ width fill
, paddingEach
{ top = 0
, right = 0
, bottom = 0
, left = 35
}
]
[ column
[ F.color colourTheme.textLightGrey
, paragraphSpacing
, paragraphFontSize
, F.size 18
, alignTop
, alignRight
, F.alignRight
]
[ text (String.fromInt index ++ ". ") ]
, column
[ spacing 3
, width fill
]
2024-12-19 01:43:02 -06:00
[ circumstanceMaker cuck dodge
2024-12-15 02:31:26 -06:00
, column
[ spacing 3
, width fill
]
2024-12-19 01:43:02 -06:00
[ propositionMaker dodge
, reductioMaker dodge
, attitudeMaker dodge
, reasonMaker dodge
2024-12-15 02:31:26 -06:00
]
]
]
]
dodgeWidth =
width <| px 93
formatProposition : String -> String
formatProposition proposition =
if proposition == "N/A" then
proposition
else
"\"" ++ proposition ++ "\""
dodgeCounter : Int -> Element msg
dodgeCounter index =
column
2024-12-19 01:43:02 -06:00
[ F.color colourTheme.textLightGrey
, paragraphSpacing
, headerFontSizeSmall
]
2024-12-15 02:31:26 -06:00
[ text (String.fromInt index ++ ". ") ]
2024-12-19 01:43:02 -06:00
circumstanceMaker : Cuck -> Dodge -> Element msg
circumstanceMaker cuck dodge =
el
[ spacing 5
2024-12-15 02:31:26 -06:00
]
2024-12-19 01:43:02 -06:00
<|
newTabLink
2024-12-15 02:31:26 -06:00
[ paragraphFontSize
, F.color colourTheme.textLightOrange
]
2024-12-19 01:43:02 -06:00
{ url = dodge.dodgeLink
2024-12-15 02:31:26 -06:00
, label =
2024-12-19 01:43:02 -06:00
el
[ headerFontSizeSmall
2024-12-15 02:31:26 -06:00
]
2024-12-19 01:43:02 -06:00
<|
circumstance cuck dodge
2024-12-15 02:31:26 -06:00
}
2024-12-19 01:43:02 -06:00
circumstance : Cuck -> Dodge -> Element msg
circumstance cuck dodge =
paragraph
[]
[ el
[ transitionStyleSlow
, hoverFontDarkOrange
]
<|
case dodge.dodgeDescription of
NoReply ->
text "Debate invitation extended with no response"
RanAway ->
text "Engaged in written debate and ran away when cornered"
GhostedMe ->
text "Debate invitation accepted with no follow-up"
OutrightNo ->
text "Debate invitation declined"
InTooDeep ->
text "Debate invitation accepted and subsequently retracted"
KillScreen ->
text "All further debate invitations preemptively declined"
VagueGesture ->
text "Chose to gesture vaguely instead of engaging"
, el [ F.color colourTheme.textLightGrey ] <|
text "."
2024-12-19 04:32:43 -06:00
-- , receipts cuck dodge
2024-12-19 01:43:02 -06:00
]
receipts : Cuck -> Dodge -> Element msg
receipts cuck dodge =
row
[ spacing 3
, F.size 12
, paddingEach
{ top = 0
, right = 0
, bottom = 0
, left = 3
}
, htmlAttribute (H.style "position" "relative")
, htmlAttribute (H.style "top" "-5px")
2024-12-15 02:31:26 -06:00
]
2024-12-19 01:43:02 -06:00
<|
List.indexedMap
(\index2 link ->
paragraph
[ alignTop
, F.color colourTheme.textLightOrange
]
[ el
2024-12-19 02:59:18 -06:00
[ transitionStyleSlow
2024-12-19 01:43:02 -06:00
, hoverFontDarkOrange
]
(text (String.fromInt (index2 + 1)))
, text ", " |> el [ F.color colourTheme.textLightGrey ]
]
)
dodge.dodgeReceipts
2024-12-15 02:31:26 -06:00
propositionMaker : Dodge -> Element msg
2024-12-19 01:43:02 -06:00
propositionMaker dodge =
2024-12-15 02:31:26 -06:00
row
[ F.color colourTheme.textLightGrey
, paragraphSpacing
, paragraphFontSize
, F.bold
]
[ paragraph
[ alignTop
, dodgeWidth
]
[ text "Proposition:"
]
, paragraph
[ E.width fill
, alignLeft
]
2024-12-19 01:43:02 -06:00
[ paragraph [ F.regular ] [ text (formatProposition dodge.dodgeProposition) ]
2024-12-15 02:31:26 -06:00
]
]
attitudeMaker : Dodge -> Element msg
2024-12-19 01:43:02 -06:00
attitudeMaker dodge =
2024-12-15 02:31:26 -06:00
row
([ F.color colourTheme.textLightGrey
, paragraphSpacing
, paragraphFontSize
, F.bold
]
++ [ width fill ]
)
[ paragraph
[ alignTop
, dodgeWidth
]
[ text "Attitude:"
]
, paragraph
[ E.width fill
, alignLeft
]
2024-12-19 01:43:02 -06:00
[ case dodge.dodgeNicksDoxasticState of
2024-12-15 02:31:26 -06:00
Nothing ->
paragraph [ F.regular ] [ text "I don't form a doxastic state." ]
Just Belief ->
paragraph [ F.regular ]
[ text "I lean more toward "
, el [ F.bold ] (text "TRUE")
, text " than false."
]
Just Disbelief ->
paragraph [ F.regular ]
[ text "I lean more toward "
, text "FALSE" |> el [ F.bold ]
, text " than true."
]
Just Agnostic ->
el [ F.regular ] (text "I don't form beliefs about this proposition.")
]
]
reductioMaker : Dodge -> Element msg
2024-12-19 01:43:02 -06:00
reductioMaker dodge =
case dodge.dodgeFallacy of
2024-12-15 02:31:26 -06:00
Nothing ->
none
Just fallacy ->
case fallacy of
SpecificFallacy str ->
if String.isEmpty str then
none
else
displayFallacy str
AppealToNature ->
displayFallacy "Appeal to Nature"
AppealToTradition ->
displayFallacy "Appeal to Tradition"
AppealToIgnorance ->
displayFallacy "Appeal to Ignorance"
AppealFromIncredulity ->
displayFallacy "Appeal from Incredulity"
RedHerring ->
displayFallacy "Red Herring"
BeggingTheQuestion ->
displayFallacy "Begging the Question"
Strawman ->
displayFallacy "Strawman"
Equivocation ->
displayFallacy "Equivocation"
GeneticFallacy ->
displayFallacy "Genetic Fallacy"
MotteAndBailey ->
displayFallacy "Motte and Bailey"
reasonMaker : Dodge -> Element msg
2024-12-19 01:43:02 -06:00
reasonMaker dodge =
2024-12-15 02:31:26 -06:00
row
([ F.color colourTheme.textLightGrey
, paragraphSpacing
, paragraphFontSize
, F.bold
]
++ [ width fill ]
)
[ paragraph
[ alignTop
, dodgeWidth
]
[ text "Reason:"
]
, paragraph [ F.regular ]
[ text <|
2024-12-19 01:43:02 -06:00
case dodge.dodgeNicksDoxasticReason of
2024-12-15 02:31:26 -06:00
NoProp ->
"There is no proposition to evaluate."
VagueProp ->
"The proposition is too vague to evaluate."
SpecificPropReason str ->
str
]
]
displayFallacy : String -> Element msg
displayFallacy fallacyText =
row
[ F.color colourTheme.textLightGrey
, paragraphSpacing
, paragraphFontSize
, F.bold
]
[ paragraph
[ alignTop
, dodgeWidth
]
[ text "Fallacy:"
]
, paragraph
[ E.width fill
, alignLeft
]
[ paragraph [ F.regular ]
[ text fallacyText ]
]
]