Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="marginator margin-top-0 marginator-background-bright-white">
  <div id="animation1" class="module module--text module--text-with-image has-animation">
    <div class="module--split has-image--square head-left align">
      <div class="module__top background-bright-white">
        <div class="container">
          <div class="row split-row">
            <div class="col-12 col-lg-6 module__left-container">
              <div class="module__left">
                <div class="module__image module__image--mobile">
                  <div class="image image--square">
                    <img src="https://via.placeholder.com/2133x1200" alt="">
                  </div>
                </div>
                <div class="module__title">
                  <h4 class="module__subhead animated">Lorem ipsum dolor sit amet</h4>
                  <h1 class="module__heading">Lorem ipsum</h1>
                </div>
              </div>
            </div>
            <div class="col-12 col-lg-6 module__right-container">
              <div class="module__right">
                <div class="module__image-container">
                  <div class="module__image module__image--desktop">
                    <div class="image image--square">
                      <img src="https://via.placeholder.com/2133x1200" alt="">
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>

      <div class="module__bottom background-bright-white" style="min-height: 400px">
        <div class="container">
          <div class="row">
            <div class="col-12 col-lg-6 module__left-container">
              <div class="module__left has-animation">
                <h1 class="animated">hello there im animated</h1>
                <div class="module__body p animated">
                  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent commodo, ante ut mattis semper,
                  velit lectus convallis leo, sed viverra est libero eu dui. Fusce sit amet enim pharetra, porta augue
                  id, fringilla augue. Fusce in laoreet ligula, sed elementum nisl. In et tortor cursus, accumsan lorem
                  euismod, laoreet purus. Praesent eu egestas libero. Proin sit amet elementum odio. Duis sit amet
                  mauris venenatis, semper dolor quis, finibus mauris. Nullam id turpis vitae magna finibus accumsan.
                  Nam purus justo, laoreet dignissim ultrices sed, dapibus sed augue. Phasellus rhoncus sollicitudin
                  convallis. Nam feugiat tellus sed nisi fringilla, quis varius augue placerat.
                </div>

                <div class="module__links">
                  <div class=""><a class="button-primary"> <span class="button-primary__label">
                        Call to action
                      </span>
                    </a></div>
                  <div class=""><a class="button-secondary"> <span class="button-secondary__label">
                        Call to action
                      </span>
                    </a></div>
                </div>

                <div class="module__image module__image--mobile">
                  <div class="image image--square">
                    <img
                      src="/-/media/rebrand-imagery/ab-abstract-technology-wave-min.jpg?la=en&amp;hash=37FBB940B7E2E2B59A52340512DA2D25B1E18EC9"
                      alt="">
                  </div>
                </div>

              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<div class="marginator margin-top-0 marginator-background-bright-white">
  <section id="animation2" class="module has-animation module--text module--text-with-image">
    <div class="module--split has-image--landscape head-left align">
      <div class="module__top background-bright-white">
        <div class="container">
          <div class="row split-row">
            <div class="col-12 col-lg-6 module__left-container">
              <div class="module__left">
                <div class="module__image module__image--mobile">
                  <div class="image image--landscape">
                    <img src="https://via.placeholder.com/2133x1200" alt="">
                  </div>
                </div>

                <div class="module__title has-animation">
                  <h4 class="module__subhead animated">Lorem ipsum dolor sit amet</h4>
                  <h1 class="module__heading">Lorem ipsum</h1>
                  <h1 class="animated">hello there im animated</h1>
                </div>
              </div>
            </div>
            <div class="col-12 col-lg-6 module__right-container">
              <div class="module__right">
                <div class="module__image-container">
                  <div class="module__image module__image--desktop">
                    <div class="image image--landscape">
                      <img src="https://via.placeholder.com/2133x1200" alt="">
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>

      <div class="module__bottom background-bright-white" style="min-height: 400px">
        <div class="container">
          <div class="row">
            <div class="col-12 col-lg-6 module__left-container has-animation">
              <div class="module__left">
                <div class="module__body p animated">
                  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent commodo, ante ut mattis semper,
                  velit lectus convallis leo, sed viverra est libero eu dui. Fusce sit amet enim pharetra, porta augue
                  id, fringilla augue. Fusce in laoreet ligula, sed elementum nisl. In et tortor cursus, accumsan lorem
                  euismod, laoreet purus. Praesent eu egestas libero. Proin sit amet elementum odio. Duis sit amet
                  mauris venenatis, semper dolor quis, finibus mauris. Nullam id turpis vitae magna finibus accumsan.
                  Nam purus justo, laoreet dignissim ultrices sed, dapibus sed augue. Phasellus rhoncus sollicitudin
                  convallis. Nam feugiat tellus sed nisi fringilla, quis varius augue placerat.
                </div>

                <div class="module__links">
                  <div class=""><a class="button-primary"> <span class="button-primary__label">
                        Call to action
                      </span>
                    </a>
                  </div>
                </div>
                <div class="module__image module__image--mobile">
                  <div class="image image--landscape">
                    <img
                      src="/-/media/rebrand-imagery/ab-abstract-technology-wave-min.jpg?la=en&amp;hash=37FBB940B7E2E2B59A52340512DA2D25B1E18EC9"
                      alt="">
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>
</div>


