website/frontend/src/Pages/Interviews.elm

316 lines
8.2 KiB
Elm
Raw Normal View History

2024-11-27 01:42:58 -06:00
module Pages.Interviews exposing (Model, Msg, page)
2024-12-09 19:53:09 -06:00
import Config.Data.Identity exposing (pageNames)
2024-12-27 01:30:21 -06:00
import Config.Helpers.Cards.Inner.Helpers exposing (..)
import Config.Helpers.Cards.Outer.Helpers exposing (cardMaker)
import Config.Helpers.Cards.Outer.Types as C
2024-12-15 02:31:26 -06:00
import Config.Helpers.Converters exposing (formatSocial)
import Config.Helpers.Format
exposing
( 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 (interviewHeader)
import Config.Helpers.Headers.Types as R exposing (..)
2024-12-24 03:51:55 -06:00
import Config.Helpers.ImageFolders as M 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-15 02:31:26 -06:00
import Config.Helpers.StrengthBar
exposing
( barMaker
, barPadding
)
import Config.Helpers.ToolTip exposing (tooltip)
2024-12-09 19:53:09 -06:00
import Config.Helpers.Viewport exposing (resetViewport)
2024-12-27 01:30:21 -06:00
import Config.Pages.Debate.Cuckery.List exposing (cuckListNumber)
2024-12-15 02:31:26 -06:00
import Config.Pages.Interviews.Records.DrShawnBakerPodcast exposing (drShawnBakerPodcast)
import Config.Pages.Interviews.Records.FitAndFurious exposing (fitAndFurious)
import Config.Pages.Interviews.Records.FoolproofMastery exposing (foolproofMastery)
import Config.Pages.Interviews.Records.KetogeeksPodcast exposing (ketoGeeksPodcast)
import Config.Pages.Interviews.Records.LegendaryLifePodcast exposing (legendaryLifePodcast)
import Config.Pages.Interviews.Records.MarkBellsPowerProject exposing (markBellsPowerProject)
import Config.Pages.Interviews.Records.MuscleMemoirsPodcast exposing (muscleMemoirsPodcast)
import Config.Pages.Interviews.Records.SigmaNutritionRadio exposing (sigmaNutritionRadio)
import Config.Pages.Interviews.Records.StrenuousLifePodcast exposing (strenuousLifePodcast)
import Config.Pages.Interviews.Types exposing (..)
2024-12-27 01:30:21 -06:00
import Config.Style.Colour.Helpers exposing (ThemeColor(..), colourTheme)
2024-12-24 03:51:55 -06:00
import Config.Style.Images exposing (imageSquareMaker)
2024-12-15 02:31:26 -06:00
import Config.Style.Transitions
exposing
( hoverFontDarkOrange
, transitionStyleFast
, transitionStyleSlow
)
2024-11-27 01:42:58 -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 exposing (style)
2024-11-27 01:42:58 -06:00
import Layouts
import Page exposing (Page)
import Route exposing (Route)
import Shared
import View exposing (View)
page : Shared.Model -> Route () -> Page Model Msg
page shared route =
Page.new
{ init = init
, update = update
, subscriptions = subscriptions
, view = view shared
2024-11-27 01:42:58 -06:00
}
|> Page.withLayout toLayout
toLayout : Model -> Layouts.Layout Msg
toLayout model =
2024-12-07 15:43:26 -06:00
Layouts.Navbar {}
2024-11-27 01:42:58 -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-27 01:42:58 -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-14 23:59:50 -06:00
{ title = pageNames.pageInterviews
2024-11-27 01:42:58 -06:00
, attributes = []
, element = interviewContainer shared.device
2024-11-27 01:42:58 -06:00
}
interviewContainer : Device -> Element msg
interviewContainer device =
topLevelContainer (interviewList device)
2024-11-27 01:42:58 -06:00
interviewList : Device -> Element msg
interviewList device =
2024-11-27 01:42:58 -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-27 01:42:58 -06:00
<|
2024-12-01 02:56:13 -06:00
List.concat
2024-12-22 04:36:03 -06:00
[ [ headerMaker (R.Interviews interviewHeader) ]
, List.map
2024-12-21 23:23:59 -06:00
(\interview ->
2024-12-24 03:51:55 -06:00
cardMaker device (C.Interview interview) (contentList device interview)
2024-12-21 23:23:59 -06:00
)
2024-12-01 02:56:13 -06:00
[ sigmaNutritionRadio
, markBellsPowerProject
, foolproofMastery
, ketoGeeksPodcast
, legendaryLifePodcast
, muscleMemoirsPodcast
, fitAndFurious
, strenuousLifePodcast
, drShawnBakerPodcast
]
2024-11-27 01:42:58 -06:00
]
2024-12-15 02:31:26 -06:00
2024-12-24 03:51:55 -06:00
contentList : Device -> Interview -> List (Element msg)
contentList device interview =
let
image : String -> Element msg
image size =
el
[ alignLeft
, alignTop
, paddingEach
{ top = 0
, right = 8
, bottom = 0
, left = 0
}
]
<|
imageSquareMaker device (imagePathMaker M.Interviews interview.interviewImage) True size
2024-12-27 01:30:21 -06:00
imageMaker : Element msg
imageMaker =
case ( device.class, device.orientation ) of
( Phone, Portrait ) ->
2024-12-27 23:24:35 -06:00
none
2024-12-27 01:30:21 -06:00
( Tablet, Portrait ) ->
2024-12-27 23:24:35 -06:00
none
2024-12-27 01:30:21 -06:00
_ ->
2024-12-27 23:24:35 -06:00
image "Fatty"
2024-12-24 03:51:55 -06:00
in
[ row
[ paddingEach
{ top = 3
, right = 0
, bottom = 0
, left = 0
}
2024-12-27 01:30:21 -06:00
, detailSpacing
, width fill
2024-12-24 03:51:55 -06:00
]
2024-12-27 01:30:21 -06:00
[ imageMaker
, detailFormat column
[ socialMaker interview.interviewSocial interview.interviewSocial
, detailTitleMaker TextLightGrey "Appearances:"
, appearanceMaker interview
2024-12-24 03:51:55 -06:00
]
]
]
2024-12-15 02:31:26 -06:00
appearanceMaker : Interview -> Element msg
appearanceMaker interview =
2024-12-27 23:24:35 -06:00
detailFormat column
[ listMaker2 makeAppearance interview.interviewAppearances ]
2024-12-15 02:31:26 -06:00
makeAppearance : Appearance -> Int -> Element msg
makeAppearance appearanceEntry index =
2024-12-27 01:30:21 -06:00
detailFormat row
[ listCounter index
, detailFormat column
[ episodeMaker appearanceEntry
, experienceMaker appearanceEntry
, dateMaker appearanceEntry
, subjectMaker appearanceEntry
2024-12-15 02:31:26 -06:00
]
2024-12-27 01:30:21 -06:00
]
2024-12-15 02:31:26 -06:00
episodeMaker : Appearance -> Element msg
episodeMaker appearanceEntry =
newTabLink
2024-12-27 01:30:21 -06:00
[]
2024-12-15 02:31:26 -06:00
{ url = appearanceEntry.appearanceLink
2024-12-27 01:30:21 -06:00
, label = detailTitleMaker TextLightOrange ("#" ++ appearanceEntry.appearanceEpisode ++ ": " ++ appearanceEntry.appearanceTitle)
2024-12-15 02:31:26 -06:00
}
experienceMaker : Appearance -> Element msg
experienceMaker appearanceEntry =
2024-12-27 23:24:35 -06:00
detailFormat row
[ el
[ tooltip
"This represents my confidence in the soundness of the argument."
2024-12-15 02:31:26 -06:00
]
2024-12-27 23:24:35 -06:00
<|
detailTitleMaker TextLightGrey "Pleasantness:"
2024-12-15 02:31:26 -06:00
, barPadding
[ barMaker getExperienceTooltip appearanceEntry.appearanceExperience ]
]
2024-12-27 23:24:35 -06:00
dateMaker : Appearance -> Element msg
dateMaker appearanceEntry =
detailFormat row
[ detailTitleMaker TextLightGrey "Published:"
, detailBodyMaker TextLightGrey (text appearanceEntry.appearanceYear)
]
subjectMaker : Appearance -> Element msg
subjectMaker appearanceEntry =
detailFormat column
[ detailFormatEl <| detailTitleMaker TextLightGrey "Subjects: "
, detailFormat column [ listMaker makeSubject appearanceEntry.appearanceSubjects ]
]
makeSubject : Subjects -> Element msg
makeSubject subjects =
listItem TextLightGrey subjects.subject
2024-12-15 02:31:26 -06:00
getExperienceTooltip : Int -> String
getExperienceTooltip num =
case num of
0 ->
"Nightmare. Complete fucking cunt."
1 ->
"Toxic. Deliberately malicious."
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."