<div class="extra-content">
  <p>Parallax Scrolling (AOS)</p>
</div>
<div class="section">
  <div class="item" data-aos="example-anim1">1</div>
  <div id="trigger-left" class="item" data-aos="example-anim2">2</div>
  <div class="item" data-aos="example-anim3">3</div>
  <div class="item" data-aos="example-anim1">4</div>
  <div class="item" data-aos="example-anim2">5</div>
  <div class="item" data-aos="example-anim3">6</div>
  <div id="trigger-right" class="item" data-aos="example-anim1">7</div>
  <div class="item" data-aos="example-anim2">8</div>
  <div class="item" data-aos="example-anim3">9</div>

  <div class="item item--secondary"
       data-aos="fade-right"
       data-aos-anchor="#trigger-left"
       data-aos-anchor-placement="top-top">
    LEFT
    <span>when top of <strong>2</strong> hits top of window</span>
  </div>

  <div class="item item--primary"
       data-aos="fade-left"
       data-aos-anchor="#trigger-right"
       data-aos-anchor-placement="top-center">
    RIGHT
    <span>when top of <strong>5</strong> hits center of window</span>
  </div>
</div>
<div class="extra-content">
  <p>Parallax Scrolling</p>
</div>
* {
  box-sizing: border-box;
}

.item {
  width: 200px;
  height: 200px;
  margin: 50px auto;
  padding-top: 75px;
  background: #ccc;
  text-align: center;
  color: #FFF;
  font-size: 3em;
}

/* Animations */

[data-aos="example-anim1"] {
  transform: skewX(45deg);
  opacity: 0;
  transition-property: transform, opacity;
  &.aos-animate {
    transform: skewX(0);
    opacity: 1;
  }
}

[data-aos="example-anim2"] {
  transform: scale(1);
  background: red;
  transition-property: background, transform;
  &.aos-animate {
    transform: scale(2);
    background: green;
  }
}

[data-aos="example-anim3"] {
  transform: rotate(360deg);
  opacity: 0;
  transition-property: transform, opacity;
  &.aos-animate {
    transform: rotate(0);
    opacity: 1;
  }
}

@mixin center-v () {
  position: fixed;
  top: 0;
  bottom: 0;
  margin: auto;
}

.item {
  width: 200px;
  margin: 50px auto;
  max-height: 250px;
  padding: 75px 20px;
  background: #ccc;
  text-align: center;
  color: #FFF;
  font-size: 3em;
  
  span {
    display: block;
    font-size: 1rem;
  }

  &--primary {
    @include center-v;
    right: 20px;
    background: green;
  }
  
  &--secondary {
    @include center-v;
    left: 20px;
    background: red;
  }
}

.extra-content {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh; /* 높이를 충분히 주어 스크롤 생성 */
  background-color: #333;
  padding: 20px;
  box-sizing: border-box;
  font-size: 3rem;
  color: #fff;
}
View Compiled
AOS.init({
  duration: 1200,
  easing: 'ease-in-out-back'
});

External CSS

  1. https://unpkg.com/aos@2.3.0/dist/aos.css

External JavaScript

  1. https://unpkg.com/aos@2.3.0/dist/aos.js