<div class="marginator margin-top-0 marginator-background-true-blue">
  <div id="animation3" class="module has-animation module--text module--text-with-image">
    <div class="module--split has-image--square head-left align">
      <div class="module__top background-true-blue">
        <div class="container">
          <div class="row split-row">
            <div class="col-12 col-lg-6 module__left-container">
              <div class="module__left">
                <div class="module__image module__image--mobile">
                  <div class="image image--square">
                    <img src="https://via.placeholder.com/2133x1200" alt="">
                  </div>
                </div>

                <div class="module__title">
                  <h4 class="module__subhead animated">Lorem ipsum dolor sit amet</h4>
                  <h1 class="module__heading">Lorem ipsum</h1>
                </div>
              </div>
            </div>
            <div class="col-12 col-lg-6 module__right-container">
              <div class="module__right">
                <div class="module__image-container">
                  <div class="module__image module__image--desktop">
                    <div class="image image--square">
                      <img src="https://via.placeholder.com/2133x1200" alt="">
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>

      <div class="module__bottom background-bright-white" style="min-height: 400px">
        <div class="container">
          <div class="row">
            <div class="col-12 col-lg-6 module__left-container">
              <div class="module__left">
                <div class="module__body p">
                  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent commodo, ante ut mattis semper,
                  velit lectus convallis leo, sed viverra est libero eu dui. Fusce sit amet enim pharetra, porta augue
                  id, fringilla augue. Fusce in laoreet ligula, sed elementum nisl. In et tortor cursus, accumsan lorem
                  euismod, laoreet purus. Praesent eu egestas libero. Proin sit amet elementum odio. Duis sit amet
                  mauris venenatis, semper dolor quis, finibus mauris. Nullam id turpis vitae magna finibus accumsan.
                  Nam purus justo, laoreet dignissim ultrices sed, dapibus sed augue. Phasellus rhoncus sollicitudin
                  convallis. Nam feugiat tellus sed nisi fringilla, quis varius augue placerat.
                </div>
                <div class="module__links">
                  <div class=""><a class="button-secondary"> <span class="button-secondary__label">
                        Call to action
                      </span>
                    </a>
                  </div>
                </div>
                <div class="module__image module__image--mobile">
                  <div class="image image--square">
                    <img
                      src="https://via.placeholder.com/2133x1200"
                      alt="">
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<div class="marginator margin-top-0 marginator-background-bright-white">
  <div id="animation4" class="module has-animation module--text module--text-with-image">
    <div class="module--split has-image--square head-right align">
      <div class="module__top background-bright-white">
        <div class="container">
          <div class="row split-row">
            <div class="col-12 col-lg-6 module__left-container">
              <div class="module__left">
                <div class="module__image module__image--mobile">
                  <div class="image image--square">
                    <img
                      src="https://via.placeholder.com/2133x1200"
                      alt="">
                  </div>
                </div>

                <div class="module__title">
                  <h4 class="module__subhead animated has-animation">Lorem ipsum dolor sit amet</h4>
                  <h1 class="module__heading">Lorem ipsum</h1>
                </div>
              </div>
            </div>
            <div class="col-12 col-lg-6 module__right-container">
              <div class="module__right">
                <div class="module__image-container">
                  <div class="module__image module__image--desktop">
                    <div class="image image--square">
                      <img
                        src="https://via.placeholder.com/2133x1200"
                        alt="">
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>

      <div class="module__bottom background-electric-blue" style="min-height: 400px">
        <div class="container">
          <div class="row">
            <div class="col-12 col-lg-6 module__left-container">
              <div class="module__left">
                <div class="module__body p">
                  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent commodo, ante ut mattis semper,
                  velit lectus convallis leo, sed viverra est libero eu dui. Fusce sit amet enim pharetra, porta augue
                  id, fringilla augue. Fusce in laoreet ligula, sed elementum nisl. In et tortor cursus, accumsan lorem
                  euismod, laoreet purus. Praesent eu egestas libero. Proin sit amet elementum odio. Duis sit amet
                  mauris venenatis, semper dolor quis, finibus mauris. Nullam id turpis vitae magna finibus accumsan.
                  Nam purus justo, laoreet dignissim ultrices sed, dapibus sed augue. Phasellus rhoncus sollicitudin
                  convallis. Nam feugiat tellus sed nisi fringilla, quis varius augue placerat.
                </div>

                <div class="module__links">
                  <div class=""><a class="button-tertiary"> <span class="button-tertiary__label">
                        Call to actionsz
                      </span>
                    </a>
                  </div>
                </div>
                <div class="module__image module__image--mobile">
                  <div class="image image--square">
                    <img
                      src="https://via.placeholder.com/2133x1200"
                      alt="">
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                body {
  background: #f3f3f3;
}

