<div class="spacer">Just a spacer</div>
<div class="wrapper">
<div class="parent">
<div class="child"></div>
</div>
</div>

<div class="wrapper">
<div class="parent">
<div class="child"></div>
</div>
</div>

<div class="wrapper">
<div class="parent">
<div class="child"></div>
</div>
</div>

<div class="wrapper">
<div class="parent">
<div class="child"></div>
</div>
</div>

<div class="spacer end">Just a spacer</div>


body {
  font-family: "Roboto", sans-serif;
  font-weight: 700;
  padding: 0;
  margin: 0;
}

.spacer {
  background-color: #cd58eb;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2em;
}


.wrapper {
  width: 300px;
  height: 300px;
  position: relative;
  margin: 60px auto;
}

.parent,
.child {
  position: absolute;
  border-radius: 8px;
}

.parent {
  width: 100%;
  height: 100%;
  background: black;
}

.child {
  width: 200px;
  height: 100px;
  background: #42a6e0;
  right: -50px;
  bottom: -20px;
}
var controller = new ScrollMagic.Controller();

$(".wrapper").each(function() {
  var tl = new TimelineMax();
  var child = $(this).find(".child");
  tl.to(child, 1, { y: -180, ease: Linear.easeNone });

  var scene = new ScrollMagic.Scene({
    triggerElement: this,
    triggerHook: 0.4,
    duration: "100%"
  })
    .setTween(tl)
    .addIndicators({
      colorTrigger: "black",
      colorStart: "black",
      colorEnd: "black",
      indent: 10
    })
    .addTo(controller);
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TweenMax.min.js
  2. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js
  3. https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.7/ScrollMagic.min.js
  4. https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.7/plugins/animation.gsap.js
  5. https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.7/plugins/debug.addIndicators.min.js