function _checkPosHiddenEls() {
  for (let elem of hiddenEls) {
    const posY = elem.getBoundingClientRect().top;
    if (posY - windowHeight <= 0)
      // Then element is on screen!
      elem.className = elem.className.replace("hidden", "fade-in");
    console.log(elem.className);
  }
}
// Reveal hidden elements when come into view
Reveal hidden elements when come into view
Reveal hidden elements when come into view
function _checkPosHiddenEls() {
  for (let elem of hiddenEls) {
    const posY = elem.getBoundingClientRect().top;
    if (posY - windowHeight <= 0)
      elem.className = elem.className.replace("hidden", "fade-in");
    console.log(elem.className);
  }
}
function _checkPosHiddenEls ( ) { for ( let elem of hiddenEls ) { const posY = elem . getBoundingClientRect ( ) . top ; if ( posY - windowHeight <= 0 ) elem . className = elem . className . replace ( "hidden" , "fade-in" ) ; console . log ( elem . className ) ; } }
Reveal hidden elements when come into view
Reveal hidden elements when come into view
// Then element is on screen!