summaryrefslogtreecommitdiffstats
path: root/themes/danix-xyz-hacker/assets/js/article-lazy.js
diff options
context:
space:
mode:
Diffstat (limited to 'themes/danix-xyz-hacker/assets/js/article-lazy.js')
-rw-r--r--themes/danix-xyz-hacker/assets/js/article-lazy.js34
1 files changed, 0 insertions, 34 deletions
diff --git a/themes/danix-xyz-hacker/assets/js/article-lazy.js b/themes/danix-xyz-hacker/assets/js/article-lazy.js
deleted file mode 100644
index 64ca862..0000000
--- a/themes/danix-xyz-hacker/assets/js/article-lazy.js
+++ /dev/null
@@ -1,34 +0,0 @@
-document.addEventListener('DOMContentLoaded', function () {
- var timeline = document.querySelector('ol.timeline');
- if (!timeline) return;
-
- // Progressive enhancement: activates CSS hidden state
- timeline.classList.add('js-lazy-timeline');
-
- var items = Array.prototype.slice.call(
- timeline.querySelectorAll('.timeline-item')
- );
-
- function reveal(item) {
- item.classList.add('is-visible');
- }
-
- var observer = new IntersectionObserver(
- function (entries) {
- entries.forEach(function (entry) {
- if (entry.isIntersecting) {
- reveal(entry.target);
- observer.unobserve(entry.target);
- }
- });
- },
- {
- rootMargin: '-80px 0px 0px 0px',
- threshold: 0.12,
- }
- );
-
- items.forEach(function (item) {
- observer.observe(item);
- });
-});