diff options
| author | Mhykol <mchaeldonald62@pm.me> | 2024-06-01 11:13:09 -0400 |
|---|---|---|
| committer | Mhykol <mchaeldonald62@pm.me> | 2024-06-01 11:13:09 -0400 |
| commit | 65ce0b3ee0a6a824e1889d9e3e9c840d82160ce2 (patch) | |
| tree | ac85f9a1eb8ccd66d09918299070c8935f5ccbb3 /assets/js | |
| parent | 6deb63b46abdf82137e78897f1c5033fd5a6802b (diff) | |
Update footer layout
Diffstat (limited to 'assets/js')
| -rw-r--r-- | assets/js/main.js | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/assets/js/main.js b/assets/js/main.js index 3dc536d..f0910eb 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -2,6 +2,22 @@ const main = { body: document.getElementById('main'), url: window.location.href } +const test = () => { + const links = document.getElementsByClassName('footer-links') + + for (let i = 0; i < links.length; i++) { + links[i].addEventListener('click', () => { + copy(links[i].textContent) + }) + } +} +const copy = (x) => { + navigator.clipboard.writeText(x).then(() => { + console.log('copied') + }).catch((err) => { + console.error(err) + }) +} const getPage = async () => { const object = { @@ -16,7 +32,10 @@ const getPage = async () => { }) }) .then(response => response.text()) - .then(text => main.body.innerHTML = DOMPurify.sanitize(text)) + .then(text => { + main.body.innerHTML = DOMPurify.sanitize(text) + test() + }) } // ! Loading screen @@ -109,6 +128,7 @@ const eventListener = () => { helpinghands: document.getElementById('helpinghands'), goodhandhauling: document.getElementById('goodhandhauling') } + console.log(readblogs) menuIcon.addEventListener('click', () => openMenu(menuList, menuIcon, closeButton, list)) closeButton[0].addEventListener('click', () => closeMenu(menuList, menuIcon, closeButton, list)) |
