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 | |
| parent | 6deb63b46abdf82137e78897f1c5033fd5a6802b (diff) | |
Update footer layout
| -rw-r--r-- | assets/js/main.js | 22 | ||||
| -rw-r--r-- | source/readfile.js | 16 |
2 files changed, 30 insertions, 8 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)) diff --git a/source/readfile.js b/source/readfile.js index 77faad1..744d871 100644 --- a/source/readfile.js +++ b/source/readfile.js @@ -39,11 +39,14 @@ class ReadFile { `, footer: ` <section id='footer'> - <nav> - <a href='/'>Home</a> - <a href='/about'>About</a> - <a href='/contact'></a> - </nav> + <div class='copied'> + <p>Copied to clipboard</p> + </div> + <div class='links'> + <p>Email <a href='mailto:mchaeldonald62@pm.me'>mchaeldonald62@pm.me</a></p> + <p>Monero <span class='footer-links'>89dARfwUGJNByHeir8bpCM4YJS2cTz58DNvu9fad1bpg7bfZs2H1QwtJpFghhJJatzRo8rnrE8AH5CAXbQHUpTp5FujsU1h</span></p> + <p>Bitcoin <span class='footer-links'>bc1qplmr9wx7ahcna5zmwlhhl5zcgs8n5nuxp74apw</span></p> + </div> </section> ` } @@ -66,7 +69,7 @@ class ReadFile { <link rel='stylesheet' href='/css/main.css'/> <meta name='description' content='${x.description}'> <meta name='keywords' content='${x.keywords}'> - <meta name="viewport" content="width=device-width, initial-scale=1"> + <meta name='viewport' content='width=device-width, initial-scale=1'> </head> <body> <section id='main'> @@ -107,7 +110,6 @@ class ReadFile { } catch(err) { try { return await x.then(output => { - console.log(output) return this.#SetData({data: output, mime: this.object.types}) }) } catch (err) { |
