Skip to content
Snippets Groups Projects
Commit 0d364b19 authored by Vishwaa Kannan's avatar Vishwaa Kannan
Browse files

disappear homepage pics

parent cd34ec49
No related branches found
No related tags found
No related merge requests found
Pipeline #404523 passed
......@@ -25,18 +25,23 @@ document.addEventListener('DOMContentLoaded', function () {
function checkScroll() {
const triggerBottom = window.innerHeight * 0.8;
const triggerTop = window.innerHeight * 0.2;
imageBoxes.forEach((box, index) => {
const boxTop = box.getBoundingClientRect().top;
if (boxTop < triggerBottom) {
if (boxTop < triggerBottom && boxTop > triggerTop) {
setTimeout(() => {
box.classList.add('show');
}, index * 200); // Delay each image by 200ms
} else {
box.classList.remove('show');
}
});
}
window.addEventListener('scroll', checkScroll);
checkScroll(); // Check on load
});
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment