@cerebral/useragent
Version:
Adds useragent specs to your cerebral state model
37 lines (30 loc) • 599 B
JavaScript
;
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