mobile style hacks

This commit is contained in:
Ginger Wong
2020-06-14 21:14:42 -07:00
parent 1b2b7248fc
commit c16cd50dbb
4 changed files with 33 additions and 14 deletions

View File

@@ -25,7 +25,12 @@ function setupApp() {
})
// style hackings
window.VIDEOJS_NO_DYNAMIC_STYLE = true;
mobileVHhack();
// init messaging interactions
var appMessagingMisc = new Messaging();
appMessagingMisc.init();

View File

@@ -36,4 +36,14 @@ function uuidv4() {
const r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
function setVHvar() {
let vh = window.innerHeight * 0.01;
// Then we set the value in the --vh custom property to the root of the document
document.documentElement.style.setProperty('--vh', `${vh}px`);
}
function mobileVHhack() {
setVHvar();
window.addEventListener("orientationchange", setVHvar);
}