Merge pull request #123 from tomstejskal/master

Classify device using the longer side of the display
This commit is contained in:
Matthew Griffith 2019-07-21 09:36:50 -04:00 committed by GitHub
commit f9728c11b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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