v1.4.7a Add fullscreen support

This commit is contained in:
victor 2020-10-15 12:54:59 +02:00
parent 4a8cd4cc9c
commit 0095a3f887
1 changed files with 26 additions and 1 deletions

View File

@ -18,7 +18,7 @@
} }
</script> </script>
</head> </head>
<body onresize="setMain()" onload="setMain()"> <body onresize="setMain()" onload="setMain(); fullScreen();">
<header class="row align-items-center" id="header" style="position: fixed; top: 0; width: calc(100% - 1.75rem - 1.75rem); background: #00788a; transition: top 0.3s;"> <header class="row align-items-center" id="header" style="position: fixed; top: 0; width: calc(100% - 1.75rem - 1.75rem); background: #00788a; transition: top 0.3s;">
@if(request()->cookie("mode") == "dark") @if(request()->cookie("mode") == "dark")
<img class="w-50" id="sdeLogo" src="{{URL::asset('/images/logos/Logo-hvid.svg')}}" onclick="location.href = '{{ route("root.index") }}';" alt="Syddansk Erhvervsskole"> <img class="w-50" id="sdeLogo" src="{{URL::asset('/images/logos/Logo-hvid.svg')}}" onclick="location.href = '{{ route("root.index") }}';" alt="Syddansk Erhvervsskole">
@ -152,6 +152,31 @@
document.getElementsByTagName("main")[0].style.paddingTop = (10+document.getElementById("header").clientHeight) + "px"; document.getElementsByTagName("main")[0].style.paddingTop = (10+document.getElementById("header").clientHeight) + "px";
//document.getElementById("menu").style.paddingTop = document.getElementById("header").clientHeight + "px"; //document.getElementById("menu").style.paddingTop = document.getElementById("header").clientHeight + "px";
/*
Make the application fullscreen
*/
//Get all html
var elem = document.documentElement;
function fullScreen() {
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.mozRequestFullScreen) { //Support for Firefox browser
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullscreen) { //Support for Safari, Chrome and Opera browser
elem.webkitRequestFullscreen();
} else if (elem.msRequestFullscreen) { //And support for the old ass internet browser IE and Edge
elem.msRequestFullscreen();
}
}
</script> </script>
</body> </body>
</html> </html>