<div class="spacing"></div>
<div class="container">
  <div class="box green"></div>
  <div class="box orange"></div>
  <div class="box grey"></div>
</div>  
<div class="spacing"></div>
.box{
  height:50px;
  width:50px;
  margin:5px;
  border-radius:5px;
  opacity:1
  
}

.green{
  background-color:green
}

.orange{
  background-color:orange
}

.grey{
  background-color:grey
}

.spacing{
  height: 500px
}

.container{
  width:50px;
  margin:0px auto;
  padding: 150px 0px;
 
}
/* Initialize Controller */
const controller = new ScrollMagic.Controller();


/* GSAP Timeline Animation */
const tl = gsap.timeline({defaults: {duration: 0.5}});

tl.from(".green", {opacity: 0, scale: 0.5},)
  .from(".orange", {opacity: 0, scale: 0.5}) 
  .from(".grey", {opacity: 0, scale: 0.5});


/* ScrollMagic Scene */
const scene=new ScrollMagic.Scene({
  triggerElement:'.container',  
  triggerHook: 0  
})  
.setTween(tl) // add gsap animation to scene
.addIndicators()
.addTo(controller) // add scene to controller

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.7/ScrollMagic.js
  2. https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.7/plugins/debug.addIndicators.min.js
  3. https://cdnjs.cloudflare.com/ajax/libs/gsap/3.0.4/gsap.min.js
  4. https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.7/plugins/animation.gsap.min.js