Skip to content

Commit

Permalink
Update search.html
Browse files Browse the repository at this point in the history
  • Loading branch information
MyBooty165 authored Oct 17, 2024
1 parent 93db9df commit abb2759
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions search.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@
<script src="/scripts/inject/header.js"></script>
<div class="spacet-index"></div>
<div id="main-area">
<div id="garea">
<iframe id="gframe">Game Failed To Load</iframe>
<div id="gcontrols">
<p class="gtxt">ALT+M to hide/show this</p>
<button id="returnbtn" onclick="closegme()" title="Return To Games"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path fill="#ffffff" d="M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"/></svg></button>
<button id="fullbtn" onclick="fullscreen()" title="Fullscreen"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path fill="#ffffff" d="M32 32C14.3 32 0 46.3 0 64l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zM64 352c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-96 0zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-96z"/></svg></button>
<button id="refbtn" onclick="document.getElementById('gframe').src = document.getElementById('gframe').src;" title="Refresh Game"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path fill="#ffffff" d="M105.1 202.6c7.7-21.8 20.2-42.3 37.8-59.8c62.5-62.5 163.8-62.5 226.3 0L386.3 160 352 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l111.5 0c0 0 0 0 0 0l.4 0c17.7 0 32-14.3 32-32l0-112c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 35.2L414.4 97.6c-87.5-87.5-229.3-87.5-316.8 0C73.2 122 55.6 150.7 44.8 181.4c-5.9 16.7 2.9 34.9 19.5 40.8s34.9-2.9 40.8-19.5zM39 289.3c-5 1.5-9.8 4.2-13.7 8.2c-4 4-6.7 8.8-8.1 14c-.3 1.2-.6 2.5-.8 3.8c-.3 1.7-.4 3.4-.4 5.1L16 432c0 17.7 14.3 32 32 32s32-14.3 32-32l0-35.1 17.6 17.5c0 0 0 0 0 0c87.5 87.4 229.3 87.4 316.7 0c24.4-24.4 42.1-53.1 52.9-83.8c5.9-16.7-2.9-34.9-19.5-40.8s-34.9 2.9-40.8 19.5c-7.7 21.8-20.2 42.3-37.8 59.8c-62.5 62.5-163.8 62.5-226.3 0l-.1-.1L125.6 352l34.4 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L48.4 288c-1.6 0-3.2 .1-4.8 .3s-3.1 .5-4.6 1z"/></svg></button>
</div>
</div>
<div id="particles-js"></div>
<div id="space-particles"></div>
<form action="search.html" method="get" id="search-space">
Expand Down Expand Up @@ -103,6 +112,66 @@
showresults(query);
}
});

gamebtn.addEventListener('click', () => {
const gameframe = document.getElementById('gframe');
const gcontrols = document.getElementById('gcontrols');
const garea = document.getElementById("garea");

document.getElementById('main-area').style.display = 'none';
document.querySelector('header').style.display = 'none';
document.querySelector('footer').style.display = 'none';

garea.style.display = 'block';

gameframe.style.display = 'block';
gcontrols.style.display = 'flex';
document.body.style.overflow = 'none';

gameframe.src = game.source;
gameframe.setAttribute('allow', 'autoplay; fullscreen; gamepad; keyboard; clipboard-write; allow-same-origin');
gameframe.contentWindow.focus();

gameframe.onload = () => {
ifrev(gameframe);
};
});
});

globalev();

function shortcut() {
const gcontrols = document.getElementById('gcontrols');
if (gcontrols.style.display === 'none' || gcontrols.style.display === '') {
gcontrols.style.display = 'flex';
} else {
gcontrols.style.display = 'none';
}
}

function globalev() {
document.addEventListener('keydown', (e) => {
if ((e.altKey || e.metaKey) && e.key.toLowerCase() === 'm') {
e.preventDefault();
shortcut();
}
});
}

function ifrev(iframe) {
const ifrdoc = iframe.contentDocument || iframe.contentWindow.document;

ifrdoc.addEventListener('keydown', (e) => {
if (e.altKey && e.key.toLowerCase() === 'm') {
e.preventDefault();
shortcut();
}
});
}
} catch (error) {
console.error('Err:', error);
}
}
</script>
</body>
</html>

0 comments on commit abb2759

Please sign in to comment.