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="container">

  <svg class="clock" viewBox="0 0 20 24" version="1.1">
    <path class="clock__body" d="M10,4 C4.478,4 0,8.477 0,14 C0,19.523 4.478,24 10,24 C15.522,24 20,19.523 20,14 C20,8.477 15.522,4 10,4 Z M10,22 C5.589,22 2,18.411 2,14 C2,9.589 5.589,6 10,6 C14.411,6 18,9.589 18,14 C18,18.411 14.411,22 10,22 Z M8,2.181 L8,8.8817842e-16 L12,8.8817842e-16 L12,2.181 C10.562,1.938 9.408,1.943 8,2.181 Z M17.179,4.407 L18.586,3 L20,4.414 L18.679,5.735 C18.217,5.251 17.715,4.809 17.179,4.407 Z"></path>
    <path class="clock__hand" d="M11,12 L10.312,8 L9.703,8 L9,12 C8.404,12.347 8,12.984 8,13.723 C8,14.827 8.896,15.723 10,15.723 C11.104,15.723 12,14.827 12,13.723 C12,12.984 11.596,12.347 11,12 Z"></path>
  </svg>

</div>
              
            
!

CSS

              
                html {
  width: 100%;
  height: 100%;
  font-family: sans-serif;
}

body {
  height: 200vh;
  margin: 0;
}

.container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 200vh;
}

.clock {
  width: 80px;
  height: 96px;
}
              
            
!

JS

              
                const elem = document.querySelector('.clock')
const hand = SVG.adopt(elem).select('.clock__hand')

const clock = basicScroll.create({
  elem: elem,
  from: 'middle-bottom',
  to: 'middle-top',
  inside: (instance, percentage, props) => hand.rotate(props['--deg'], 10, 14),
  props: {
    '--deg': {
      from: 0,
      to: 360
    }
  }
})

clock.start()
              
            
!
999px

Console