website/frontend/src/Pages/Interviews.elm

521 lines
13 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-15 02:31:26 -06:00
import Config.Helpers.CardFormat
exposing
( cardContentSpacing
, cardFormatter
, cardMaker
, cardTitleMaker
, desktopCardMaker
, desktopImageBoxSize
, desktopImageSize
, fieldSpacer
, mobileCardMaker
, mobileImageBoxSize
, mobileImageSize
, topLevelBox
)
import Config.Helpers.Converters exposing (formatSocial)
import Config.Helpers.Format
exposing
( paragraphFontSize
, paragraphSpacing
)
2024-12-18 20:11:04 -06:00
import Config.Helpers.Headers.Header exposing (..)
import Config.Helpers.Headers.Types exposing (Header)
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-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 (..)
import Config.Style.Colour exposing (colourTheme)
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-09 20:30:04 -06:00
pageList
)
2024-11-27 01:42:58 -06:00
<|
2024-12-01 02:56:13 -06:00
List.concat
[ List.map headerMaker
[ interviewHeader ]
, (case ( device.class, device.orientation ) of
( Phone, Portrait ) ->
List.map interviewMakerMobile
( Tablet, Portrait ) ->
List.map interviewMakerMobile
2024-12-07 15:43:26 -06:00
_ ->
List.map interviewMaker
)
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-15 03:01:13 -06:00
interviewHeader : Header
interviewHeader =
let
name =
"Interviews"
in
{ headerTitle = String.toUpper name
, headerBody = "This page showcases various podcasts and shows I've been on. If youd like to have me as a guest on your podcast, feel free to reach outId love to share my perspectives with your audience!"
}
2024-12-15 02:31:26 -06:00
interviewMaker : Interview -> Element msg
interviewMaker interview =
row
topLevelBox
2024-12-18 20:11:04 -06:00
[ desktopCardMaker desktopImageBoxSize desktopImageSize (interviewImage interview) interview.interviewSocial
2024-12-15 02:31:26 -06:00
, cardMaker
2024-12-18 20:11:04 -06:00
[ cardTitleMaker interview.interviewName
2024-12-15 02:31:26 -06:00
, cardFormatter
[ cardContentSpacing
[ column
fieldSpacer
2024-12-18 20:11:04 -06:00
[ appearanceTitle interview
2024-12-15 02:31:26 -06:00
, appearanceMaker interview
]
]
]
]
]
interviewMakerMobile : Interview -> Element msg
interviewMakerMobile interview =
row
topLevelBox
[ column [] []
, cardMaker
2024-12-18 20:11:04 -06:00
[ cardTitleMaker interview.interviewName
2024-12-15 02:31:26 -06:00
, cardFormatter
[ cardContentSpacing
[ column
fieldSpacer
[ row [ spacing 10 ]
2024-12-18 20:11:04 -06:00
[ mobileCardMaker mobileImageBoxSize mobileImageSize (interviewImage interview) interview.interviewSocial
2024-12-15 02:31:26 -06:00
, socialMaker interview
]
, appearanceTitle interview
, appearanceMaker interview
]
]
]
]
]
interviewImage : Interview -> { src : String, description : String }
interviewImage interview =
{ src = "interviews/" ++ interview.interviewImage ++ ".png"
, description = interview.interviewImage
}
socialMaker : Interview -> Element msg
socialMaker interview =
paragraph
[ F.color colourTheme.textLightGrey
, paragraphSpacing
, paragraphFontSize
, F.bold
, F.size 18
, spacing 5
]
[ text "Social: "
, newTabLink
[ paragraphFontSize
, F.color colourTheme.textLightOrange
]
{ url = interview.interviewSocial
, label =
el
[ transitionStyleSlow
, hoverFontDarkOrange
]
<|
text (formatSocial interview.interviewSocial)
}
]
appearanceTitle : Interview -> Element msg
appearanceTitle interview =
paragraph
[ F.color colourTheme.textLightGrey
, paragraphSpacing
, paragraphFontSize
, F.bold
, F.size 18
]
[ text "Appearances: " ]
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
[ F.color colourTheme.textLightGrey
, paragraphSpacing
, paragraphFontSize
, alignLeft
, spacing 8
, width fill
]
[ row
([ F.color colourTheme.textLightGrey
, paragraphSpacing
, paragraphFontSize
]
++ [ F.size 18
, E.width fill
, paddingEach
{ top = 0
, bottom = 0
, left = 35
, right = 0
}
]
)
[ column
[ F.color colourTheme.textLightGrey
, paragraphSpacing
, paragraphFontSize
, F.size 18
, alignTop
, alignRight
, F.alignRight
]
[ text (String.fromInt index ++ ". ") ]
, column
[ spacing 8
, width fill
]
[ episodeMaker appearanceEntry
, experienceMaker appearanceEntry
, dateMaker appearanceEntry
, subjectMaker appearanceEntry
, subjectList appearanceEntry
]
]
]
episodeMaker : Appearance -> Element msg
episodeMaker appearanceEntry =
newTabLink
[ paragraphFontSize
, F.color colourTheme.textLightOrange
]
{ url = appearanceEntry.appearanceLink
, label =
paragraph
[ F.size 18
]
[ text ("#" ++ appearanceEntry.appearanceEpisode ++ ": " ++ appearanceEntry.appearanceTitle)
|> el
[ F.color colourTheme.textLightOrange
, hoverFontDarkOrange
]
]
}
experienceMaker : Appearance -> Element msg
experienceMaker appearanceEntry =
row
[ width fill
, height fill
]
[ column
[ E.alignTop
, E.alignLeft
]
[ paragraph
[ F.color colourTheme.textLightGrey
, paragraphSpacing
, paragraphFontSize
, F.bold
, F.size 18
, E.width fill
]
[ el
[ tooltip
"This represents how pleasant it was to interact with the host(s)."
]
(el
[ paddingEach
{ top = 0
, right = 10
, bottom = 0
, left = 0
}
]
<|
text "Pleasantness:"
)
]
]
, barPadding
[ barMaker getExperienceTooltip appearanceEntry.appearanceExperience ]
]
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."
dateMaker : Appearance -> Element msg
dateMaker appearanceEntry =
row
[ F.color colourTheme.textLightGrey
, paragraphSpacing
, paragraphFontSize
, F.bold
]
[ 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 =
paragraph
[ F.color colourTheme.textLightGrey
, paragraphSpacing
, paragraphFontSize
, F.bold
]
[ column
[ alignTop
]
[ text "Subjects: "
]
]
subjectList : Appearance -> Element msg
subjectList appearanceEntry =
2024-12-18 20:11:04 -06:00
column
2024-12-15 02:31:26 -06:00
[ spacing 8
, width fill
, paddingEach
{ top = 0
, right = 0
, bottom = 0
, left = 25
}
]
<|
List.map2 (\x y -> makeSubject x)
appearanceEntry.appearanceSubjects
(List.range 1 (List.length appearanceEntry.appearanceSubjects))
makeSubject : Subjects -> Element msg
makeSubject subjects =
2024-12-18 20:11:04 -06:00
el
2024-12-15 02:31:26 -06:00
[ E.width fill
, alignLeft
, paddingEach
{ top = 0
, right = 0
, bottom = 0
, left = 8
}
]
2024-12-18 20:11:04 -06:00
<|
el
[ F.regular
, paragraphFontSize
]
<|
text (" " ++ subjects.subject)