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

580 lines
14 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-23 03:24:08 -06:00
, smallTextFontSize
2024-12-15 02:31:26 -06:00
)
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-22 19:42:23 -06:00
pageList device
)
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 device cuck)
2024-12-21 23:23:59 -06:00
)
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 : Device -> Cuck -> List (Element msg)
contentList device cuck =
[ column
[ width fill
, spacing 3
, paddingEach
{ top =
case ( device.class, device.orientation ) of
( Phone, Portrait ) ->
3
( Tablet, Portrait ) ->
3
_ ->
0
, right = 0
, bottom = 0
, left = 0
}
]
[ socialMaker cuck
, dodgeTitle cuck
, dodgeMaker device cuck
]
]
2024-12-15 02:31:26 -06:00
dodgeMaker : Device -> Cuck -> Element msg
dodgeMaker device cuck =
2024-12-15 02:31:26 -06:00
column
[ spacing 10
, width fill
]
<|
List.map2 (\x y -> makeDodge device 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
, F.bold
2024-12-23 03:24:08 -06:00
, headerFontSizeSmall
2024-12-15 02:31:26 -06:00
, 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
, F.bold
2024-12-23 03:24:08 -06:00
, headerFontSizeSmall
2024-12-15 02:31:26 -06:00
]
[ text "Dodges: " ]
makeDodge : Device -> Cuck -> Dodge -> Int -> Element msg
makeDodge device 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 = 10
2024-12-15 02:31:26 -06:00
}
]
[ column
[ F.color colourTheme.textLightGrey
, paragraphSpacing
2024-12-23 03:24:08 -06:00
, headerFontSizeSmall
2024-12-15 02:31:26 -06:00
, 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
]
[ propositionMaker device dodge
, reductioMaker device dodge
, attitudeMaker device dodge
, reasonMaker device dodge
2024-12-15 02:31:26 -06:00
]
]
]
]
dodgeWidth =
width <| px 85
2024-12-15 02:31:26 -06:00
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
2024-12-23 03:24:08 -06:00
, smallTextFontSize
2024-12-19 01:43:02 -06:00
, 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 : Device -> Dodge -> Element msg
propositionMaker device dodge =
(case ( device.class, device.orientation ) of
( Phone, Portrait ) ->
column
( Tablet, Portrait ) ->
column
_ ->
row
)
2024-12-15 02:31:26 -06:00
[ 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 : Device -> Dodge -> Element msg
attitudeMaker device dodge =
(case ( device.class, device.orientation ) of
( Phone, Portrait ) ->
column
( Tablet, Portrait ) ->
column
_ ->
row
)
[ F.color colourTheme.textLightGrey
, paragraphSpacing
, paragraphFontSize
, F.bold
, width fill
]
2024-12-15 02:31:26 -06:00
[ 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 : Device -> Dodge -> Element msg
reductioMaker device dodge =
2024-12-19 01:43:02 -06:00
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 device str
2024-12-15 02:31:26 -06:00
AppealToNature ->
displayFallacy device "Appeal to Nature"
2024-12-15 02:31:26 -06:00
AppealToTradition ->
displayFallacy device "Appeal to Tradition"
2024-12-15 02:31:26 -06:00
AppealToIgnorance ->
displayFallacy device "Appeal to Ignorance"
2024-12-15 02:31:26 -06:00
AppealFromIncredulity ->
displayFallacy device "Appeal from Incredulity"
2024-12-15 02:31:26 -06:00
RedHerring ->
displayFallacy device "Red Herring"
2024-12-15 02:31:26 -06:00
BeggingTheQuestion ->
displayFallacy device "Begging the Question"
2024-12-15 02:31:26 -06:00
Strawman ->
displayFallacy device "Strawman"
2024-12-15 02:31:26 -06:00
Equivocation ->
displayFallacy device "Equivocation"
2024-12-15 02:31:26 -06:00
GeneticFallacy ->
displayFallacy device "Genetic Fallacy"
2024-12-15 02:31:26 -06:00
MotteAndBailey ->
displayFallacy device "Motte and Bailey"
2024-12-15 02:31:26 -06:00
reasonMaker : Device -> Dodge -> Element msg
reasonMaker device dodge =
(case ( device.class, device.orientation ) of
( Phone, Portrait ) ->
column
( Tablet, Portrait ) ->
column
_ ->
row
)
[ F.color colourTheme.textLightGrey
, paragraphSpacing
, paragraphFontSize
, F.bold
, width fill
]
2024-12-15 02:31:26 -06:00
[ 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 : Device -> String -> Element msg
displayFallacy device fallacyText =
(case ( device.class, device.orientation ) of
( Phone, Portrait ) ->
column
( Tablet, Portrait ) ->
column
_ ->
row
)
2024-12-15 02:31:26 -06:00
[ F.color colourTheme.textLightGrey
, paragraphSpacing
, paragraphFontSize
, F.bold
]
[ paragraph
[ alignTop
, dodgeWidth
]
[ text "Fallacy:"
]
, paragraph
[ E.width fill
, alignLeft
]
[ paragraph [ F.regular ]
[ text fallacyText ]
]
]