Change classifyDevice function to support rotated devices.

This commit is contained in:
Rosario Pulella 2019-02-04 21:45:23 -05:00
parent ed45160ce8
commit f61850e90d

View File

@ -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 =