Skip to content

Commit

Permalink
Merge pull request #26 from ClippedALT/main
Browse files Browse the repository at this point in the history
  • Loading branch information
silvereengames authored May 28, 2024
2 parents bf15cf7 + e246481 commit 6763a5b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 6 deletions.
33 changes: 29 additions & 4 deletions public/assets/js/cloak.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ function setTitle(title) {
document.title = title;
localStorage.setItem('moonlight.title', title);
}

}

function setIcon(icon) {
Expand All @@ -40,11 +39,37 @@ function setIcon(icon) {
document.getElementById('icon').href = icon;
localStorage.setItem('moonlight.icon', icon);
}

}

document.addEventListener("keydown", (e) => {
if (e.key == localStorage.getItem('moonlight.panicKey')) {
window.open(localStorage.getItem('moonlight.panicSite'), '_self')
window.open(localStorage.getItem('moonlight.panicSite'), '_self')
}
});
});

let isLeavePopupEnabled = JSON.parse(localStorage.getItem('leavePopupEnabled'));

if (isLeavePopupEnabled === null) {
isLeavePopupEnabled = false;
}

function handleBeforeUnload(e) {
if (isLeavePopupEnabled) {
e.preventDefault();
e.returnValue = '';
}
}

window.addEventListener('beforeunload', handleBeforeUnload);

function enableLeavePopup() {
isLeavePopupEnabled = true;
localStorage.setItem('leavePopupEnabled', JSON.stringify(isLeavePopupEnabled));
alert('Leave Site Popup Enabled');
}

function disableLeavePopup() {
isLeavePopupEnabled = false;
localStorage.setItem('leavePopupEnabled', JSON.stringify(isLeavePopupEnabled));
alert('Leave Site Popup Disabled');
}
12 changes: 10 additions & 2 deletions public/settings/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,16 @@ <h2 class="center">Customization</h2>
</div>

<div class="settings-container">
<h2 class="center">About blank</h2>
<h2 class="center">About:Blank</h2>
<p class="center">
<button style="background-color: #1a1a1a;" onclick='openAboutBlank()'>Open in about:blank</button>
</p>

<h2 class="center">Anti-Closing</h2>
<p class="center">
<button onclick="disableLeavePopup()" class="proxy-button" id="leave-popup-off">Disable</button>
<button onclick="enableLeavePopup()" class="proxy-button" id="leave-popup-on">Enable</button>
</p>
</div>

<div class="settings-container">
Expand Down Expand Up @@ -183,13 +189,15 @@ <h3 class="sticky">Backend Developers</h3>
<p>.xnc_</p>
<p>alive_hamster</p>
<p>ghostlyy</p>
<p>Clipped</p>
<p>skysthelimit.dev</p>
<p>3kh0</p>
</div>
<div>
<h3 class="sticky">Graphic Design</h3>
<p>Silvereen</p>
<p>.xlucid_</p>
<p>Clipped</p>
</div>
<div>
<h3 class="sticky">Bot Developers</h3>
Expand Down Expand Up @@ -300,4 +308,4 @@ <h3 class="sticky">Code Stuff</h3>
</script>
</body>

</html>
</html>

0 comments on commit 6763a5b

Please sign in to comment.