Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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="App gsReveal">
        <h1>Hello CodeSandbox</h1>
        <h2>Start editing to see some magic happen!</h2>
      </div>
      <div class="gsReveal">
        Nullam id dolor id nibh ultricies vehicula ut id elit. Donec sed odio
        dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Nulla
        vitae elit libero, a pharetra augue. Maecenas faucibus mollis interdum.
        Donec ullamcorper nulla non metus auctor fringilla. Donec id elit non mi
        porta gravida at eget metus. Cras mattis consectetur purus sit amet
        fermentum. Cum sociis natoque penatibus et magnis dis parturient montes,
        nascetur ridiculus mus. Praesent commodo cursus magna, vel scelerisque
        nisl consectetur et. Donec id elit non mi porta gravida at eget metus.
        Cras mattis consectetur purus sit amet fermentum. Lorem ipsum dolor sit
        amet, consectetur adipiscing elit. Donec id elit non mi porta gravida at
        eget metus. Morbi leo risus, porta ac consectetur ac, vestibulum at
        eros. Maecenas faucibus mollis interdum. Vestibulum id ligula porta
        felis euismod semper. Vivamus sagittis lacus vel augue laoreet rutrum
        faucibus dolor auctor. Vivamus sagittis lacus vel augue laoreet rutrum
        faucibus dolor auctor. Maecenas faucibus mollis interdum. Donec
        ullamcorper nulla non metus auctor fringilla. Integer posuere erat a
        ante venenatis dapibus posuere velit aliquet.
      </div>
              
            
!

CSS

              
                
              
            
!

JS

              
                const animateFrom = (elem, direction = 1) => {
      let x = 0,
        y = direction * 50;
      if (elem.classList.contains("gsRevealFromLeft")) {
        x = -50;
        y = 0;
      } else if (elem.classList.contains("gsRevalFromRight")) {
        x = 50;
        y = 0;
      }

      gsap.fromTo(
        elem,
        { x, y, autoAlpha: 0 },
        {
          duration: 3,
          x: 0,
          y: 0,
          autoAlpha: 1,
          ease: "expo",
          overwrite: "auto"
        }
      );
    };

    const hide = elem => gsap.set(elem, { autoAlpha: 0 });
    gsap.utils.toArray(".gsReveal").forEach(elem => {
      hide(elem);
      ScrollTrigger.create({
        trigger: elem,
        onEnter: () => animateFrom(elem),
        onEnterBack: () => animateFrom(elem, -1),
        onLeave: () => hide(elem)
      });
    });
              
            
!
999px

Console