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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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="video-container">
 <video id="videobg" autoplay loop muted>
   <source src="https://res.cloudinary.com/demifo4s4/video/upload/v1606362408/clouds_edbu8e.mp4"
          type="video/mp4" />
 </video>
</div>

<div class="svg-container">
 <img id="paperplane" src="https://res.cloudinary.com/demifo4s4/image/upload/v1607483034/plane_175_hxi74q.png" alt="">
 <svg viewBox="0 0 1059 4020" fill="none" xmlns="http://www.w3.org/2000/svg" id="svg-path">
  <path id="planepath"
            d="M27.9999 15C162 -4.33332 459.6 -9.39999 578 125C696.4 259.4 568 280.758 512 257C432 223.061 352.068 137.656 608 125C790 116 938 238 938 349C938 460 894 555 666 655C438 755 117.712 743.896 124.984 940C129.009 1048.56 239.703 1172.76 430 1170C604 1167.48 518 1017 362 1017C206 1017 19.9999 1135 17.9999 1271C15.9999 1407 258 1509 382 1551C506 1593 686 1641 720 1741C748.999 1826.29 714 1929 632 2005C550 2081 382 2059 382 1987C382 1915 486 1903 564 1903C642 1903 944 1913 956 2153C968 2393 674 2441 528 2469C382 2497 248 2587 248 2695C248 2803 314 2959 444 2959C528 2959 582 2917 582 2883C582 2849 522 2793 406 2797C290 2801 85.9998 2807 15.9998 3031C-54.0002 3255 222 3319 314 3343C406 3367 502 3369 582 3401C662 3433 724 3511 724 3635C724 3719.02 630 3869 544 3869C458 3869 406 3807 406 3775C406 3743 460 3695 526 3743C592 3791 630 3911 724 3963C814.413 4013.02 954 4029 1058 4005"
            stroke="black" stroke-width="5" stroke-dasharray="20 20" />
 </svg>
</div>
              
            
!

CSS

              
                html, body {
  padding:0;
  margin:0;
}

#paperplane {
  max-width: 20vw;
}

.svg-container {
  padding-left: 10%;
  padding-right: 10%;
  padding-top: 10%;
}

#planepath {
  overflow: visible;
  height: 100%;
  max-width: 100%;
}

#planepath path {
stroke-width: 5;
}

#planepath #paperplane {
  visibility: hidden;
}

/* bg video responsiveness */
.video-container {
  position: fixed;
  top: 0;
  z-index: -1;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.video-container video {
  width: auto;
  height: auto;
  min-width: 100%;
  min-height: 100%;
}

@media (min-aspect-ratio: 16/9) {
    #videobg {
        width:100%;
        height: auto;
    }
}

@media (max-aspect-ratio: 16/9) {
    #videobg {
        width:auto;
        height: 100%;
    }
}

.dummy-height {
  height: 500vh;
}

              
            
!

JS

              
                var animation;

gsap.registerPlugin(MotionPathPlugin, ScrollTrigger);

gsap.set("#paperplane", {autoAlpha: 1});

animation = gsap.to("#paperplane", {
  scrollTrigger: {
    trigger: "#planepath",
    start: "top 30%",
    end: "bottom 90%",
    scrub: true,
    markers: true,
  },
  duration: 40,
  ease: "none",
  immediateRender: true,
  motionPath: {
    path: "#planepath",
    align: "#planepath",
    alignOrigin: [0.5, 0.5],
    autoRotate: true,
  }
});
              
            
!
999px

Console