Dodaj klasę, gdy element w Viewport Vanilla JavaScript
window.addEventListener('scroll', function (event) {
if (isInViewport(theElementToWatch)) {
// update the element display
}
}, false);
code fighter