I tried adding the following inside a <script> tag in default.html:
window.addEventListener('orientationchange', function () {
if (window.orientation == -90) {
document.getElementById('orient').className = 'orientright';
}
if (window.orientation == 90) {
document.getElementById('orient').className = 'orientleft';
}
if (window.orientation == 0) {
document.getElementById('orient').className = '';
}
}, true);
and then added <style> tag to the <head>:
.orientleft #shell {
-webkit-transform: rotate(-90deg);
-webkit-transform-origin:160px 160px;
}
.orientright #shell {
-webkit-transform: rotate(90deg);
-webkit-transform-origin:230px 230px;
}
But it didn't seem to work.
Is there anyway to do this?
try this: https://developer.mozilla.org/en-US/docs/Web/API/Screen/lockOrientation
but it’s limited to installed web apps and full screen.
Please login first to submit.