2024-11-13 23:29:50 -06:00
|
|
|
module Cuckery.Helpers exposing (..)
|
|
|
|
|
|
|
|
import Config.Colour exposing (..)
|
|
|
|
import Config.Format exposing (..)
|
|
|
|
import Cuckery.Types exposing (..)
|
|
|
|
import Effect exposing (Effect)
|
2024-11-26 04:32:11 -06:00
|
|
|
import Element as E exposing (..)
|
|
|
|
import Element.Background as B exposing (..)
|
2024-11-13 23:29:50 -06:00
|
|
|
import Element.Border as D
|
|
|
|
import Element.Font as F
|
|
|
|
import Html.Attributes as H exposing (style)
|
|
|
|
import Layouts
|
|
|
|
import Page exposing (Page)
|
|
|
|
import Route exposing (Route)
|
|
|
|
import Shared
|
|
|
|
import View exposing (View)
|
|
|
|
|
|
|
|
|
|
|
|
makeDodge : Dodge -> Int -> Element msg
|
|
|
|
makeDodge dodgeEntry index =
|
2024-11-20 15:12:38 -06:00
|
|
|
let
|
|
|
|
formatProposition : String -> String
|
|
|
|
formatProposition proposition =
|
|
|
|
if proposition == "N/A" then
|
|
|
|
proposition
|
|
|
|
|
|
|
|
else
|
|
|
|
"\"" ++ proposition ++ "\""
|
|
|
|
|
|
|
|
maybeFallacyField : Element msg
|
|
|
|
maybeFallacyField =
|
|
|
|
case dodgeEntry.dodgeFallacy of
|
|
|
|
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"
|
|
|
|
|
|
|
|
displayFallacy : String -> Element msg
|
|
|
|
displayFallacy fallacyText =
|
|
|
|
row paragraphBoldFormat
|
2024-11-26 04:32:11 -06:00
|
|
|
[ column [ alignTop, width (px 165) ]
|
2024-11-27 01:42:58 -06:00
|
|
|
[ text "Fallacy:"
|
|
|
|
|> el
|
|
|
|
[ paddingEach
|
|
|
|
{ top = 0
|
|
|
|
, right = 0
|
|
|
|
, bottom = 0
|
|
|
|
, left = 70
|
|
|
|
}
|
|
|
|
]
|
2024-11-20 15:12:38 -06:00
|
|
|
]
|
2024-11-26 04:32:11 -06:00
|
|
|
, column [ E.width fill, alignLeft ]
|
2024-11-20 15:12:38 -06:00
|
|
|
[ paragraph [ F.regular ]
|
|
|
|
[ text fallacyText ]
|
|
|
|
]
|
|
|
|
]
|
|
|
|
in
|
2024-11-27 01:42:58 -06:00
|
|
|
column
|
|
|
|
(paragraphAlignLeft
|
|
|
|
++ [ spacing 3
|
|
|
|
, width fill
|
|
|
|
]
|
|
|
|
)
|
2024-11-26 04:32:11 -06:00
|
|
|
[ row
|
|
|
|
(paragraphFormat
|
|
|
|
++ [ F.size 18
|
2024-11-27 01:42:58 -06:00
|
|
|
, paddingEach
|
|
|
|
{ top = 0
|
|
|
|
, bottom = 0
|
|
|
|
, left = 15
|
|
|
|
, right = 15
|
|
|
|
}
|
2024-11-26 04:32:11 -06:00
|
|
|
, E.width fill
|
|
|
|
]
|
|
|
|
)
|
2024-11-20 15:12:38 -06:00
|
|
|
[ text " "
|
|
|
|
, text (String.fromInt index ++ ". ")
|
|
|
|
, paragraphLinkFormat
|
|
|
|
{ url = dodgeEntry.dodgeLink
|
|
|
|
, label =
|
|
|
|
row [ F.size 18 ]
|
|
|
|
[ transitionHighlightedLinkHover <|
|
|
|
|
text
|
|
|
|
(case dodgeEntry.dodgeDescription of
|
|
|
|
NoReply ->
|
|
|
|
"Debate invitation extended with no response"
|
|
|
|
|
|
|
|
RanAway ->
|
|
|
|
"Engaged in written debate and ran away when cornered"
|
|
|
|
|
|
|
|
GhostedMe ->
|
|
|
|
"Debate invitation accepted with no follow-up"
|
|
|
|
|
|
|
|
OutrightNo ->
|
|
|
|
"Debate invitation declined"
|
|
|
|
|
|
|
|
InTooDeep ->
|
|
|
|
"Debate invitation accepted and subsequently retracted"
|
|
|
|
|
|
|
|
KillScreen ->
|
|
|
|
"All further debate invitations preemptively declined"
|
|
|
|
|
|
|
|
VagueGesture ->
|
|
|
|
"Chose to gesture vaguely instead of engaging"
|
|
|
|
)
|
|
|
|
, text "." |> el [ F.color colourTheme.nonHighlightedText ]
|
2024-11-23 18:01:27 -06:00
|
|
|
, row [ alignTop, alignLeft ]
|
|
|
|
(List.indexedMap
|
|
|
|
(\index2 link ->
|
|
|
|
newTabLink
|
2024-11-27 15:11:21 -06:00
|
|
|
[ paddingEach { top = 0, right = 15, bottom = 0, left = 5 }, F.size 13 ]
|
2024-11-23 18:01:27 -06:00
|
|
|
{ url = link
|
|
|
|
, label =
|
|
|
|
row []
|
|
|
|
[ transitionHighlightedLinkHover <| (text (String.fromInt (index2 + 1)) |> el [ F.size 13 ])
|
|
|
|
, text ", " |> el [ F.color colourTheme.nonHighlightedText ]
|
|
|
|
]
|
|
|
|
}
|
|
|
|
)
|
|
|
|
dodgeEntry.dodgeReceipts
|
|
|
|
)
|
2024-11-20 15:12:38 -06:00
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
, row paragraphBoldFormat
|
2024-11-26 04:32:11 -06:00
|
|
|
[ column [ alignTop, width <| px 165 ]
|
2024-11-27 15:11:21 -06:00
|
|
|
[ text "Proposition:" |> el [ paddingEach { top = 0, right = 15, bottom = 0, left = 70 } ]
|
2024-11-20 15:12:38 -06:00
|
|
|
]
|
2024-11-27 15:11:21 -06:00
|
|
|
, column [ E.width fill, alignLeft, paddingEach { top = 0, right = 15, bottom = 0, left = 0 } ]
|
2024-11-23 18:01:27 -06:00
|
|
|
[ paragraph [ F.regular ] [ text (formatProposition dodgeEntry.dodgeProposition) ]
|
|
|
|
]
|
2024-11-20 15:12:38 -06:00
|
|
|
]
|
|
|
|
, maybeFallacyField
|
|
|
|
, row (paragraphBoldFormat ++ [ width fill ])
|
2024-11-26 04:32:11 -06:00
|
|
|
[ column [ alignTop, width <| px 165 ]
|
2024-11-27 15:11:21 -06:00
|
|
|
[ text "Attitude:" |> el [ paddingEach { top = 0, right = 15, bottom = 0, left = 70 } ]
|
2024-11-20 15:12:38 -06:00
|
|
|
]
|
2024-11-27 15:11:21 -06:00
|
|
|
, column [ E.width fill, alignLeft, paddingEach { top = 0, right = 15, bottom = 0, left = 0 } ]
|
2024-11-20 15:12:38 -06:00
|
|
|
[ case dodgeEntry.dodgeNicksDoxasticState of
|
|
|
|
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.")
|
|
|
|
]
|
|
|
|
]
|
|
|
|
, row (paragraphBoldFormat ++ [ width fill ])
|
2024-11-26 04:32:11 -06:00
|
|
|
[ column [ alignTop, width <| px 165 ]
|
2024-11-20 15:12:38 -06:00
|
|
|
[ text "Reason:" |> el [ paddingEach { top = 0, right = 0, bottom = 0, left = 70 } ]
|
|
|
|
]
|
2024-11-27 15:11:21 -06:00
|
|
|
, column [ E.width fill, alignLeft, paddingEach { top = 0, right = 15, bottom = 0, left = 0 } ]
|
2024-11-20 15:12:38 -06:00
|
|
|
[ paragraph [ F.regular ]
|
|
|
|
[ text <|
|
|
|
|
case dodgeEntry.dodgeNicksDoxasticReason of
|
|
|
|
NoProp ->
|
|
|
|
"There is no proposition to evaluate."
|
|
|
|
|
|
|
|
VagueProp ->
|
|
|
|
"The proposition is too vague to evaluate."
|
|
|
|
|
2024-11-20 18:35:40 -06:00
|
|
|
SpecificPropReason str ->
|
2024-11-20 15:12:38 -06:00
|
|
|
str
|
|
|
|
]
|
|
|
|
]
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
2024-11-13 23:29:50 -06:00
|
|
|
|
|
|
|
cuckMaker : Cuck -> Element msg
|
|
|
|
cuckMaker cuck =
|
2024-11-26 04:32:11 -06:00
|
|
|
row
|
|
|
|
[ spacing 20
|
|
|
|
, width fill
|
|
|
|
, E.height fill
|
|
|
|
, alignTop
|
|
|
|
, alignRight
|
|
|
|
]
|
|
|
|
[ column
|
|
|
|
[ E.width <| px 115
|
|
|
|
, E.height <| px 115
|
2024-11-20 15:12:38 -06:00
|
|
|
, alignTop
|
2024-11-26 04:32:11 -06:00
|
|
|
, alignRight
|
|
|
|
]
|
2024-11-27 01:42:58 -06:00
|
|
|
[ column
|
|
|
|
[ D.rounded 100
|
|
|
|
, D.width 5
|
|
|
|
, D.color colourTheme.cardBackground
|
|
|
|
]
|
|
|
|
[ E.image
|
|
|
|
[ alignRight
|
|
|
|
, alignTop
|
|
|
|
, D.rounded 100
|
|
|
|
, clip
|
|
|
|
, E.width <| px 90
|
|
|
|
, E.height <| px 90
|
|
|
|
]
|
|
|
|
{ src = "cucks/" ++ cuck.cuckImage ++ "/" ++ cuck.cuckImage ++ ".png"
|
|
|
|
, description = cuck.cuckName
|
|
|
|
}
|
2024-11-26 04:32:11 -06:00
|
|
|
]
|
2024-11-20 15:12:38 -06:00
|
|
|
]
|
|
|
|
, column
|
2024-11-26 04:32:11 -06:00
|
|
|
[ E.width <| px 600 ]
|
|
|
|
[ row
|
|
|
|
(nonHighlightedTitleFormat
|
|
|
|
++ [ F.size 20
|
2024-11-27 15:11:21 -06:00
|
|
|
, B.color colourTheme.highlightTextHover
|
2024-11-26 04:32:11 -06:00
|
|
|
, paddingEach { top = 6, bottom = 3, left = 25, right = 15 }
|
|
|
|
, alignBottom
|
|
|
|
, width fill
|
2024-11-27 15:11:21 -06:00
|
|
|
, D.roundEach { topLeft = 26, topRight = 26, bottomRight = 0, bottomLeft = 0 }
|
|
|
|
|
|
|
|
-- , B.gradient
|
|
|
|
-- { angle = 1.5708
|
|
|
|
-- , steps =
|
|
|
|
-- [ colourTheme.highlightTextHover
|
|
|
|
-- , colourTheme.highlightTextHover
|
|
|
|
-- , colourTheme.transparent
|
|
|
|
-- , colourTheme.transparent
|
|
|
|
-- ]
|
|
|
|
-- }
|
2024-11-26 04:32:11 -06:00
|
|
|
]
|
|
|
|
)
|
|
|
|
[ text cuck.cuckName ]
|
|
|
|
, column
|
|
|
|
[ E.height fill
|
|
|
|
, E.width fill
|
2024-11-27 15:11:21 -06:00
|
|
|
, B.color colourTheme.cardBackground
|
2024-11-26 04:32:11 -06:00
|
|
|
, paddingEach { top = 10, bottom = 10, left = 10, right = 10 }
|
2024-11-27 15:11:21 -06:00
|
|
|
, D.roundEach { topLeft = 0, topRight = 0, bottomRight = 26, bottomLeft = 26 }
|
2024-11-26 04:32:11 -06:00
|
|
|
, spacing 3
|
2024-11-27 15:11:21 -06:00
|
|
|
|
|
|
|
-- , B.gradient
|
|
|
|
-- { angle = 1.5708
|
|
|
|
-- , steps =
|
|
|
|
-- [ colourTheme.cardBackground
|
|
|
|
-- , colourTheme.cardBackground
|
|
|
|
-- , colourTheme.transparent
|
|
|
|
-- , colourTheme.transparent
|
|
|
|
-- ]
|
|
|
|
-- }
|
2024-11-20 15:12:38 -06:00
|
|
|
]
|
2024-11-26 04:32:11 -06:00
|
|
|
[ row
|
|
|
|
(paragraphBoldFormat
|
|
|
|
++ [ F.size 18
|
|
|
|
, paddingEach { top = 0, bottom = 0, left = 15, right = 15 }
|
|
|
|
, spacing 5
|
|
|
|
]
|
|
|
|
)
|
|
|
|
[ text "Social:"
|
|
|
|
, paragraphLinkFormat
|
|
|
|
{ url = cuck.cuckSocial
|
|
|
|
, label = transitionHighlightedLinkHover <| text (formatCuckSocial cuck.cuckSocial)
|
|
|
|
}
|
|
|
|
]
|
|
|
|
, row
|
|
|
|
(paragraphBoldFormat
|
|
|
|
++ [ F.size 18
|
|
|
|
, paddingEach { top = 0, bottom = 0, left = 15, right = 15 }
|
|
|
|
]
|
|
|
|
)
|
|
|
|
[ text "Dodges:" ]
|
|
|
|
, column [ spacing 8, width fill ] <|
|
|
|
|
List.map2 (\x y -> makeDodge x y)
|
|
|
|
cuck.cuckDodges
|
|
|
|
(List.range 1 (List.length cuck.cuckDodges))
|
|
|
|
]
|
2024-11-20 15:12:38 -06:00
|
|
|
]
|
|
|
|
]
|