git.iko.soy/typeable/elm-ui
on master help sign in
Classify device using the longer side of the display
d218ef9Tom Stejskal
src/Element.elm+5−9
@@ -1550,20 +1550,16 @@ classifyDevice : { window | height : Int, width : Int } -> Device
1550classifyDevice window =
1550classifyDevice window =
1551 { class =
1551 { class =
1552 let
1552 let
1553− shortSide =
1553+ longSide =
1554− if window.width < window.height then
1555− window.width
1556−
1557− else
1558− window.height
1554+ max window.width window.height
1559 in
1555 in
1560− if shortSide <= 600 then
1556+ if longSide <= 600 then
1561 Phone
1557 Phone
1562
1558
1563− else if shortSide > 600 && shortSide <= 1200 then
1559+ else if longSide > 600 && longSide <= 1200 then
1564 Tablet
1560 Tablet
1565
1561
1566− else if shortSide > 1200 && shortSide <= 1800 then
1562+ else if longSide > 1200 && longSide <= 1800 then
1567 Desktop
1563 Desktop
1568
1564
1569 else
1565 else