Skip to content

Commit

Permalink
Update game.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Memelite70 authored Jun 17, 2024
1 parent 58a0f59 commit be9a2d6
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions game.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</head>
<body onload="load()">

<!-- Button to trigger iframe loading -->
<!-- Misc. buttons -->
<center>
<button class="button" onclick='create()'>Open Cloaked</button><button class="button" onclick="openFullscreen();">Full Screen</button></div><script>

Expand All @@ -24,14 +24,15 @@
}
}
</script><script>
//load code (new)
function load(){
var load = document.getElementById("game");
load.src = getUrlParameter('game');
}


function create() {

//cloaker
var win = window.open();
win.document.body.style.margin = '0';
win.document.body.style.height = '100vh';
Expand Down Expand Up @@ -71,15 +72,15 @@
</script></center>

<script>
// Function to get URL parameter value by name
// URL param get
function getUrlParameter(name) {
name = name.replace(/[[]/, '\$$[').replace(/[]$$]/, '\\]');
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
var results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
};

// Function to load iframe with URL parameter value
// Old broken load code
function loadGameIframe() {
var gameParam = getUrlParameter('game');
var iframe = document.getElementById('game');
Expand All @@ -89,11 +90,13 @@
openFullscreen();
};

// Event listener for button click to load iframe
//button code for old loader
document.getElementById('loadIframeBtn').addEventListener('click', loadGameIframe);
</script>
<link rel="stylesheet" href="../style.css">
<!--redirect button style location-->
<style>

#redirect {
position: fixed;
bottom: 10px;
Expand All @@ -103,10 +106,12 @@
<button id="redirect" onclick="goToHomePage()"><h1>GO BACK</h1></button>
<div id="reloadGame"><center><button class="button" onclick="load()">Reload Game</button></center></div>
<script>
//redirect
function goToHomePage() {
window.location.href = '//' + window.location.hostname + "/games.html";
}
</script>
<!--Spacers-->
<p>&nbsp;</p>
<p>&nbsp;</p>

Expand Down

0 comments on commit be9a2d6

Please sign in to comment.