mirror of
https://gitlab.com/upRootNutrition/website.git
synced 2025-06-16 04:25:11 -05:00
feat: massive refactor
This commit is contained in:
parent
c619757eff
commit
fc7b85afc1
214 changed files with 4764 additions and 4716 deletions
|
@ -1,26 +1,64 @@
|
|||
module Pages.Interviews exposing (Model, Msg, page)
|
||||
|
||||
import Config.Data.Identity exposing (pageNames)
|
||||
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
|
||||
)
|
||||
import Config.Helpers.Response
|
||||
exposing
|
||||
( pageList
|
||||
, topLevelContainer
|
||||
)
|
||||
import Config.Helpers.StrengthBar
|
||||
exposing
|
||||
( barMaker
|
||||
, barPadding
|
||||
)
|
||||
import Config.Helpers.ToolTip exposing (tooltip)
|
||||
import Config.Helpers.Viewport exposing (resetViewport)
|
||||
import Config.Pages.Interviews.Episodes.DrShawnBakerPodcast exposing (drShawnBakerPodcast)
|
||||
import Config.Pages.Interviews.Episodes.FitAndFurious exposing (fitAndFurious)
|
||||
import Config.Pages.Interviews.Episodes.FoolproofMastery exposing (foolproofMastery)
|
||||
import Config.Pages.Interviews.Episodes.KetogeeksPodcast exposing (ketoGeeksPodcast)
|
||||
import Config.Pages.Interviews.Episodes.LegendaryLifePodcast exposing (legendaryLifePodcast)
|
||||
import Config.Pages.Interviews.Episodes.MarkBellsPowerProject exposing (markBellsPowerProject)
|
||||
import Config.Pages.Interviews.Episodes.MuscleMemoirsPodcast exposing (muscleMemoirsPodcast)
|
||||
import Config.Pages.Interviews.Episodes.SigmaNutritionRadio exposing (sigmaNutritionRadio)
|
||||
import Config.Pages.Interviews.Episodes.StrenuousLifePodcast exposing (strenuousLifePodcast)
|
||||
import Config.Pages.Interviews.Helpers exposing (..)
|
||||
import Config.Pages.Headers.Helpers exposing (headerMaker)
|
||||
import Config.Pages.Headers.Records.Interviews exposing (interviewHeader)
|
||||
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
|
||||
)
|
||||
import Effect exposing (Effect)
|
||||
import Element as E exposing (..)
|
||||
import Config.Pages.Headers.Helpers exposing (headerMaker)
|
||||
import Config.Pages.Headers.Pages.Interviews exposing (interviewHeader)
|
||||
import Element.Background as B
|
||||
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)
|
||||
|
@ -136,3 +174,343 @@ interviewList device =
|
|||
, drShawnBakerPodcast
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
interviewMaker : Interview -> Element msg
|
||||
interviewMaker interview =
|
||||
row
|
||||
topLevelBox
|
||||
[ desktopCardMaker desktopImageBoxSize desktopImageSize (interviewImage interview) (interviewSocial interview)
|
||||
, cardMaker
|
||||
[ cardTitleMaker (interviewTitle interview)
|
||||
, cardFormatter
|
||||
[ cardContentSpacing
|
||||
[ column
|
||||
fieldSpacer
|
||||
[ socialMaker interview
|
||||
, appearanceTitle interview
|
||||
, appearanceMaker interview
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
interviewMakerMobile : Interview -> Element msg
|
||||
interviewMakerMobile interview =
|
||||
row
|
||||
topLevelBox
|
||||
[ column [] []
|
||||
, cardMaker
|
||||
[ cardTitleMaker (interviewTitle interview)
|
||||
, cardFormatter
|
||||
[ cardContentSpacing
|
||||
[ column
|
||||
fieldSpacer
|
||||
[ row [ spacing 10 ]
|
||||
[ mobileCardMaker mobileImageBoxSize mobileImageSize (interviewImage interview) (interviewSocial interview)
|
||||
, socialMaker interview
|
||||
]
|
||||
, appearanceTitle interview
|
||||
, appearanceMaker interview
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
interviewImage : Interview -> { src : String, description : String }
|
||||
interviewImage interview =
|
||||
{ src = "interviews/" ++ interview.interviewImage ++ ".png"
|
||||
, description = interview.interviewImage
|
||||
}
|
||||
|
||||
|
||||
interviewTitle : Interview -> String
|
||||
interviewTitle interview =
|
||||
interview.interviewName
|
||||
|
||||
|
||||
interviewSocial : Interview -> String
|
||||
interviewSocial interview =
|
||||
interview.interviewSocial
|
||||
|
||||
|
||||
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 =
|
||||
paragraph
|
||||
[ 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 =
|
||||
paragraph
|
||||
[ E.width fill
|
||||
, alignLeft
|
||||
, paddingEach
|
||||
{ top = 0
|
||||
, right = 0
|
||||
, bottom = 0
|
||||
, left = 8
|
||||
}
|
||||
]
|
||||
[ paragraph [ F.regular ]
|
||||
[ text ("‣ " ++ subjects.subject) ]
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue