JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ScrollTrigger/1.0.6/ScrollTrigger.min.js"></script>
<section>
  <div id="layer1" class="parallax-item">
  </div>
  <div id="layer2" class="parallax-item">
  </div>
  <div id="layer3" class="parallax-item">
  </div>
</section>

CSS

html {
  scroll-behavior: smooth;
}

.parallax-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 150vh;
}


      #layer1 {
        background: url('https://images.unsplash.com/photo-1663305411753-4c305e177ff3?crop=entropy&cs=tinysrgb&fm=jpg&ixid=MnwzMjM4NDZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2NjM5NDA4ODE&ixlib=rb-1.2.1&q=80')
          no-repeat center center fixed;
        background-size: cover;
      }

      #layer2 {
        background: url('https://images.unsplash.com/photo-1663183539627-adbe2c8ef43d?crop=entropy&cs=tinysrgb&fm=jpg&ixid=MnwzMjM4NDZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2NjM5Mzk5ODc&ixlib=rb-1.2.1&q=80')
          no-repeat center center fixed;
        background-size: cover;
      }

      #layer3 {
        background: url('https://images.unsplash.com/photo-1506748686214-e9df14d4d9d0?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80')
          no-repeat center center fixed;
        background-size: cover;
      }

JavaScript

gsap.registerPlugin(ScrollTrigger);

let tl = gsap.timeline({
  scrollTrigger: {
    trigger: "section",
    start: "top top",
    end: "bottom top",
    scrub: true,
  }
});

tl.to("#layer1", {
  backgroundPositionY: "5%", 
  ease: "none"
}, 0) 

.to("#layer2", {
  backgroundPositionY: "90%", 
  ease: "none"
}, 0) 

.to("#layer3", {
  backgroundPositionY: "40%", 
  ease: "none"
}, 0);