fix(docs): make bullet throb repeat on every scroll into view
Remove unobserve so bullets reset when scrolled out and throb again on re-entry. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -236,15 +236,17 @@
|
|||||||
var observer = new IntersectionObserver(
|
var observer = new IntersectionObserver(
|
||||||
function (entries) {
|
function (entries) {
|
||||||
entries.forEach(function (entry) {
|
entries.forEach(function (entry) {
|
||||||
|
var li = entry.target;
|
||||||
if (entry.isIntersecting) {
|
if (entry.isIntersecting) {
|
||||||
/* stagger each bullet by its index within the list */
|
/* stagger each bullet by its index within the list */
|
||||||
var li = entry.target;
|
|
||||||
var siblings = Array.from(li.parentElement.children);
|
var siblings = Array.from(li.parentElement.children);
|
||||||
var idx = siblings.indexOf(li);
|
var idx = siblings.indexOf(li);
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
li.classList.add('in-view');
|
li.classList.add('in-view');
|
||||||
}, idx * 120);
|
}, idx * 120);
|
||||||
observer.unobserve(li);
|
} else {
|
||||||
|
/* reset when scrolled out so it throbs again on re-entry */
|
||||||
|
li.classList.remove('in-view');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user