mirror of
https://github.com/typeable/elm-ui.git
synced 2024-11-30 09:56:23 +03:00
Change classifyDevice function to support rotated devices.
This commit is contained in:
parent
ed45160ce8
commit
f61850e90d
@ -1536,13 +1536,21 @@ type Orientation
|
||||
classifyDevice : { window | height : Int, width : Int } -> Device
|
||||
classifyDevice window =
|
||||
{ class =
|
||||
if window.width <= 600 then
|
||||
let
|
||||
shortSide =
|
||||
if window.width < window.height then
|
||||
window.width
|
||||
|
||||
else
|
||||
window.height
|
||||
in
|
||||
if shortSide <= 600 then
|
||||
Phone
|
||||
|
||||
else if window.width > 600 && window.width <= 1200 then
|
||||
else if shortSide > 600 && shortSide <= 1200 then
|
||||
Tablet
|
||||
|
||||
else if window.width > 1200 && window.width <= 1800 then
|
||||
else if shortSide > 1200 && shortSide <= 1800 then
|
||||
Desktop
|
||||
|
||||
else
|
||||
@ -1555,7 +1563,6 @@ classifyDevice window =
|
||||
Landscape
|
||||
}
|
||||
|
||||
|
||||
{-| When designing it's nice to use a modular scale to set spacial rythms.
|
||||
|
||||
scaled =
|
||||
|
Loading…
Reference in New Issue
Block a user