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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


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


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.


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.

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.


                <div id="clock">
  <div id="hours"></div>
  <div id="minutes"></div>
  <div id="seconds"></div>

<h1>Pure CSS Animated Clock</h1>



                $color: #B0DAB9; 
$color-bg: lighten($color, 15);
$size: 225px;

@import url(;

html {
  width: 100%;
  height: 100%;
  padding: 5% 0; 
  background: linear-gradient($color-bg, #FFF);

h1 {
  margin: 0;
  font: 3em 'Pacifico', cursive;
  text-align: center;
  text-shadow: 0 2px 0 #fff;
  color: $color;

#clock {
  box-sizing: border-box;
  width: $size;
  height: $size;
  border: 35px solid $color;;
  border-radius: 50%;
  margin: 0 auto;
  transform: rotate(-90deg);
  &:after {
    content: "";
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    background: black;
    border: 12px solid $color;
    border-radius: 50%;
    transform: translate(-50%,-50%);

#hours, #minutes, #seconds{
  position: absolute;
  top: 0; 
  right: 0; 
  bottom: 0;
  left: 0;
  &:after, &:after, &:after {
    content: "";
    display: block;
    margin: 50% 50%;
    width: 50%;
    transform-origin: left top;
    animation: clock linear infinite;

#hours:after {
  width: 30%;
  outline: 8px solid $color;
  animation-duration: 86400s;

#minutes:after {
  width: 40%;
  outline: 4px solid $color;
  animation-duration: 3600s;

#seconds:after {
  width: 48%;
  outline: 2px solid $color;
  animation-duration: 60s;

@keyframes clock {
  0% {
    transform: rotate(0deg);
  100% {
    transform: rotate(360deg);


 * (almost) Pure Animated CSS Clock
 * Need standard CSS?
 * Click the Eye icon at the top right
 * corner of the CSS panel in order to 
 * copy/paste the compiled CSS.
 * Jay S.

/* Javacript to set the time once */

set('hours',   30 * new Date().getHours());
set('minutes',  6 * new Date().getMinutes());
set('seconds', 10 * new Date().getSeconds());

function set(id, deg) {
  var el = document.getElementById(id),
      rotation = 'rotate(' + deg + 'deg)'; = rotation; = rotation;