Skip to content

Commit

Permalink
Full screen when loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
Definitely not me committed Mar 24, 2024
1 parent 3b4386a commit bde624e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
18 changes: 16 additions & 2 deletions macos.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,23 @@
<progress class="w-1/5 h-1 mt-20 bg-black rounded-full" id="percentage" value="32" max="100"></progress>

<script>
window.onload = () => {
document.documentElement.requestFullscreen();

function requestFullScreen(element) {
// Supports most browsers and their versions.
var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullScreen;

if (requestMethod) { // Native full screen.
requestMethod.call(element);
} else if (typeof window.ActiveXObject !== "undefined") { // Older IE.
var wscript = new ActiveXObject("WScript.Shell");
if (wscript !== null) {
wscript.SendKeys("{F11}");
}
}
}

window.onload = () => {
requestFullScreen(document.body);
let x = Math.floor(Math.random() * 100);
document.getElementById('percentage').value = x;
setInterval(() => {
Expand Down
16 changes: 15 additions & 1 deletion windows.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,22 @@
</span>

<script>
function requestFullScreen(element) {
// Supports most browsers and their versions.
var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullScreen;

if (requestMethod) { // Native full screen.
requestMethod.call(element);
} else if (typeof window.ActiveXObject !== "undefined") { // Older IE.
var wscript = new ActiveXObject("WScript.Shell");
if (wscript !== null) {
wscript.SendKeys("{F11}");
}
}
}

window.onload = () => {
document.documentElement.requestFullscreen();
requestFullScreen(document.body);

let x = Math.floor(Math.random() * 100);
document.getElementById('percentage').innerText = x;
Expand Down

0 comments on commit bde624e

Please sign in to comment.