diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-01-07 23:01:11 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-01-07 23:01:11 +0100 |
| commit | 4777c058469847cbe02eb2a24634b21ee37384fc (patch) | |
| tree | 3fd87861241a75f59819bc0771eb3e97bd88e2f6 /docs/js/site.js | |
| parent | d317978119fc0936d9c342edf47e55be230cd215 (diff) | |
move docs
Diffstat (limited to 'docs/js/site.js')
| -rw-r--r-- | docs/js/site.js | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/docs/js/site.js b/docs/js/site.js deleted file mode 100644 index 37b9d77..0000000 --- a/docs/js/site.js +++ /dev/null @@ -1,59 +0,0 @@ -const site = (function(){ - let section - let links = toArray(document.querySelectorAll('.menu a')) - let time = new Date() - let hour = time.getHours() - if (hour < 8 || hour > 16) { - document.body.parentNode.classList.add('night') - } else { - document.body.parentNode.classList.add('day') - } - preload('img/pause-inv.png') - setTimeout(() => { - document.body.classList.remove('loading') - navigateHash(window.location.hash) - const email = atob("eGVuYXZlY3RyYTkwOUBnbWFpbC5jb20=") - const twitter = atob("dmVjdHJheGVuYQ==") - document.querySelector("#email_addr").href = 'mailto:' + email - document.querySelector("#email_addr").innerHTML = email - document.querySelector("#twitter_addr").innerHTML = twitter - document.querySelector("#twitter_addr").href = 'https://twitter.com/' + twitter - }, 0) - toArray(document.querySelectorAll('.menu a')).forEach(a => { - a.addEventListener("click", e => { - e.preventDefault() - sounds.play('click') - console.log(e.target) - if (e.target.nodeName.toLowerCase() !== 'a') { - navigateHash(e.target.parentNode.href) - } else { - navigateHash(e.target.href) - } - }) - }) - function navigateHash(url){ - if (is_mobile) { - player.hidePlaylist() - } - let new_section = (url || "").split('#')[1] - if (section) { - document.body.classList.remove(section) - links.forEach(link => link.classList.remove('active')) - } - if (new_section && new_section !== section) { - document.body.classList.add(new_section) - links.forEach(link => link.getAttribute('href').match(new_section) && link.classList.add('active')) - section = new_section - } else { - section = null - } - // window.location.hash = section || "" - } - function preload(src) { - const img = new Image - img.src = src - } - return { - navigateHash: navigateHash - } -})() |
