feat: stuff is fucked but I'm too tired to continue tonight

This commit is contained in:
Nick 2024-12-21 04:07:50 -06:00
parent d2056e032e
commit 277ba17421
37 changed files with 683 additions and 1491 deletions

View file

@ -2,22 +2,7 @@ module Config.Helpers.Articles.Article exposing (..)
import Config.Data.Identity exposing (pageNames)
import Config.Helpers.Articles.Types exposing (References)
import Config.Helpers.CardFormat
exposing
( cardContentSpacing
, cardFormatter
, cardMaker
, cardSubTitleMaker
, cardTitleMaker
, desktopCardMaker
, desktopImageBoxSize
, desktopImageSize
, fieldSpacer
, mobileCardMaker
, mobileImageBoxSize
, mobileImageSize
, topLevelBox
)
import Config.Helpers.CardFormat exposing (cardMaker)
import Config.Helpers.Format exposing (..)
import Config.Helpers.Headers.Header exposing (headerMaker)
import Config.Helpers.Headers.Types exposing (Header)
@ -59,31 +44,22 @@ import Shared exposing (..)
import View exposing (View)
articleMaker : BlogArticle -> Element msg
articleMaker article =
column
topLevelBox
[ cardMaker
[ cardTitleMaker (String.toUpper article.articleName)
, cardFormatter
[ cardContentSpacing
[ column
fieldSpacer
[ cardSubTitleMaker
[ articleImage article.articleImage
, renderDeviceMarkdown article.articleBody
, case article.hasReferences of
True ->
articleReferences article
articleMaker : Device -> BlogArticle -> Element msg
articleMaker device article =
cardMaker device article.articleName (contentList article) { description = "", src = "String" } article.articleLink
False ->
none
]
]
]
]
]
]
contentList : BlogArticle -> List (Element msg)
contentList article =
[ articleImage article.articleImage
, renderDeviceMarkdown article.articleBody
, case article.hasReferences of
True ->
articleReferences article
False ->
none
]
articleReferences : BlogArticle -> Element msg

View file

