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 width="258" height="200" viewBox="0 0 258 200" fill="none" xmlns="http://www.w3.org/2000/svg">
  <path d="M249 176C249 158.72 249 137.718 249 122.617C249 111.571 240.046 102.619 229 102.619L29.0001 102.619C17.9546 102.619 9.00035 93.6799 9.00023 82.6344C9.00011 71.8166 9.00001 56.7891 9.00001 38" stroke="url(#paint0_linear_226_182)" stroke-width="18" />
  <path d="M249 199.5C249 179.503 249 144.606 249 122.604C249 111.558 240.045 102.619 229 102.619L29.0001 102.619C17.9544 102.619 9.00006 93.6875 9.00005 82.6418C9.00004 61.3077 9.00001 26.9922 9.00001 0.500031" stroke="black" stroke-opacity="0" id="path" />
  <defs>
    <linearGradient id="paint0_linear_226_182" x1="-49.0505" y1="187.56" x2="-49.0505" y2="35.11" gradientUnits="userSpaceOnUse">
      <stop stop-color="#FF9000" stop-opacity="0" />
      <stop offset="1" stop-color="#FF9000" />
    </linearGradient>
  </defs>
</svg>
              
            
!

CSS

              
                html {
  display: grid;
  place-items: center;
  height: 100vh;
}

              
            
!

JS

              
                const animation = document.querySelector("svg");

const lerp = (x, y, a) => x * (1 - a) + y * a;

function createTrail(noTrailParts = 5) {
  const trailParts = [];
  // create trail ============
  for (var i = 0; i < noTrailParts; i++) {
    var trail = document.createElementNS(
      "http://www.w3.org/2000/svg",
      "circle"
    );
    trail.setAttribute("r", 3);
    trail.setAttribute("fill", "white");
    trail.setAttribute("cx", 0);
    trail.setAttribute("cy", 0);
    trail.setAttribute(
      "opacity",
      lerp(0.2, 1, (noTrailParts - i) / noTrailParts)
    );
    trail.classList.add("data-pulse");
    animation.appendChild(trail);
    trailParts.push(trail);
  }

  return trailParts;
}

const trailOne = createTrail();
const trailTwo = createTrail();
const trailThree = createTrail();

gsap.registerPlugin(MotionPathPlugin);

const tl = gsap.timeline({
  repeat: -1
});

tl.to(trailOne, {
  duration: 4,
  repeat: -1,
  stagger: 0.15,
  ease: "linear",
  motionPath: {
    path: "#path",
    align: "#path",
    autoRotate: true,
    alignOrigin: [0.5, 0.5]
  }
});

tl.to(
  trailTwo,
  {
    duration: 4,
    repeat: -1,
    stagger: 0.15,
    ease: "linear",
    motionPath: {
      path: "#path",
      align: "#path",
      autoRotate: true,
      alignOrigin: [0.5, 0.5]
    }
  },
  "-=2.5"
);

              
            
!
999px

Console