UNPKG

@cerebral/useragent

Version:
37 lines (30 loc) 599 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = getWindowSpec; function getWindowSpec() { return { orientation: getOrientation(), height: getHeight(), width: getWidth() }; } function getOrientation() { var width = getWidth(); var height = getHeight(); if (height < width) { return 'landscape'; } if (height > width) { return 'portrait'; } return 'square'; } function getWidth() { return window.innerWidth; } function getHeight() { return window.innerHeight; } //# sourceMappingURL=getWindowSpec.js.map