20 lines
524 B
JavaScript
20 lines
524 B
JavaScript
// bonzi homepage - minimal, no framework
|
|
(() => {
|
|
'use strict';
|
|
|
|
const blocks = document.querySelectorAll('[data-reveal]');
|
|
if ('IntersectionObserver' in window) {
|
|
const io = new IntersectionObserver((entries) => {
|
|
entries.forEach((e) => {
|
|
if (e.isIntersecting) {
|
|
e.target.classList.add('in');
|
|
io.unobserve(e.target);
|
|
}
|
|
});
|
|
}, { threshold: 0.1 });
|
|
blocks.forEach((b) => io.observe(b));
|
|
} else {
|
|
blocks.forEach((b) => b.classList.add('in'));
|
|
}
|
|
})();
|