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

              
                <body style="height:1000px">
  
  <div class="paper" >
        <img src="https://thumb.tildacdn.com/tild3861-3531-4265-b338-386363646265/-/resize/198x/-/format/webp/_2_.png" alt="" class="img-paper">

        <svg  width="100%" height="100%" viewBox="0 0 582 153" fill="none" xmlns="http://www.w3.org/2000/svg" style="opacity: 1">
            <path class="path" d="M464 136C464 99.9306 439.557 65.3384 396.049 39.8335C352.54 14.3285 293.53 2.72317e-06 232 0C170.47 -2.72317e-06 111.46 14.3285 67.9512 39.8335C24.4428 65.3384 9.29081e-06 99.9305 0 136L6.39922 136C6.39922 100.925 30.1678 67.2875 72.4762 42.486C114.785 17.6846 172.167 3.75126 232 3.75127C291.833 3.75127 349.216 17.6846 391.524 42.486C433.832 67.2875 457.601 100.925 457.601 136H464Z" fill="#C4C4C4"/>
        </svg>
        <img src="https://thumb.tildacdn.com/tild3336-3134-4537-b966-373832316338/-/resize/239x/-/format/webp/_0.png" class="conus" alt="" width="239" height="464">
    </div>
</body>

              
            
!

CSS

              
                .paper {
  /*transform: rotate3d(0, 100, 0, 180deg);*/
  margin: 70rem 0 0;
  position: relative;
}
.img-paper {
  width: 200px;
  display: block;
  margin: 0 0 auto auto;
}


.path {
  stroke: red;
  stroke-width: 2px;
}
              
            
!

JS

              
                let requestId = null;
const t1 = gsap
  .timeline({ paused: true })
  .set(".img-paper", { x: -100, y: -50, autoAlpha: 1 })
  .set(".conus", { x: 0, y: -50, autoAlpha: 1 })
  .to(".img-paper", {
    motionPath: {
      path: ".path",
      align: ".path",
      curviness: 1.5,
      alignOrigin: [0.5, 1],
      autoRotate: 90,
      start: 0.1,
      end: 0.9
    },
    duration: 0.5
  });

const startY = 200;
const finishDistance = window.innerHeight * 1.5;
document.addEventListener("scroll", function () {
  if (!requestId) {
    requestId = requestAnimationFrame(update);
  }
});

function update() {
  t1.progress((scrollY - startY) / finishDistance);
  requestId = null;
}
update();

              
            
!
999px

Console