diff --git a/css/style.css b/css/style.css index 75611858..48dde3a5 100644 --- a/css/style.css +++ b/css/style.css @@ -109,7 +109,7 @@ body.noscript { .homepage, .games, .settings -.cloaklaunch { +{ position: absolute; top: 0; left: 0; @@ -121,6 +121,20 @@ body.noscript { 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 { flex-direction: column; top: 2.5%; diff --git a/index.html b/index.html index aec4481b..07ef216a 100644 --- a/index.html +++ b/index.html @@ -71,7 +71,9 @@ MonkeyGG2 Icon +
+

MonkeyGG2

MonkeyGG2 Icon @@ -83,10 +85,9 @@ -

Press Anywhere to cloak

-

(If you want to stop seeing this enable popups)

+

(If you want to stop seeing this enable popups)

diff --git a/js/index.js b/js/index.js index 6307e65a..6294ecd6 100644 --- a/js/index.js +++ b/js/index.js @@ -297,7 +297,7 @@ function refreshPage() { * * @return {void} */ -function makecloak(url = preferences.cloakUrl) { +function makecloak(replaceUrl = preferences.cloakUrl) { if ((window.top.location.href !== "about:blank")) { var url = window.location.href; const win = window.open(); @@ -315,7 +315,7 @@ function makecloak(url = preferences.cloakUrl) { iframe.allow = "fullscreen"; iframe.src = url.toString(); 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; maskIcon.value = preferences.maskIconUrl; -if (preferences.cloak && (window.location.href === window.top.location.href)){ - currentMenu.fadeOut(300, () => { - $(".cloaklaunch").fadeIn(200); - }); - currentMenu = $(".cloaklaunch"); +if (preferences.cloak && (window.location.href == window.top.location.href)){ + if (popupsAllowed()){ + makecloak() + } + else { + currentMenu.fadeOut(300, () => { + $(".cloaklaunch").fadeIn(200); + }); + currentMenu = $(".cloaklaunch"); + document.addEventListener("click", (event) => {event.preventDefault(); makecloak()}); + } } maskCheckbox.addEventListener('change', function () {