const sectionOne = document.querySelector(".section1")

const options = {
  root: null,  // the view port
  threshold: 0.5, // default 0 -  a percent e.g 0.25 = 25% . how much of the element needs to be in view before the IntersectionObserver is triggered.
  rootMargin: '0px' // The margin of the viewport. increasing this make the viewport more narrow. works like css eg. '10px 10px' .
};

const observer = new IntersectionObserver((entries, observer)=>{
  entries.forEach((entry)=>{
    console.log('entry: ', entry.target)
    entry.target.classList.toggle('outline')
  })
}, options)

observer.observe(sectionOne)