@ -7,7 +7,8 @@ import Config.Data.Identity
import Config.Helpers.Converters exposing (formatName)
import Config.Helpers.Format
exposing
( paragraphFontSize
( headerFontSizeMedium
, paragraphFontSize
, paragraphSpacing
)
import Config.Style.Colour exposing (colourTheme)
@ -29,303 +30,211 @@ import Element.Border as D
import Element.Font as F
import Html.Attributes as H
import Route.Path as Path exposing (..)
import Shared
topLevelBox : List (Attribute msg)
topLevelBox =
[ E.width fill
, E.height fill
, E.alignTop
, E.alignRight
, padding 10
]
cardMaker : List (Element msg) -> Element msg
cardMaker =
column
[ E.width fill
, D.width 5
, D.color colourTheme.backgroundDarkGrey
, D.rounded 32
, glowDeepDarkGrey
]
cardFormatter : List (Element msg) -> Element msg
cardFormatter =
column
[ E.height fill
, E.width fill
, centerX
, B.color colourTheme.backgroundDarkGrey
cardMaker : Device -> String -> List (Element msg) -> { description : String, src : String } -> String -> Element msg
cardMaker device title content image url =
el
[ width (fill |> minimum 100)
, width (fill |> maximum 875)
, padding 10
, D.roundEach
{ topLeft = 0
, topRight = 0
, bottomRight = 26
, bottomLeft = 26
}
, spacing 8
]
cardSubTitleMaker : List (Element msg) -> Element msg
cardSubTitleMaker =
paragraph
[ F.color colourTheme.textLightGrey
, paragraphSpacing
, paragraphFontSize
, F.size 18
, centerX
, F.center
]
cardContentSpacing : List (Element msg) -> Element msg
cardContentSpacing =
column
[ paddingEach
{ top = 0
, bottom = 0
, left = 15
, right = 15
}
, spacing 8
, width fill
]
imageTransitionStyle : List (Attribute msg)
imageTransitionStyle =
[ D.rounded 100
, D.width 5
, glowDeepDarkGrey
, D.color colourTheme.backgroundDarkGrey
, B.color colourTheme.backgroundDarkGrey
, mouseOver
[ D.color colourTheme.textDarkOrange
, B.color colourTheme.textDarkOrange
, glowDeepDarkOrange
]
, transitionStyleMedium
]
desktopCardMaker :
List (Attribute msg)
-> List (Attribute msg)
->
{ src : String
, description : String
}
-> String
-> Element msg
desktopCardMaker size1 size2 image urlLink =
cardImageMaker size1 size2 image urlLink
mobileCardMaker :
List (Attribute msg)
-> List (Attribute msg)
->
{ src : String
, description : String
}
-> String
-> Element msg
mobileCardMaker size1 size2 image urlLink =
cardImageMaker size1 size2 image urlLink
cardImageMaker : List (Attribute msg) -> List (Attribute msg) -> { src : String, description : String } -> String -> Element msg
cardImageMaker size1 size2 image urlLink =
column
size1
[ el
imageTransitionStyle
(if
urlLink
== Path.toString Path.Home_
|| urlLink
== Path.toString Path.Contact
|| urlLink
== Path.toString Path.Debate
|| urlLink
== Path.toString Path.Debate_Arguments
|| urlLink
== Path.toString Path.Debate_Cucklist
|| urlLink
== Path.toString Path.Debate_Gibberish
|| urlLink
== Path.toString Path.Donate
|| urlLink
== Path.toString Path.Blog
|| urlLink
== Path.toString Path.Blog_Seedoils
|| urlLink
== Path.toString Path.Blog_Huntergatherers
|| urlLink
== Path.toString Path.Blog_Sapiendiet
|| urlLink
== Path.toString Path.Blog_Nagragoodrich
|| urlLink
== Path.toString Path.Blog_Quacksmashing
|| urlLink
== Path.toString Path.Blog_Bigfatsurprise
|| urlLink
== Path.toString Path.Blog_Everettvegans
|| urlLink
== Path.toString Path.Blog_Meatapologetics
|| urlLink
== Path.toString Path.Blog_Plantbasedmeta
|| urlLink
== Path.toString Path.Blog_Shenanigans
|| urlLink
== Path.toString Path.Blog_Sweetdeception
|| urlLink
== Path.toString Path.Interviews
|| urlLink
== Path.toString Path.Nutridex
|| urlLink
== Path.toString Path.Services
|| urlLink
== Path.toString Path.Services_Analysis
|| urlLink
== Path.toString Path.Services_Coaching
|| urlLink
== Path.toString Path.Services_Elm
|| urlLink
== Path.toString Path.Services_Nix
|| urlLink
== Path.toString Path.Services_Nutrition
then
link []
{ url = urlLink
, label =
E.image
size2
image
}
else
newTabLink []
{ url = urlLink
, label =
E.image
size2
image
}
)
]
desktopImageSize : List (Attribute msg)
desktopImageSize =
[ alignRight
, alignTop
, D.rounded 100
, clip
, E.width <| px 90
, E.height <| px 90
]
mobileImageSize : List (Attribute msg)
mobileImageSize =
[ D.rounded 100
, clip
, E.width <| px 45
, E.height <| px 45
]
desktopImageBoxSize : List (Attribute msg)
desktopImageBoxSize =
[ E.width <| px 115
, E.height <| px 115
, alignTop
, alignRight
]
mobileImageBoxSize : List (Attribute msg)
mobileImageBoxSize =
[ alignTop
, centerX
, alignLeft
, paddingEach
{ top = 0
, bottom = 10
, left = 0
, right = 0
}
]
cardTitleMaker : String -> Element msg
cardTitleMaker title =
paragraph
[ F.size 20
, F.bold
, F.color colourTheme.textLightGrey
, B.color colourTheme.textDarkOrange
, paddingEach
{ top = 6
, bottom = 3
, left = 0
, right = 0
}
, alignBottom
, width fill
, centerX
, F.center
, D.roundEach
{ topLeft = 26
, topRight = 26
, bottomRight = 0
, bottomLeft = 0
}
]
[ text title ]
fieldSpacer : List (Attribute msg)
fieldSpacer =
[ spacing 8
, width fill
]
underConstructionMaker : String -> Element msg
underConstructionMaker name =
row
topLevelBox
[ cardMaker
[ cardTitleMaker name
, cardFormatter
[ cardContentSpacing
[ column
fieldSpacer
[ cardSubTitleMaker
[ column []
[ row
[ spacing 10
]
[ column [ width <| px 35 ] [ html construction ]
, column
[ width fill
, F.color colourTheme.textLightOrange
, F.bold
, alignBottom
]
[ text "under construction"
]
]
]
]
]
<|
if
url
== Path.toString Path.Home_
|| url
== Path.toString Path.Contact
|| url
== Path.toString Path.Debate
|| url
== Path.toString Path.Debate_Arguments
|| url
== Path.toString Path.Debate_Cucklist
|| url
== Path.toString Path.Debate_Gibberish
|| url
== Path.toString Path.Donate
|| url
== Path.toString Path.Blog
|| url
== Path.toString Path.Blog_Seedoils
|| url
== Path.toString Path.Blog_Huntergatherers
|| url
== Path.toString Path.Blog_Sapiendiet
|| url
== Path.toString Path.Blog_Nagragoodrich
|| url
== Path.toString Path.Blog_Quacksmashing
|| url
== Path.toString Path.Blog_Bigfatsurprise
|| url
== Path.toString Path.Blog_Everettvegans
|| url
== Path.toString Path.Blog_Meatapologetics
|| url
== Path.toString Path.Blog_Plantbasedmeta
|| url
== Path.toString Path.Blog_Shenanigans
|| url
== Path.toString Path.Blog_Sweetdeception
|| url
== Path.toString Path.Interviews
|| url
== Path.toString Path.Nutridex
|| url
== Path.toString Path.Services
|| url
== Path.toString Path.Services_Analysis
|| url
== Path.toString Path.Services_Coaching
|| url
== Path.toString Path.Services_Elm
|| url
== Path.toString Path.Services_Nix
|| url
== Path.toString Path.Services_Nutrition
then
el
[ E.width fill
, D.width 5
, D.color colourTheme.backgroundDarkGrey
, D.rounded 32
, glowDeepDarkGrey
, mouseOver
[ D.color colourTheme.textDarkOrange
, B.color colourTheme.textDarkOrange
, glowDeepDarkOrange
]
, transitionStyleSlow
]
]
<|
link [ width fill ]
{ url = url
, label = cardStructure device title content image
}
else
el
[ E.width fill
, D.width 5
, D.color colourTheme.backgroundDarkGrey
, D.rounded 32
, glowDeepDarkGrey
, mouseOver
[ D.color colourTheme.textDarkOrange
, B.color colourTheme.textDarkOrange
, glowDeepDarkOrange
]
, transitionStyleSlow
]
<|
newTabLink []
{ url = url
, label = cardStructure device title content image
}
cardStructure : Device -> String -> List (Element msg) -> { description : String, src : String } -> Element msg
cardStructure device title content image =
column
[ width fill
]
[ el
[ headerFontSizeMedium
, F.bold
, F.color colourTheme.textLightGrey
, B.color colourTheme.textDarkOrange
, paddingEach
{ top = 6
, bottom = 3
, left = 20
, right = 20
}
, width fill
, F.center
, D.roundEach
{ topLeft = 26
, topRight = 26
, bottomRight = 0
, bottomLeft = 0
}
]
<|
paragraph [] [ text title ]
, el
[ E.height fill
, E.width fill
, centerX
, B.color colourTheme.backgroundDarkGrey
, padding 10
, D.roundEach
{ topLeft = 0
, topRight = 0
, bottomRight = 26
, bottomLeft = 26
}
, spacing 8
]
<|
el
[ paddingEach
{ top = 0
, bottom = 0
, left = 15
, right = 15
}
, spacing 8
, width fill
]
<|
row
[ width fill ]
[ column
[ spacing 8
, width fill
]
content
, el
[ alignRight
, alignTop
, paddingXY 20 20
]
<|
el
[ D.rounded 100
, D.width 5
, glowDeepDarkGrey
, D.color colourTheme.backgroundDarkGrey
, B.color colourTheme.backgroundDarkGrey
]
<|
E.image
([ alignRight
, alignTop
, D.rounded 100
, clip
]
++ (case ( device.class, device.orientation ) of
( Phone, Portrait ) ->
[ E.width <| px 45
, E.height <| px 45
]
( Tablet, Portrait ) ->
[ E.width <| px 45
, E.height <| px 45
]
_ ->
[ E.width <| px 90
, E.height <| px 90
]
)
)
image
]
]

View file

@ -2,29 +2,23 @@ module Config.Helpers.Headers.Header exposing (headerMaker)
import Config.Helpers.CardFormat exposing (..)
import Config.Helpers.Headers.Types exposing (Header)
import Config.Pages.Contact.Types exposing (Contact)
import Element as E
exposing
( Element
( Device
, Element
, column
, row
, text
)
import Shared exposing (..)
headerMaker : Header -> Element msg
headerMaker header =
row
topLevelBox
[ cardMaker
[ cardTitleMaker header.headerTitle
, cardFormatter
[ cardContentSpacing
[ column
fieldSpacer
[ cardSubTitleMaker
[ text header.headerBody ]
]
]
]
]
]
headerMaker : Device -> Header -> Element msg
headerMaker device header =
cardMaker device header.headerTitle (contentList header) { description = "", src = "" } ""
contentList : Header -> List (Element msg)
contentList header =
[ text header.headerBody ]

View file

@ -3,6 +3,7 @@ module Config.Helpers.Response exposing (..)
import Config.Style.Colour exposing (colourTheme)
import Element as E exposing (..)
import Element.Background as B exposing (color)
import Html.Attributes exposing (style)
topLevelContainer : Element msg -> Element msg
@ -11,7 +12,6 @@ topLevelContainer =
[ width fill
, height fill
, B.color colourTheme.backgroundLightGrey
, scrollbarY
]
@ -34,7 +34,7 @@ pageListFormat =
[ spacing 30
, centerX
, padding 30
, width (fill |> minimum 100)
, width (fill |> maximum 875)
, width fill
, height fill
, scrollbarY
]

View file

@ -1,13 +1,14 @@
module Config.Pages.Products.Records.NutriDex exposing (..)
import Config.Pages.Products.Types exposing (..)
import Element exposing (..)
import Element.Font as F exposing (..)
import Config.Pages.Products.Types exposing (..)
productNutriDex : NutriDex
productNutriDex =
{ nutriDexTitle = "The NutriDex"
, hasImage = False
, nutriDexFeatures =
[ { feature = "The essential nutrient yields of over 700 foods are ranked and adjusted for bioavailability, nutrient absorption capacity, and metabolic conversion inefficiencies!"
, featureTitle = "Nutrient Density Scoring: "

View file

@ -5,6 +5,7 @@ import Config.Helpers.Articles.Types exposing (References)
type alias NutriDex =
{ nutriDexTitle : String
, hasImage : Bool
, nutriDexFeatures : List Features
, nutriDexReference : List References
}

View file

@ -38,6 +38,10 @@ specialNavbarTransition =
htmlAttribute <| style "transition" "opacity .4s"
-- This special transition is needed to avoid weird animation sequencing rather in Chrome-based browsers.
hoverFontLightOrange : Attribute msg
hoverFontLightOrange =
mouseOver [ F.color colourTheme.textLightOrange ]