title: Move element on each scroll
body: <p>I'm trying to move the "main" tagname by 100 viewport height upwards or downwards according to the wheel delta value to make the section inside the window change. And also a way to stop or start executing a code when specified, but I'm unable to figure out what the function should be to execute it properly.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>window.addEventListener("wheel", event =&gt; {
  
    const delta = Math.sign(event.deltaY);
    //console.info(delta);
  
    if (delta &gt; 0) {
      nextSection();
    } else if (delta &lt; 0) {
      previousSection();
    }
  
    let main = document.querySelector("main");
    var mainTop = main.style.top
  
    function nextSection() {
      console.log("next-section");
  
  
      let sections = document.querySelectorAll("section");
  
      let mainTop = "0";
  
      function countP() {
        mainTop += 100;
        main.style.top = mainTop;
      }
  
    }
  
    function previousSection() {
      console.log("previous-section");
    }
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>html,
  body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    user-select: none;
  }
  
  main {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
  }
  
  main&gt;section {
    position: absolute;
    right: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
  }
  
  #first-section {
    top: 0;
    background-color: black;
  }
  
  #myVideo {
    position: fixed;
    right: 0;
    bottom: 0;
    min-width: 100%;
    min-height: 100%;
  }
  
  #services {
    top: 100vh;
    background-color: transparent;
  }
  
  #about-us {
    top: 200vh;
    background-color: yellow;
  }
  
  #ecommerce {
    top: 300vh;
    background-color: darkcyan;
  }
  
  #testimonials {
    top: 400vh;
    background-color: deeppink;
  }
  
  #footer {
    position: absolute;
    top: 33vh;
    right: 0;
    left: 0;
    width: 100%;
    height: 67vh;
    background-color: black;
    z-index: -1;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  
  &lt;html lang="english"&gt;
  
  &lt;head&gt;
    &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;main&gt;
      &lt;section id="first-section"&gt;&lt;/section&gt;
      &lt;section id="services"&gt;&lt;/section&gt;
      &lt;section id="about-us"&gt;&lt;/section&gt;
      &lt;section id="ecommerce"&gt;&lt;/section&gt;
      &lt;section id="testimonials"&gt;&lt;/section&gt;
    &lt;/main&gt;
    &lt;footer id="footer"&gt;&lt;/footer&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>