feat: standardized formatting conventions across pages

This commit is contained in:
Nick 2024-11-27 18:53:53 -06:00
parent f2c6f1ce26
commit d5e7cfe814
12 changed files with 831 additions and 536 deletions

View file

@ -16,207 +16,6 @@ import Shared
import View exposing (View)
makeDodge : Dodge -> Int -> Element msg
makeDodge dodgeEntry index =
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
[ column [ alignTop, width (px 165) ]
[ text "Fallacy:"
|> el
[ paddingEach
{ top = 0
, right = 0
, bottom = 0
, left = 70
}
]
]
, column [ E.width fill, alignLeft ]
[ paragraph [ F.regular ]
[ text fallacyText ]
]
]
in
column
(paragraphAlignLeft
++ [ spacing 3
, width fill
]
)
[ row
(paragraphFormat
++ [ F.size 18
, paddingEach
{ top = 0
, bottom = 0
, left = 15
, right = 15
}
, E.width fill
]
)
[ 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 ]
, row [ alignTop, alignLeft ]
(List.indexedMap
(\index2 link ->
newTabLink
[ paddingEach { top = 0, right = 15, bottom = 0, left = 5 }, F.size 13 ]
{ url = link
, label =
row []
[ transitionHighlightedLinkHover <| (text (String.fromInt (index2 + 1)) |> el [ F.size 13 ])
, text ", " |> el [ F.color colourTheme.nonHighlightedText ]
]
}
)
dodgeEntry.dodgeReceipts
)
]
}
]
, row paragraphBoldFormat
[ column [ alignTop, width <| px 165 ]
[ text "Proposition:" |> el [ paddingEach { top = 0, right = 15, bottom = 0, left = 70 } ]
]
, column [ E.width fill, alignLeft, paddingEach { top = 0, right = 15, bottom = 0, left = 0 } ]
[ paragraph [ F.regular ] [ text (formatProposition dodgeEntry.dodgeProposition) ]
]
]
, maybeFallacyField
, row (paragraphBoldFormat ++ [ width fill ])
[ column [ alignTop, width <| px 165 ]
[ text "Attitude:" |> el [ paddingEach { top = 0, right = 15, bottom = 0, left = 70 } ]
]
, column [ E.width fill, alignLeft, paddingEach { top = 0, right = 15, bottom = 0, left = 0 } ]
[ 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 ])
[ column [ alignTop, width <| px 165 ]
[ text "Reason:" |> el [ paddingEach { top = 0, right = 0, bottom = 0, left = 70 } ]
]
, column [ E.width fill, alignLeft, paddingEach { top = 0, right = 15, bottom = 0, left = 0 } ]
[ paragraph [ F.regular ]
[ text <|
case dodgeEntry.dodgeNicksDoxasticReason of
NoProp ->
"There is no proposition to evaluate."
VagueProp ->
"The proposition is too vague to evaluate."
SpecificPropReason str ->
str
]
]
]
]
cuckMaker : Cuck -> Element msg
cuckMaker cuck =
row
@ -226,95 +25,382 @@ cuckMaker cuck =
, alignTop
, alignRight
]
[ column
[ E.width <| px 115
, E.height <| px 115
, alignTop
, alignRight
]
[ 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
}
]
]
[ imageMaker cuck
, column
[ E.width <| px 600 ]
[ row
(nonHighlightedTitleFormat
++ [ F.size 20
, B.color colourTheme.highlightTextHover
, paddingEach { top = 6, bottom = 3, left = 25, right = 15 }
, alignBottom
, width fill
, D.roundEach { topLeft = 26, topRight = 26, bottomRight = 0, bottomLeft = 0 }
-- , B.gradient
-- { angle = 1.5708
-- , steps =
-- [ colourTheme.highlightTextHover
-- , colourTheme.highlightTextHover
-- , colourTheme.transparent
-- , colourTheme.transparent
-- ]
-- }
]
)
[ text cuck.cuckName ]
[ E.width <| px 650 ]
[ cuckTitle cuck
, column
[ E.height fill
, E.width fill
, B.color colourTheme.cardBackground
, paddingEach { top = 10, bottom = 10, left = 10, right = 10 }
, D.roundEach { topLeft = 0, topRight = 0, bottomRight = 26, bottomLeft = 26 }
, spacing 3
-- , B.gradient
-- { angle = 1.5708
-- , steps =
-- [ colourTheme.cardBackground
-- , colourTheme.cardBackground
-- , colourTheme.transparent
-- , colourTheme.transparent
-- ]
-- }
, paddingEach
{ top = 10
, bottom = 10
, left = 10
, right = 10
}
, D.roundEach
{ topLeft = 0
, topRight = 0
, bottomRight = 26
, bottomLeft = 26
}
, spacing 8
]
[ 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)
[ column
[ paddingEach
{ top = 0
, bottom = 0
, left = 15
, right = 15
}
, spacing 8
]
[ socialMaker cuck
, dodgeTitle cuck
, dodgeMaker cuck
]
, 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))
]
]
]
imageMaker : Cuck -> Element msg
imageMaker cuck =
column
[ E.width <| px 115
, E.height <| px 115
, alignTop
, alignRight
]
[ column
[ D.rounded 100
, D.width 5
, D.color colourTheme.cardBackground
, B.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
}
]
]
cuckTitle : Cuck -> Element msg
cuckTitle cuck =
row
(nonHighlightedTitleFormat
++ [ F.size 20
, B.color colourTheme.highlightTextHover
, paddingEach { top = 6, bottom = 3, left = 25, right = 15 }
, alignBottom
, width fill
, D.roundEach { topLeft = 26, topRight = 26, bottomRight = 0, bottomLeft = 0 }
]
)
[ text cuck.cuckName ]
dodgeMaker : Cuck -> Element msg
dodgeMaker cuck =
column [ spacing 15, width fill ] <|
List.map2 (\x y -> makeDodge x y)
cuck.cuckDodges
(List.range 1 (List.length cuck.cuckDodges))
dodgeTitle : Cuck -> Element msg
dodgeTitle cuck =
row
(paragraphBoldFormat
++ [ F.size 18
]
)
[ text "Dodges:" ]
socialMaker : Cuck -> Element msg
socialMaker cuck =
row
(paragraphBoldFormat
++ [ F.size 18
, spacing 8
]
)
[ text "Social:"
, paragraphLinkFormat
{ url = cuck.cuckSocial
, label = transitionHighlightedLinkHover <| text (formatCuckSocial cuck.cuckSocial)
}
]
makeDodge : Dodge -> Int -> Element msg
makeDodge dodgeEntry index =
column
(paragraphAlignLeft
++ [ spacing 8
, width fill
]
)
[ row
[ width fill
, paddingEach
{ top = 0
, right = 0
, bottom = 0
, left = 35
}
]
[ column
(paragraphFormat
++ [ F.size 18
, alignTop
, alignRight
, F.alignRight
]
)
[ text (String.fromInt index ++ ". ") ]
, column
[ spacing 8
, width fill
]
[ circumstanceMaker dodgeEntry
, column
[ spacing 8
, width fill
, paddingEach
{ top = 0
, right = 0
, bottom = 0
, left = 35
}
]
[ propositionMaker dodgeEntry
, reductioMaker dodgeEntry
, attitudeMaker dodgeEntry
, reasonMaker dodgeEntry
]
]
]
]
dodgeWidth =
width <| px 93
formatProposition : String -> String
formatProposition proposition =
if proposition == "N/A" then
proposition
else
"\"" ++ proposition ++ "\""
dodgeCounter : Int -> Element msg
dodgeCounter index =
column
(paragraphFormat
++ [ F.size 18
]
)
[ text (String.fromInt index ++ ". ") ]
circumstanceMaker : Dodge -> Element msg
circumstanceMaker dodgeEntry =
column
[ width fill
]
[ 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 ]
, row [ alignTop, alignLeft ]
(List.indexedMap
(\index2 link ->
newTabLink
[ paddingEach
{ top = 0
, right = 15
, bottom = 0
, left = 5
}
, F.size 13
]
{ url = link
, label =
row []
[ transitionHighlightedLinkHover <| (text (String.fromInt (index2 + 1)) |> el [ F.size 13 ])
, text ", " |> el [ F.color colourTheme.nonHighlightedText ]
]
}
)
dodgeEntry.dodgeReceipts
)
]
}
]
propositionMaker : Dodge -> Element msg
propositionMaker dodgeEntry =
row paragraphBoldFormat
[ column [ alignTop, dodgeWidth ]
[ text "Proposition:"
]
, column
[ E.width fill
, alignLeft
]
[ paragraph [ F.regular ] [ text (formatProposition dodgeEntry.dodgeProposition) ]
]
]
attitudeMaker : Dodge -> Element msg
attitudeMaker dodgeEntry =
row (paragraphBoldFormat ++ [ width fill ])
[ column [ alignTop, dodgeWidth ]
[ text "Attitude:"
]
, column [ E.width fill, alignLeft ]
[ 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.")
]
]
reductioMaker : Dodge -> Element msg
reductioMaker dodgeEntry =
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"
reasonMaker : Dodge -> Element msg
reasonMaker dodgeEntry =
row (paragraphBoldFormat ++ [ width fill ])
[ column [ alignTop, dodgeWidth ]
[ text "Reason:"
]
, column [ E.width fill, alignLeft ]
[ paragraph [ F.regular ]
[ text <|
case dodgeEntry.dodgeNicksDoxasticReason of
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 paragraphBoldFormat
[ column [ alignTop, dodgeWidth ]
[ text "Fallacy:"
]
, column [ E.width fill, alignLeft ]
[ paragraph [ F.regular ]
[ text fallacyText ]
]
]