git.iko.soy/typeable/elm-ui
on master help sign in
update classifyDevice to capture phones if they're rotated AND desktops.
5ce0cabMatthew Griffith
src/Element.elm+8−3
@@ -1559,18 +1559,23 @@ If you have more detailed concerns around responsiveness, it probably makes sens
1559-}
1559-}
1560classifyDevice : { window | height : Int, width : Int } -> Device
1560classifyDevice : { window | height : Int, width : Int } -> Device
1561classifyDevice window =
1561classifyDevice window =
1562+ -- Tested in this ellie:
1563+ -- https://ellie-app.com/68QM7wLW8b9a1
1562 { class =
1564 { class =
1563 let
1565 let
1564 longSide =
1566 longSide =
1565 max window.width window.height
1567 max window.width window.height
1568+
1569+ shortSide =
1570+ min window.width window.height
1566 in
1571 in
1567− if longSide <= 600 then
1572+ if shortSide < 600 then
1568 Phone
1573 Phone
1569
1574
1570− else if longSide > 600 && longSide <= 1200 then
1575+ else if longSide <= 1200 then
1571 Tablet
1576 Tablet
1572
1577
1573− else if longSide > 1200 && longSide <= 1800 then
1578+ else if longSide > 1200 && longSide <= 1920 then
1574 Desktop
1579 Desktop
1575
1580
1576 else
1581 else