Save theme color across pages

This commit is contained in:
Hamza Nasher-Alneam 2025-05-05 18:15:42 -04:00
parent 9c0a834c71
commit ebb8568ca1
8 changed files with 46 additions and 85 deletions

24
scripts/copypopup.js Normal file
View file

@ -0,0 +1,24 @@
let url = document.location.href;
function copy(txt) {
let link = `${url}#${txt}`;
navigator.clipboard.writeText(link).then(() => {
console.log("Copied link!");
}, () => { console.log("Error copying link."); });
let alert = document.createElement("DIV");
alert.textContent = "Copied Link to Heading!";
alert.classList.add("tempAlert");
document.body.appendChild(alert);
setTimeout(() => {
alert.style.opacity = "1";
alert.style.bottom = ".5rem";
}, 200);
setTimeout(() => {
alert.style.opacity = "0";
alert.style.bottom = "-10rem";
}, 4200);
setTimeout(() => {
alert.remove();
}, 4400);
}