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

              
                <div class="vh-100 flex justify-center items-center">
  <svg class="db w-100 mw7"
    viewBox="0 0 400 222"
    fill="none">
    <rect width="400"
      height="222"
      fill="white" />
    <path d="M0 26L45.5 0L91 26L45.5 52L0 26Z"
      transform="translate(293 156)"
      fill="white" />
    <path d="M0 26L45.5 0L91 26L45.5 52L0 26Z"
      transform="translate(293 156)"
      stroke="#00011F"
      stroke-width="2"
      stroke-linejoin="round" />
    <path d="M0 26L45.5 0L91 26L45.5 52L0 26Z"
      transform="translate(293 148)"
      fill="white" />
    <path d="M0 26L45.5 0L91 26L45.5 52L0 26Z"
      transform="translate(293 148)"
      stroke="#00011F"
      stroke-width="2"
      stroke-linejoin="round" />
    <path d="M45.5 26V34L0 8V0L45.5 26Z"
      transform="translate(293 174)"
      fill="white" />
    <path d="M45.5 34V26L0 0V8L45.5 34Z"
      transform="translate(293 174)"
      stroke="#00011F"
      stroke-width="2"
      stroke-linecap="square"
      stroke-linejoin="round" />
    <path d="M0 26V34L45.5 8V0L0 26Z"
      transform="translate(338.5 174)"
      fill="#00011F" />
    <path d="M0 34V26L45.5 0V8L0 34Z"
      transform="translate(338.5 174)"
      stroke="#00011F"
      stroke-width="2"
      stroke-linejoin="round" />
    <ellipse cx="20"
      cy="14.1421"
      rx="20"
      ry="14.1421"
      transform="translate(318.5 160)"
      stroke="#00011F"
      stroke-width="2" />
    <mask id="mask0"
      mask-type="alpha"
      maskUnits="userSpaceOnUse"
      x="318"
      y="160"
      width="41"
      height="29">
      <ellipse cx="20"
        cy="14.1421"
        rx="20"
        ry="14.1421"
        transform="translate(318.5 160)"
        fill="white" />
    </mask>
    <g mask="url(#mask0)">
      <ellipse cx="20"
        cy="14.1421"
        rx="20"
        ry="14.1421"
        transform="translate(318.5 172)"
        fill="#00011F" />
    </g>
    <path d="M0 96V0L96 96H0Z"
      transform="translate(16 92)"
      fill="#473BE7" />
    <path d="M0 0V96H96L0 0Z"
      transform="translate(16 92)"
      stroke="#473BE7"
      stroke-width="2"
      stroke-linejoin="round" />
    <path id="speed"
      d="M96 8 C 89 8 87.5 0 80 0 C 73 0 71 8 64 8 C 57 8 55 0 48 0 C 41 0 39 8 32 8 C 25 8 23 0 16 0 C 9 0 7 8 0 8"
      transform="translate(251 172) rotate(-180)"
      stroke-dashoffset="110.20603942871094px"
      stroke-dasharray="110.20603942871094"
      stroke="#00011F"
      stroke-width="2"
      stroke-linecap="round"
      stroke-linejoin="round" />
    <!-- d="M0 8C7 8 9 0 16 0C23 0 25 8 32 8C39 8 41 0 48 0C55 0 57 8 64 8C71 8 73 0 80 0C87.5 0 89 8 96 8" -->
    <path id="speed-reverse"
      d="M96 8 C 89 8 87.5 0 80 0 C 73 0 71 8 64 8 C 57 8 55 0 48 0 C 41 0 39 8 32 8 C 25 8 23 0 16 0 C 9 0 7 8 0 8"
      transform="translate(251 172) rotate(-180)"
      stroke-dashoffset="110.20603942871094px"
      stroke-dasharray="110.20603942871094"
      stroke="#fff"
      stroke-width="3"
      stroke-linecap="round"
      stroke-linejoin="round" />
    <!-- -93 -87 transform="translate(108 147)" -->
    <g id="ball"
      transform="translate(209.5 0)">
      <circle cx="20"
        cy="20"
        r="20"
        transform="translate(109 148)"
        fill="white"
        stroke="#00011F"
        stroke-width="2" />
      <path transform="translate(117 157)"
        fill="#00011F"
        d="M0 26.9911C3.37048 29.5776 7.5882 31.115 12.165 31.115C23.2108 31.115 32.165 22.1607 32.165 11.115C32.165 7.00189 30.9235 3.17877 28.7946 0C26.5829 14.4384 14.7213 25.6989 0 26.9911Z"
      />
    </g>
    <mask id="mask1"
      mask-type="alpha"
      maskUnits="userSpaceOnUse"
      x="292"
      y="112"
      width="100"
      height="77">
      <path transform="translate(292 112.5)"
        fill="#00011F"
        d="M46.5 75.7843C57.5457 75.7843 66.5 69.4526 66.5 61.6421H100V0H0V61.6421H26.5C26.5 69.4526 35.4543 75.7843 46.5 75.7843Z"
      />
    </mask>
    <g mask="url(#mask1)"
      id="hole-ball">
      <path id="hole-ball-fill"
        transform="translate(318.5 148)"
        fill="white"
        d="M40 20C40 31.0457 31.0457 40 20 40C8.9543 40 0 31.0457 0 20C0 8.9543 8.9543 0 20 0C31.0457 0 40 8.9543 40 20Z"
      />
      <path id="hole-ball-shadow"
        fill-rule="evenodd"
        clip-rule="evenodd"
        transform="translate(317.5 147)"
        fill="#00011F"
        d="M2 21C2 10.5066 10.5066 2 21 2C28.0696 2 34.2375 5.86116 37.5097 11.5897C34.7996 24.7784 23.9749 35.0064 10.4829 36.8262C5.36939 33.4213 2 27.6041 2 21ZM21 0C9.40202 0 0 9.40202 0 21C0 32.598 9.40202 42 21 42C32.598 42 42 32.598 42 21C42 9.40202 32.598 0 21 0Z"
      />
    </g>
  </svg>

