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

@ -13,12 +13,13 @@ in
systemPackages = builtins.attrValues { systemPackages = builtins.attrValues {
inherit (pkgs) inherit (pkgs)
git git
grim
helix
just
pijul pijul
sshfs sshfs
tomb tomb
just
virt-manager virt-manager
helix
; ;
}; };
variables = { variables = {

View file

@ -1,5 +1,6 @@
module Config.Helpers.Response exposing module Config.Helpers.Response exposing
( contentContainer ( contentContainer
, deviceLogic
, pageList , pageList
, pageListCenter , pageListCenter
, pageListFormat , pageListFormat
@ -32,6 +33,33 @@ import Element.Background as B exposing (color)
import Html.Attributes exposing (style) 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 : Element msg -> Element msg
topLevelContainer = topLevelContainer =
el 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.Headers.Types exposing (Header)
import Config.Helpers.Response import Config.Helpers.Response
exposing exposing
( pageListCenter ( deviceLogic
, pageListCenter
, topLevelContainer , topLevelContainer
) )
import Config.Helpers.Viewport exposing (resetViewport) import Config.Helpers.Viewport exposing (resetViewport)
@ -163,28 +164,30 @@ homePage device image =
, centerY , centerY
, E.spacing 20 , E.spacing 20
, E.width (E.fill |> minimum 100) , 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 [ el
[ centerX [ centerX
, E.width <| , E.width <|
px <| px <|
case device.class of deviceLogic
Desktop -> { desktop = 675
675 , bigDesktop = 675
, tablet = 300
BigDesktop -> , phone = 150
675 }
device
Tablet ->
case device.orientation of
_ ->
300
Phone ->
case device.orientation of
_ ->
150
] ]
<| <|
html image html image