This commit is contained in:
𓍼 2025-05-25 14:24:32 -05:00
parent c568949e74
commit 1fb3876cd4
3 changed files with 50 additions and 2 deletions

View File

@ -32,6 +32,10 @@
display: inline-block;
}
.toast i {
margin-right: 8px;
}
.toast.show {
animation: slideIn 0.3s forwards;
}

View File

@ -28,7 +28,6 @@ function submitName() {
updateGreeting(name);
document.getElementById('namePrompt').classList.add('fade-out');
showToast(`Hey, ${name}! Welcome to Waves!`, 'success', 'wave');
const path = window.location.pathname;
setTimeout(() => {
document.getElementById('namePrompt').style.display = 'none';

View File

@ -35,7 +35,7 @@ document.addEventListener('DOMContentLoaded', function () {
</div>
<div id="cloak-content" class="tab-content">
<label for="aboutblank-toggle">About:Blank</label>
<label for="aboutblank-toggle">Auto About:Blank</label>
<p>Turn this on to go into about:blank every time the page loads (Recommended).</p>
<input type="checkbox" id="aboutblank-toggle">
</div>
@ -114,6 +114,51 @@ document.addEventListener('DOMContentLoaded', function () {
}
}
function runScriptIfChecked() {
let inFrame;
try {
inFrame = window !== top;
} catch (e) {
inFrame = true;
}
const aboutBlankChecked = JSON.parse(localStorage.getItem("aboutBlankChecked")) || false;
if (!aboutBlankChecked || inFrame) {
return;
}
const defaultTitle = "Google.";
const defaultIcon = "https://www.google.com/favicon.ico";
const title = localStorage.getItem("siteTitle") || defaultTitle;
const icon = localStorage.getItem("faviconURL") || defaultIcon;
const iframeSrc = "/";
const popup = window.open("", "_blank");
if (!popup || popup.closed) {
alert("Failed to load automask. Please allow popups and try again.");
return;
}
popup.document.head.innerHTML = `
<title>${title}</title>
<link rel="icon" href="${icon}">
`;
popup.document.body.innerHTML = `
<iframe style="height: 100%; width: 100%; border: none; position: fixed; top: 0; right: 0; left: 0; bottom: 0;" src="${iframeSrc}"></iframe>
`;
window.location.replace("https://bisd.schoology.com/home");
}
document.getElementById("aboutblank-toggle").addEventListener("change", function() {
localStorage.setItem("aboutBlankChecked", JSON.stringify(this.checked));
if (this.checked) {
showToast('success', 'Auto About:Blank is now enabled.');
} else {
showToast('error', 'Auto About:Blank is now disabled.');
}
runScriptIfChecked();
});
window.addEventListener("load", function() {
const aboutBlankChecked = JSON.parse(localStorage.getItem("aboutBlankChecked")) || false;
document.getElementById("aboutblank-toggle").checked = aboutBlankChecked;
runScriptIfChecked();
});
function updateWispServerUrl(url) {
if (isValidUrl(url)) {
currentWispUrl = url;