2024-11-27 01:42:58 -06:00
|
|
|
module Interviews.Helpers exposing (..)
|
|
|
|
|
2024-11-27 22:36:35 -06:00
|
|
|
import Config.CardFormat exposing (..)
|
2024-11-27 01:42:58 -06:00
|
|
|
import Config.Colour exposing (..)
|
|
|
|
import Config.Format exposing (..)
|
2024-11-27 22:36:35 -06:00
|
|
|
import Config.StrengthBar exposing (..)
|
2024-11-28 00:33:22 -06:00
|
|
|
import Config.ToolTip exposing (..)
|
2024-11-27 01:42:58 -06:00
|
|
|
import Effect exposing (Effect)
|
|
|
|
import Element as E exposing (..)
|
|
|
|
import Element.Background as B exposing (..)
|
|
|
|
import Element.Border as D
|
|
|
|
import Element.Font as F
|
|
|
|
import Html.Attributes as H exposing (style)
|
|
|
|
import Interviews.Types exposing (..)
|
|
|
|
import Layouts
|
|
|
|
import Page exposing (Page)
|
|
|
|
import Route exposing (Route)
|
|
|
|
import Shared
|
|
|
|
import View exposing (View)
|
|
|
|
|
|
|
|
|
|
|
|
interviewMaker : Interview -> Element msg
|
|
|
|
interviewMaker interview =
|
|
|
|
row
|
2024-11-27 22:36:35 -06:00
|
|
|
topLevelBox
|
|
|
|
[ cardImageMaker (interviewImage interview)
|
|
|
|
, cardMaker
|
|
|
|
[ cardTitleMaker (interviewTitle interview)
|
|
|
|
, cardFormatter
|
|
|
|
[ cardContentSpacing
|
2024-11-27 18:53:53 -06:00
|
|
|
[ column
|
2024-11-28 19:28:24 -06:00
|
|
|
fieldSpacer
|
2024-11-27 18:53:53 -06:00
|
|
|
[ socialMaker interview
|
|
|
|
, appearanceTitle interview
|
|
|
|
, appearanceMaker interview
|
|
|
|
]
|
|
|
|
]
|
2024-11-27 01:42:58 -06:00
|
|
|
]
|
|
|
|
]
|
|
|
|
]
|
2024-11-27 18:53:53 -06:00
|
|
|
|
|
|
|
|
2024-12-06 00:43:00 -06:00
|
|
|
interviewMakerMobile : Interview -> Element msg
|
|
|
|
interviewMakerMobile interview =
|
|
|
|
row
|
|
|
|
topLevelBox
|
|
|
|
[ column [] []
|
|
|
|
, cardMaker
|
|
|
|
[ cardTitleMaker (interviewTitle interview)
|
|
|
|
, cardFormatter
|
|
|
|
[ cardContentSpacing
|
|
|
|
[ column
|
|
|
|
fieldSpacer
|
|
|
|
[ cardImageMakerMobile (interviewImage interview)
|
|
|
|
, socialMaker interview
|
|
|
|
, appearanceTitle interview
|
|
|
|
, appearanceMaker interview
|
|
|
|
]
|
|
|
|
]
|
|
|
|
]
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2024-11-27 22:36:35 -06:00
|
|
|
interviewImage : Interview -> { src : String, description : String }
|
|
|
|
interviewImage interview =
|
|
|
|
{ src = "interviews/" ++ interview.interviewImage ++ ".png"
|
|
|
|
, description = interview.interviewImage
|
|
|
|
}
|
2024-11-27 18:53:53 -06:00
|
|
|
|
|
|
|
|
2024-11-27 22:36:35 -06:00
|
|
|
interviewTitle : Interview -> String
|
|
|
|
interviewTitle interview =
|
|
|
|
interview.interviewName
|
2024-11-27 18:53:53 -06:00
|
|
|
|
|
|
|
|
|
|
|
socialMaker : Interview -> Element msg
|
|
|
|
socialMaker interview =
|
2024-12-06 03:02:37 -06:00
|
|
|
paragraph
|
2024-11-27 18:53:53 -06:00
|
|
|
(paragraphBoldFormat
|
|
|
|
++ [ F.size 18
|
|
|
|
, spacing 5
|
|
|
|
]
|
|
|
|
)
|
2024-12-06 03:02:37 -06:00
|
|
|
[ text "Social: "
|
2024-11-27 18:53:53 -06:00
|
|
|
, paragraphLinkFormat
|
|
|
|
{ url = interview.interviewSocial
|
|
|
|
, label = transitionHighlightedLinkHover <| text (formatInterviewSocial interview.interviewSocial)
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
appearanceTitle : Interview -> Element msg
|
|
|
|
appearanceTitle interview =
|
2024-12-06 03:02:37 -06:00
|
|
|
paragraph
|
2024-11-27 18:53:53 -06:00
|
|
|
(paragraphBoldFormat
|
|
|
|
++ [ F.size 18
|
|
|
|
]
|
|
|
|
)
|
2024-12-06 03:02:37 -06:00
|
|
|
[ text "Appearances: " ]
|
2024-11-27 18:53:53 -06:00
|
|
|
|
|
|
|
|
|
|
|
appearanceMaker : Interview -> Element msg
|
|
|
|
appearanceMaker interview =
|
|
|
|
column [ spacing 15, width fill ] <|
|
|
|
|
List.map2 (\x y -> makeAppearance x y)
|
|
|
|
interview.interviewAppearances
|
|
|
|
(List.range 1 (List.length interview.interviewAppearances))
|
|
|
|
|
|
|
|
|
|
|
|
makeAppearance : Appearance -> Int -> Element msg
|
|
|
|
makeAppearance appearanceEntry index =
|
|
|
|
column
|
|
|
|
(paragraphAlignLeft
|
|
|
|
++ [ spacing 8
|
|
|
|
, width fill
|
|
|
|
]
|
|
|
|
)
|
2024-11-27 23:06:00 -06:00
|
|
|
[ row
|
2024-11-28 00:33:22 -06:00
|
|
|
(paragraphFormat
|
|
|
|
++ [ F.size 18
|
|
|
|
, E.width fill
|
|
|
|
, paddingEach
|
|
|
|
{ top = 0
|
|
|
|
, bottom = 0
|
|
|
|
, left = 35
|
|
|
|
, right = 0
|
|
|
|
}
|
|
|
|
]
|
|
|
|
)
|
2024-11-27 23:06:00 -06:00
|
|
|
[ column
|
|
|
|
(paragraphFormat
|
|
|
|
++ [ F.size 18
|
|
|
|
, alignTop
|
|
|
|
, alignRight
|
|
|
|
, F.alignRight
|
|
|
|
]
|
|
|
|
)
|
|
|
|
[ text (String.fromInt index ++ ". ") ]
|
|
|
|
, column
|
|
|
|
[ spacing 8
|
|
|
|
, width fill
|
|
|
|
]
|
2024-11-28 00:33:22 -06:00
|
|
|
[ episodeMaker appearanceEntry
|
|
|
|
, experienceMaker appearanceEntry
|
|
|
|
, dateMaker appearanceEntry
|
|
|
|
, subjectMaker appearanceEntry
|
|
|
|
, subjectList appearanceEntry
|
2024-11-27 23:06:00 -06:00
|
|
|
]
|
|
|
|
]
|
2024-11-27 18:53:53 -06:00
|
|
|
]
|
|
|
|
|
|
|
|
|
2024-11-28 00:33:22 -06:00
|
|
|
episodeMaker : Appearance -> Element msg
|
|
|
|
episodeMaker appearanceEntry =
|
|
|
|
paragraphLinkFormat
|
|
|
|
{ url = appearanceEntry.appearanceLink
|
|
|
|
, label =
|
2024-12-06 03:02:37 -06:00
|
|
|
paragraph
|
2024-11-28 00:33:22 -06:00
|
|
|
[ F.size 18
|
|
|
|
]
|
|
|
|
[ text ("#" ++ appearanceEntry.appearanceEpisode ++ ": " ++ appearanceEntry.appearanceTitle)
|
|
|
|
|> el
|
2024-11-28 00:58:24 -06:00
|
|
|
[ F.color colourTheme.textLightOrange
|
|
|
|
, mouseOver [ F.color colourTheme.textDarkOrange ]
|
2024-11-28 00:33:22 -06:00
|
|
|
, transitionStyle
|
|
|
|
]
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-11-27 22:36:35 -06:00
|
|
|
experienceMaker : Appearance -> Element msg
|
|
|
|
experienceMaker appearanceEntry =
|
|
|
|
row
|
|
|
|
[ width fill
|
|
|
|
, height fill
|
|
|
|
]
|
|
|
|
[ column
|
2024-11-28 00:33:22 -06:00
|
|
|
[ E.alignTop
|
|
|
|
, E.alignLeft
|
|
|
|
]
|
2024-11-28 19:28:24 -06:00
|
|
|
[ paragraph
|
|
|
|
(paragraphBoldFormat
|
|
|
|
++ [ F.size 18
|
|
|
|
, E.width fill
|
|
|
|
]
|
|
|
|
)
|
2024-11-28 00:33:22 -06:00
|
|
|
[ el
|
|
|
|
[ tooltip
|
|
|
|
"This represents how pleasant it was to interact with the host(s)."
|
|
|
|
]
|
|
|
|
(text "Pleasantness:")
|
|
|
|
]
|
2024-11-27 22:36:35 -06:00
|
|
|
]
|
2024-11-28 19:28:24 -06:00
|
|
|
, barPadding
|
2024-11-27 22:36:35 -06:00
|
|
|
[ barMaker getExperienceTooltip appearanceEntry.appearanceExperience ]
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
getExperienceTooltip : Int -> String
|
|
|
|
getExperienceTooltip num =
|
|
|
|
case num of
|
|
|
|
0 ->
|
2024-11-30 04:32:00 -06:00
|
|
|
"Nightmare. Complete fucking cunt."
|
2024-11-27 22:36:35 -06:00
|
|
|
|
|
|
|
1 ->
|
2024-11-30 04:32:00 -06:00
|
|
|
"Toxic. Deliberately malicious."
|
2024-11-27 22:36:35 -06:00
|
|
|
|
|
|
|
2 ->
|
|
|
|
"Hostile. Consistently disruptive."
|
|
|
|
|
|
|
|
3 ->
|
|
|
|
"Belligerent. Consistently disrespectful."
|
|
|
|
|
|
|
|
4 ->
|
|
|
|
"Uncivil. Frequently dismissive."
|
|
|
|
|
|
|
|
5 ->
|
|
|
|
"Neutral. Unremarkable social interaction."
|
|
|
|
|
|
|
|
6 ->
|
|
|
|
"Civil. Slightly considerate."
|
|
|
|
|
|
|
|
7 ->
|
|
|
|
"Pleasant. Genuinely respectful."
|
|
|
|
|
|
|
|
8 ->
|
|
|
|
"Very kind. Consistently supportive."
|
|
|
|
|
|
|
|
9 ->
|
|
|
|
"Compassionate. Went out of their way."
|
|
|
|
|
|
|
|
10 ->
|
|
|
|
"Absolute angel. Perfectly empathetic."
|
|
|
|
|
|
|
|
_ ->
|
|
|
|
"Behavior level out of expected range."
|
|
|
|
|
|
|
|
|
|
|
|
dateMaker : Appearance -> Element msg
|
|
|
|
dateMaker appearanceEntry =
|
|
|
|
row paragraphBoldFormat
|
|
|
|
[ column
|
|
|
|
[ alignTop
|
|
|
|
]
|
|
|
|
[ text "Published:"
|
|
|
|
]
|
|
|
|
, column
|
|
|
|
[ alignTop
|
|
|
|
, width fill
|
|
|
|
]
|
|
|
|
[ paragraph
|
|
|
|
[ F.regular
|
|
|
|
, paddingEach
|
|
|
|
{ top = 0
|
|
|
|
, right = 0
|
|
|
|
, bottom = 0
|
|
|
|
, left = 3
|
|
|
|
}
|
|
|
|
]
|
|
|
|
[ text appearanceEntry.appearanceYear ]
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
subjectMaker : Appearance -> Element msg
|
|
|
|
subjectMaker appearanceEntry =
|
2024-12-06 03:02:37 -06:00
|
|
|
paragraph paragraphBoldFormat
|
2024-11-27 18:53:53 -06:00
|
|
|
[ column
|
|
|
|
[ alignTop
|
|
|
|
]
|
2024-12-06 03:02:37 -06:00
|
|
|
[ text "Subjects: "
|
2024-11-27 18:53:53 -06:00
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
subjectList : Appearance -> Element msg
|
|
|
|
subjectList appearanceEntry =
|
2024-12-06 03:02:37 -06:00
|
|
|
paragraph
|
2024-11-27 18:53:53 -06:00
|
|
|
[ spacing 8
|
|
|
|
, width fill
|
|
|
|
, paddingEach
|
|
|
|
{ top = 0
|
|
|
|
, right = 0
|
|
|
|
, bottom = 0
|
2024-11-27 23:06:00 -06:00
|
|
|
, left = 25
|
2024-11-27 18:53:53 -06:00
|
|
|
}
|
|
|
|
]
|
|
|
|
<|
|
|
|
|
List.map2 (\x y -> makeSubject x)
|
|
|
|
appearanceEntry.appearanceSubjects
|
|
|
|
(List.range 1 (List.length appearanceEntry.appearanceSubjects))
|
|
|
|
|
|
|
|
|
|
|
|
makeSubject : Subjects -> Element msg
|
|
|
|
makeSubject subjects =
|
2024-12-06 03:02:37 -06:00
|
|
|
paragraph
|
2024-11-27 18:53:53 -06:00
|
|
|
[ E.width fill
|
|
|
|
, alignLeft
|
|
|
|
, paddingEach
|
|
|
|
{ top = 0
|
|
|
|
, right = 0
|
|
|
|
, bottom = 0
|
|
|
|
, left = 8
|
|
|
|
}
|
|
|
|
]
|
|
|
|
[ paragraph [ F.regular ]
|
|
|
|
[ text ("‣ " ++ subjects.subject) ]
|
|
|
|
]
|