diff --git a/web/src/app/js/app.js b/web/src/app/js/app.js index f093aae..2c56e26 100644 --- a/web/src/app/js/app.js +++ b/web/src/app/js/app.js @@ -245,6 +245,21 @@ app.post = { }, } +app.fullscreen = { + enable: function() { + const el = document.querySelector('main'); + el.classList.add('absolute-top'); + el.classList.add('width-max'); + document.querySelector('header').style.display = 'none'; + }, + disable: function() { + const el = document.querySelector('main'); + el.classList.remove('absolute-top'); + el.classList.remove('width-max'); + document.querySelector('header').removeAttribute('style'); + }, +} + app.media = { view: function(url) { if (url.match(/^.*\.(jpg|jpeg|png|ico|webp)$/)) @@ -484,6 +499,7 @@ window.onhashchange = function(e) { args = []; app.overlay.hideAll(); + app.fullscreen.disable(); for (var i = 0; i < app.hashHandlers.length; i++) { const cfg = app.hashHandlers[i]; if (cfg.exact !== undefined && diff --git a/web/src/app/js/pages/quiz.js b/web/src/app/js/pages/quiz.js index 4d80eee..88ae5da 100644 --- a/web/src/app/js/pages/quiz.js +++ b/web/src/app/js/pages/quiz.js @@ -13,6 +13,7 @@ app.pages.quiz = { } } + app.fullscreen.enable(); const container = document.getElementById('app-container'); container.innerHTML = '';