</div>
              
            
!

CSS

              
                
              
            
!

JS

              
                const myTimeline = anime.timeline({
  loop: true,
  // autoplay: false,
});

myTimeline
  .add({
    targets: '#ball',
    translateX: [
      { value: -93, duration: 1 },
      { value: -93 },
      { value: -6 },
      { value: 209.5, easing: 'easeOutExpo', duration: 800 },
    ],
    translateY: [
      { value: -190, duration: 1 },
      { value: -87 },
      { value: 0 },
      { value: 0, easing: 'easeOutExpo', duration: 800 },
    ],
    easing: 'easeInCubic',
  })
  .add({
    targets: '#speed',
    strokeDashoffset: [anime.setDashoffset, 0],
    easing: 'linear',
    duration: 100,
    offset: '-=765',
  })
  .add({
    targets: '#speed-reverse',
    strokeDashoffset: [anime.setDashoffset, 0],
    easing: 'linear',
    duration: 300,
    offset: '-=200',
  })
  .add({
    targets: '#ball',
    translateX: -93,
    translateY: -190,
    duration: 1,
  })
  .add({
    targets: '#ball',
    translateX: -93,
    translateY: -190,
    duration: 1,
  })
  .add({
    targets: '#hole-ball',
    opacity: [0, 1],
    duration: 1,
  })
  .add({
    targets: '#hole-ball-fill',
    translateX: [318.5, 318.5],
    translateY: [148, 148 + 64],
    easing: 'easeInCubic',
    duration: 800,
  })
  .add({
    offset: '-=800',
    targets: '#hole-ball-shadow',
    translateX: [317.5, 317.5],
    translateY: [147, 147 + 64],
    easing: 'easeInCubic',
    duration: 800,
  });

              
            
!
999px

Console