diff options
Merge branch 'master' into 'blog/black-hole-shader'
# Conflicts:
# src/blog/index.md
1 files changed, 0 insertions, 24 deletions
| -rw-r--r-- | src/scripts/image-show.js | 24 |
diff --git a/src/scripts/image-show.js b/src/scripts/image-show.js deleted file mode 100644 index 8664ef4..0000000 --- a/src/scripts/image-show.js +++ /dev/null @@ -1,24 +0,0 @@ -let scrollPosition = 0; - -function clickToView() { - if (scrollPosition === 0) { - scrollPosition = window.scrollY; - window.scrollTo(0, 0); - } - - this.classList.toggle('clicked-image'); - document.body.classList.toggle('body-on-clicked-image'); - - if (!this.classList.contains('clicked-image')) { - window.scrollTo(0, scrollPosition); - scrollPosition = 0; - } -} - -const images = document.getElementsByTagName('img'); - -for (const image of images) { - if (image.alt !== '🔗' && !image.classList.contains('unzoomable')) { - image.onclick = clickToView; - } -} |