first deployment of kikomiko with url photos
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
8d98304137
commit
ae3ed7c7b7
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
export function initReveals() {
|
||||
const nodes = document.querySelectorAll(".reveal");
|
||||
if (!nodes.length) return;
|
||||
|
||||
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
||||
nodes.forEach((el) => el.classList.add("is-revealed"));
|
||||
return;
|
||||
}
|
||||
|
||||
const io = new IntersectionObserver(
|
||||
(entries) => {
|
||||
for (const entry of entries) {
|
||||
if (!entry.isIntersecting) continue;
|
||||
entry.target.classList.add("is-revealed");
|
||||
io.unobserve(entry.target);
|
||||
}
|
||||
},
|
||||
{ rootMargin: "-80px", threshold: 0.01 }
|
||||
);
|
||||
|
||||
nodes.forEach((el) => io.observe(el));
|
||||
}
|
||||
Reference in New Issue
Block a user