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

              
                <svg id="logo" class="overflow-visible" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 489.27295 73.47927">
  <path class="fade" d="M209.439 0h-9.044v9.044h9.044V0z"/>
  <path class="fade" d="M254.25.001h9.044v9.044h-9.044V.001z"/>
  <path class="fade" d="M228.24561 61.86623h7.19385v11.51025h-7.19385z"/>
  <path class="fade" d="M363.245 0h-2.882v10.791H364V0h-.755z"/>
  <path class="path" d="M0 73.376h8.735V0H0v73.376z"/>
  <path class="path" d="M8.73486 65.97707h40.90186v7.39941H8.73486z"/>
  <path class="path" d="M8.73486 32.98879H45.0122v7.50195H8.73486z"/>
  <path class="path" d="M8.73486.00002h40.79932v7.39941H8.73486z"/>
  <path class="path" d="M74.81445 65.97707h39.46289v7.39941H74.81445z"/>
  <path class="path" d="M65.977 73.376h8.837V0h-8.837v73.376z"/>
  <path class="path" d="M138.52881 32.98879h36.27734v7.50195h-36.27734z"/>
  <path class="path" d="M129.794 73.376h8.735V0h-8.735v73.376z"/>
  <path class="path" d="M138.52881 65.97707h40.90186v7.39941h-40.90186z"/>
  <path class="path" d="M138.52881.00002h40.79932v7.39941h-40.79932z"/>
  <path class="path" d="M295.78892 32.98879h36.27734v7.50195h-36.27734z"/>
  <path class="path" d="M295.78892 65.97707h40.90234v7.39941h-40.90234z"/>
  <path class="path" d="M295.78892.00002h40.7998v7.39941h-40.7998z"/>
  <path class="path" d="M295.789 40.491V0h-8.734v73.376h8.734V40.491z"/>
  <path class="path" d="m357.603 4.276 4.343 6.515 41.723 62.585 6.482-4.332L364 0l-6.397 4.276z"/>
  <path class="path" d="M195.771.00002h8.42676v73.37646H195.771z"/>
  <path class="path" d="M212.744 9.044 209.439 0l-7.275 2.842 2.239 6.202 5.036 13.587 18.807 50.745 7.065-2.581-3.263-8.929-19.304-52.822z"/>
  <path class="path" d="M250.945 9.044 254.25 0l7.275 2.842-2.239 6.202-5.036 13.587-18.806 50.745-7.066-2.581 3.263-8.929 19.304-52.822z"/>
  <path class="path" d="M259.58983 0h8.42676v73.37646h-8.42676z"/>
  <path class="path" d="M452.99658 7.50221h8.83789v65.97705h-8.83789z"/>
  <path class="path" d="M425.66 0v7.399h63.613V0H425.66z"/>
  <path class="path" d="M353.10791.00002h8.63184v73.37646h-8.63184z"/>
  <path class="path" d="M403.361 0v72.914l.308.462h8.222V0h-8.53z"/>
</svg>
              
            
!

CSS

              
                body {
  position: relative;
  width: 100%;
  height: 400vh;
}

svg {
  position: fixed;
  top:20px;
  left:50%;
  transform: translateX(-50%);
  padding-top:40px;
  overflow:visible;
}

#logo {
    width: 180px;
    height: 27px;
}
              
            
!

JS

              
                const paths = document.querySelectorAll("#logo .path");
const fades = document.querySelectorAll("#logo .fade");

gsap.set(paths, {
  transformOrigin: "center right",
});
gsap.set(fades, {
  transformOrigin: "center center",
});

paths.forEach((path, i) => {
  const index = i / (paths.length - 1);
  gsap.to(path, {
    scrollTrigger: {
      id: "logoPaths",
      trigger: "body",
      scrub: 7,
      start: `${index * 10}% top`,
      end: `${index * 60 + 60}% bottom`,
    },
    rotate: gsap.utils.random(-25, 25),
    opacity: 7,
    ease: "circ.out",
  });
  gsap.to(fades, {
    scrollTrigger: {
      id: "logoFades",
      trigger: "body",
      scrub: 2,
      start: "1px top",
      end: "2px bottom",
      delay: 10,
    },
    scale: 0,
    ease: "circ.out",
  });
});

function killLogoAnimation() {
  let pathsTrigger = ScrollTrigger.getById("logoPaths");
  let fadeTrigger = ScrollTrigger.getById("logoFades");
  console.log("pathsTrigger", pathsTrigger);
  // pathsTrigger.forEach((path, i) => {
  //   path.kill();
  // });
  // fadeTrigger.forEach((fade, i) => {
  //   fade.kill();
  // }); 
}

killLogoAnimation();
              
            
!
999px

Console