slighlty less broken version

This commit is contained in:
BluePotato102
2023-09-24 12:19:16 -05:00
parent aa7a98cc10
commit 2205f5ae09
3 changed files with 31 additions and 10 deletions
+15 -1
View File
@@ -109,7 +109,7 @@ body.noscript {
.homepage, .homepage,
.games, .games,
.settings .settings
.cloaklaunch { {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
@@ -121,6 +121,20 @@ body.noscript {
z-index: 10; z-index: 10;
} }
.cloaklaunch {
color: var(--font-color);
text-align: center;
font-size: 200%;
padding: 30vh 0;
position: absolute;
width: 100vw;
height: 100vh;
background-color: var(--games-color);
border: 50px, solid, var(--bg);
cursor: pointer;
}
.games { .games {
flex-direction: column; flex-direction: column;
top: 2.5%; top: 2.5%;
+3 -2
View File
@@ -71,7 +71,9 @@
<img src="imgs/icon-256-256.png" alt="MonkeyGG2 Icon"> <img src="imgs/icon-256-256.png" alt="MonkeyGG2 Icon">
</div> </div>
</div> </div>
<section id="everything-else"> <section id="everything-else">
<h1 id="title">MonkeyGG2</h1> <h1 id="title">MonkeyGG2</h1>
<logo> <logo>
<img src="imgs/icon-256-256.png" alt="MonkeyGG2 Icon"> <img src="imgs/icon-256-256.png" alt="MonkeyGG2 Icon">
@@ -83,10 +85,9 @@
</div> </div>
</dialog> </dialog>
<div class="cloaklaunch"> <div class="cloaklaunch">
<h1>Press Anywhere to cloak</h1> <h1>Press Anywhere to cloak</h1>
<h4>(If you want to stop seeing this enable popups)</h4> <h3>(If you want to stop seeing this enable popups)</h3>
</div> </div>
<div class="homepage"> <div class="homepage">
+13 -7
View File
@@ -297,7 +297,7 @@ function refreshPage() {
* *
* @return {void} * @return {void}
*/ */
function makecloak(url = preferences.cloakUrl) { function makecloak(replaceUrl = preferences.cloakUrl) {
if ((window.top.location.href !== "about:blank")) { if ((window.top.location.href !== "about:blank")) {
var url = window.location.href; var url = window.location.href;
const win = window.open(); const win = window.open();
@@ -315,7 +315,7 @@ function makecloak(url = preferences.cloakUrl) {
iframe.allow = "fullscreen"; iframe.allow = "fullscreen";
iframe.src = url.toString(); iframe.src = url.toString();
win.document.body.appendChild(iframe); win.document.body.appendChild(iframe);
window.location.replace(url); window.location.replace(replaceUrl)
} }
} }
} }
@@ -367,11 +367,17 @@ maskCheckbox.checked = preferences.mask;
maskTitle.value = preferences.maskTitle; maskTitle.value = preferences.maskTitle;
maskIcon.value = preferences.maskIconUrl; maskIcon.value = preferences.maskIconUrl;
if (preferences.cloak && (window.location.href === window.top.location.href)){ if (preferences.cloak && (window.location.href == window.top.location.href)){
currentMenu.fadeOut(300, () => { if (popupsAllowed()){
$(".cloaklaunch").fadeIn(200); makecloak()
}); }
currentMenu = $(".cloaklaunch"); else {
currentMenu.fadeOut(300, () => {
$(".cloaklaunch").fadeIn(200);
});
currentMenu = $(".cloaklaunch");
document.addEventListener("click", (event) => {event.preventDefault(); makecloak()});
}
} }
maskCheckbox.addEventListener('change', function () { maskCheckbox.addEventListener('change', function () {