fix: unfucked responsiveness on homepage

This commit is contained in:
Nick 2025-12-05 19:39:08 -06:00
parent d6206ba667
commit 3731621402
3 changed files with 52 additions and 20 deletions

View file

@ -1,5 +1,6 @@
module Config.Helpers.Response exposing
( contentContainer
, deviceLogic
, pageList
, pageListCenter
, pageListFormat
@ -32,6 +33,33 @@ import Element.Background as B exposing (color)
import Html.Attributes exposing (style)
deviceLogic :
{ desktop : a
, bigDesktop : a
, tablet : a
, phone : a
}
-> Device
-> a
deviceLogic values device =
case device.class of
Desktop ->
values.desktop
BigDesktop ->
values.bigDesktop
Tablet ->
case device.orientation of
_ ->
values.tablet
Phone ->
case device.orientation of
_ ->
values.phone
topLevelContainer : Element msg -> Element msg
topLevelContainer =
el

View file

@ -5,7 +5,8 @@ import Config.Helpers.Cards.Inner.Text exposing (detailBodyLink)
import Config.Helpers.Headers.Types exposing (Header)
import Config.Helpers.Response
exposing
( pageListCenter
( deviceLogic
, pageListCenter
, topLevelContainer
)
import Config.Helpers.Viewport exposing (resetViewport)
@ -163,28 +164,30 @@ homePage device image =
, centerY
, E.spacing 20
, E.width (E.fill |> minimum 100)
, E.width (E.fill |> maximum 875)
, E.width
(E.fill
|> maximum
(deviceLogic
{ desktop = 875
, bigDesktop = 875
, tablet = 500
, phone = 325
}
device
)
)
]
[ el
[ centerX
, E.width <|
px <|
case device.class of
Desktop ->
675
BigDesktop ->
675
Tablet ->
case device.orientation of
_ ->
300
Phone ->
case device.orientation of
_ ->
150
deviceLogic
{ desktop = 675
, bigDesktop = 675
, tablet = 300
, phone = 150
}
device
]
<|
html image