Improve responsiveness

This commit is contained in:
Correl Roush 2022-02-11 00:48:57 -05:00
parent e269dc0070
commit ccc3ad8c88

View file

@ -349,15 +349,24 @@ colors =
}
isMobile : E.Device -> Bool
isMobile device =
case device.orientation of
E.Landscape ->
False
E.Portrait ->
True
searchBar : Model -> E.Element Msg
searchBar model =
let
alignment =
case model.device.class of
E.Phone ->
if isMobile model.device then
E.column
_ ->
else
E.row
in
alignment
@ -543,8 +552,7 @@ viewCardBrowser model =
]
details =
case model.device.class of
E.Phone ->
if isMobile model.device then
E.column
[ E.spacing 10
, E.padding 10
@ -563,7 +571,7 @@ viewCardBrowser model =
_ ->
[ E.none ]
_ ->
else
E.el
[ E.alignTop
, E.width <| E.fillPortion 1
@ -596,13 +604,12 @@ viewCardBrowser model =
cards cardPage =
let
attrs =
case model.device.class of
E.Phone ->
if isMobile model.device then
[ E.width E.fill
, E.height <| E.fillPortion 3
]
_ ->
else
[ E.width <| E.fillPortion 2
, E.height E.fill
]
@ -639,8 +646,7 @@ viewCardBrowser model =
Spinner.view manaSpinner model.spinner
Ready cardPage ->
case model.device.class of
E.Phone ->
if isMobile model.device then
E.column
[ E.width E.fill
, E.height E.fill
@ -649,7 +655,7 @@ viewCardBrowser model =
]
[ details, cards cardPage ]
_ ->
else
E.row
[ E.width E.fill
, E.height E.fill