diff --git a/guestbook.html b/guestbook.html index ef37869..dfff6a4 100644 --- a/guestbook.html +++ b/guestbook.html @@ -1,6 +1,5 @@ - @@ -51,6 +50,7 @@
+ diff --git a/index.html b/index.html index 90fc62c..f5f58a6 100644 --- a/index.html +++ b/index.html @@ -12,9 +12,7 @@ Hamza Nasher-Alneam -
-
-
+


@@ -64,63 +62,18 @@

Change the website color theme

+
-

- - - +

-

+ + diff --git a/scripts/copypopup.js b/scripts/copypopup.js new file mode 100644 index 0000000..56f408a --- /dev/null +++ b/scripts/copypopup.js @@ -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); + +} \ No newline at end of file diff --git a/scripts/main.js b/scripts/main.js index ffbbb8d..17dbcee 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -1,5 +1,3 @@ -console.log("hello"); - window.addEventListener("scroll", () => { document.body.style.setProperty("--scroll", window.pageYOffset / (document.body.offsetHeight - window.innerHeight)); }, false); @@ -20,8 +18,6 @@ function changeThemeHex() { } } -function setThemeColor(color) { - document.documentElement.style.setProperty("--theme-color", color); - let metaThemeColor = document.querySelector("meta[name=theme-color]"); - metaThemeColor.setAttribute("content", color); +function resetTheme() { + setThemeColor("#f69b46"); } \ No newline at end of file diff --git a/scripts/script.js b/scripts/script.js new file mode 100644 index 0000000..6007680 --- /dev/null +++ b/scripts/script.js @@ -0,0 +1,11 @@ +// theme color +let themeColor = localStorage.getItem("theme-color"); +if (!themeColor) themeColor = "#f69b46"; +setThemeColor(themeColor); + +function setThemeColor(color) { + document.documentElement.style.setProperty("--theme-color", color); + let metaThemeColor = document.querySelector("meta[name=theme-color]"); + metaThemeColor.setAttribute("content", color); + localStorage.setItem("theme-color", color); +} diff --git a/styles/styles.css b/styles/styles.css index c6b0acd..a18f894 100644 --- a/styles/styles.css +++ b/styles/styles.css @@ -84,7 +84,7 @@ a { .menu { position: fixed; top: 0; - left: .2rem; + left: .3rem; bottom: 0; width: 10rem; display: flex; diff --git a/thoughts.html b/thoughts.html index 26fafc9..c752b01 100644 --- a/thoughts.html +++ b/thoughts.html @@ -40,31 +40,7 @@
- + + \ No newline at end of file