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

              
                <?xml version="1.0" encoding="UTF-8"?>
<svg id="uuid-445226e4-1846-4666-9378-7636779dcd3d" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="1949.02632" height="2529.81784" viewBox="0 0 1949.02632 2529.81784">
  <path class="theLine" d="M1769.56726 10.18207 0 1141.54447 1393.46688 1886.86567 1254.09974 2495.881 1402.92848 2529.81784 1565.28939 1812.40925 296.98474 1127.66474 1949.02632 78.91108 1769.56726 10.18207z" style="fill: #00ea5e;"/>
  <path id="motionPath" d="M1921.02562 0 162.07226 1127.66474 1493.37849 1858.22858 1332.69697 2513.80322" style="fill: none;"/>
</svg>

  <img id="plane" src="https://user-images.githubusercontent.com/87159455/163745167-189d83b3-8744-422c-a694-f4b1bf3632bd.png" width="100px" height="120px" />
              
            
!

CSS

              
                body {
  background-color:#001911;
  color: white;
}

svg {
  width: 100%
}
              
            
!

JS

              
                var animation;

gsap.registerPlugin(MotionPathPlugin,DrawSVGPlugin, ScrollTrigger);


animation = gsap.timeline({defaults: {duration: 1},
  scrollTrigger: {
    trigger: "#motionPath",
    start: "top top",
    end: 'bottom bottom',
    endTrigger: "svg",
    scrub: true,
    markers: true,
    onUpdate: self => {
      gsap.to("#plane", {rotation: () => self.direction === 1 ? 0 : -180, overwrite: 'auto'});
    }
  }})
.from(".theLine", {drawSVG:0}, 0)
  .to("#plane", {
    duration: 10,
    ease: "none",
    immediateRender: true,
    motionPath: {
      path: "#motionPath",
      align: "#motionPath",
      alignOrigin: [0.5, 0.5],
    }
  })


              
            
!
999px

Console