Merge pull request #91 from RosarioPulella/master

Make classifyDevice's DeviceClass based on the shorter side of the window.
This commit is contained in:
Matthew Griffith 2019-06-12 19:35:35 -04:00 committed by GitHub
commit b65a490c23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1538,13 +1538,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