Animated brands section

This commit is contained in:
Ferit Yiğit BALABAN
2022-07-03 22:33:27 +03:00
parent 427f2f6f53
commit e0113c1b61
5 changed files with 152 additions and 10 deletions

View File

@@ -0,0 +1,15 @@
const observer = new IntersectionObserver(entries => {
entries.forEach(entry => {
if (entry.isIntersecting) {
if (entry.target.classList.contains('reverse'))
entry.target.classList.add('table-item-animation-reverse');
else
entry.target.classList.add('table-item-animation');
}
});
});
let targets = document.querySelectorAll('.table-item');
targets.forEach(target => {
observer.observe(target);
})