Skip to content

Instantly share code, notes, and snippets.

View jansgescheit's full-sized avatar
✌️

Jan jansgescheit

✌️
  • Herodikos GmbH
  • Oldenburg / Bremen - Germany / Earth
  • 13:40 (UTC +01:00)
View GitHub Profile
@jansgescheit
jansgescheit / iphonex-safe-area-dev-tool-helper.js
Last active July 30, 2019 14:43
Ionic 4 - iPhoneX Safe Area Helper
iPhoneX();
['resize','orientationchange'].forEach(function(evt) {
window.addEventListener(evt,iPhoneX,{passive:true});
});
function iPhoneX() {
const portrait = window.innerWidth === 375 && window.innerHeight === 812;
const landscape = window.innerWidth === 812 && window.innerHeight === 375;
if (document.getElementById('iphone_layout')) {
document.body.style.setProperty('--ion-safe-area-left', '');