mirror of
https://github.com/mdgriffith/elm-ui.git
synced 2024-11-29 15:24:07 +03:00
Merge pull request #123 from tomstejskal/master
Classify device using the longer side of the display
This commit is contained in:
commit
f9728c11b8
@ -1558,20 +1558,16 @@ classifyDevice : { window | height : Int, width : Int } -> Device
|
||||
classifyDevice window =
|
||||
{ class =
|
||||
let
|
||||
shortSide =
|
||||
if window.width < window.height then
|
||||
window.width
|
||||
|
||||
else
|
||||
window.height
|
||||
longSide =
|
||||
max window.width window.height
|
||||
in
|
||||
if shortSide <= 600 then
|
||||
if longSide <= 600 then
|
||||
Phone
|
||||
|
||||
else if shortSide > 600 && shortSide <= 1200 then
|
||||
else if longSide > 600 && longSide <= 1200 then
|
||||
Tablet
|
||||
|
||||
else if shortSide > 1200 && shortSide <= 1800 then
|
||||
else if longSide > 1200 && longSide <= 1800 then
|
||||
Desktop
|
||||
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user