.animation-container {
  overflow: hidden !important;
  // background: red;
}

.animated {
  opacity: 0;
}
  .animation-container > div {
    overflow: hidden;
    height: 2rem;
  }

  .animation-container > div > div {
    overflow: hidden;
  }

              
            
!

JS

              
                const animationWrappers = document.querySelectorAll(".has-animation");

if (animationWrappers.length) {
  // Registering plugins
  gsap.registerPlugin(ScrollTrigger);
  gsap.registerPlugin(SplitText);

  let timelines = [];

  animationWrappers.forEach((element) => {
    if (element.id) {
      const tl = gsap.timeline({
        scrollTrigger: {
          // toggle places: onEnter, onLeave, onEnterBack, onLeaveBack
          // actions: "play", "pause", "resume", "reset", "restart", "complete", "reverse", and "none"
          // EXAMPLE: "play pause resume reset" will play the animation when entering, pause it when leaving, resume it when entering again backwards, and reset (rewind back to the beginning) when scrolling all the way back past the beginning.
          toggleActions: "restart none none reverse",
          trigger: `#${element.id}`,
          start: "top 85%",
          markers: true
        }
      });
      const mySplitText = new SplitText(`#${element.id} .animated`, {
        type: "words,chars,lines"
      });
      const chars = mySplitText.words; //an array of all the divs that wrap each character
      tl.to(`#${element.id} .animated`, 0, { className:"+=animation-container",opacity: 1, overflow: 'hidden' }).staggerFrom(
        chars,
        1,
        {
          opacity:1,
          // className:"+=animation-container",
          y: 100,
          rotationY: 10,
          rotationX: 10,
          transformOrigin: "0% 50%",
          ease: "power2.easeOut"
        },
        0.01,
      );
      timelines[element.id] = tl;
    }
  });
}

              
            
!
999px

Console