cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

            
              <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>
            
          
!
            
              body {
  width: 100%;
  height: 200vh;
}

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

.clock {
  width: 80px;
  height: 96px;
}
            
          
!
            
              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
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console