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

              
                <section class="demo-container watch-container">
  <article class="watch">
    <div class="bg-image"></div>
    <div class="screen">
      <header>
        <span class="title">Activity</span>
        <span class="time">10:09</span>
      </header>
      <section class="dials">
        <div class="dial move">
          <div class="dial-background one"></div>
          <div class="dial-container container1">
            <div class="wedge"></div>
          </div>
          <div class="dial-container container2">
            <div class="wedge"></div>
          </div>
          <div class="marker start"></div>
          <div class="marker end"></div>
        </div>
        <div class="dial exercise">
          <div class="dial-background two"></div>
          <div class="dial-container container1">
            <div class="wedge"></div>
          </div>
          <div class="marker start"></div>
          <div class="marker end"></div>
        </div>
        <div class="dial stand">
          <div class="dial-background three"></div>
          <div class="dial-container container1">
            <div class="wedge"></div>
          </div>
          <div class="marker start"></div>
          <div class="marker end"></div>
        </div>
      </section>
      <section class="pips">
        <div></div>
        <div></div>
        <div></div>
        <div></div>
      </section>
    </div>
  </article>
</section>
              
            
!

CSS

              
                body {
  background: #fff;
}

.watch {
  background: #000 url(https://cssanimation.rocks/assets/images/posts/watch/watchbg.jpg) no-repeat;
  background-size: 100%;
  font-family: "San Francisco Display UltraLight", "Open Sans", Helvetica, Arial, Serif;
  font-size: 32px;
  width: 440px;
  height: 487px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.screen {
  width: 59.2%;
  height: 74%;
  position: absolute;
  left: 18%;
  top: 13%;

  .title, .time {
    animation: show-title 5s infinite ease-out;
    color: #b1b4c2;
    font-size: 0.9em;
    position: absolute;
    top: 0;
    left: 0;
    letter-spacing: 0.05em;
  }

  .time {
    animation-delay: 0.2s;
    right: 0;
    left: auto;
  }

  .dials {
    animation: show-dials 5s infinite ease-out;
    width: 4em;
    height: 4em;
    border-radius: 50%;
    position: absolute;
    top: 1.75em;
    left: 0;
  }

  .dial {
    border: 1px solid #000;
    border-radius: 50%;
  }

  /**** DIAL 1 ****/
  .dial.move {
    position: absolute;
    width: 8em;
    height: 8em;

    &::before {
      background: url(https://cssanimation.rocks/assets/images/posts/watch/1.png) no-repeat center;
      background-size: 50%;
      content: "";
      width: 1.5em;
      height: 1.5em;
      position: absolute;
      top: -0.29em;
      left: calc(50% - 0.75em);
      z-index: 10;
    }

    &::after {
      content: "";
      background: #000;
      border-radius: 50%;
      width: 6em;
      height: 6em;
      position: absolute;
      top: 1em;
      left: 1em;
    }

    .dial-container {
      position: absolute;
      top: 0;
      bottom: 0;
      width: 4em;
      overflow: hidden;
    }
    .wedge {
      width: 4em;
      height: 8em;
      position: absolute;
      top: 0;
      left: 0;
    }
    .container1 {
      left: 4em;
    }
    .container1 .wedge {
      animation: rotate-bg-dial-1-1 5s 0.2s linear infinite;
      border-radius: 8em 0 0 8em;
      background: #fc1d20;
      left: -4em;
      transform-origin: 100% 50%;
    }

    .container2 {
      left: 0;
    }
    .container2 .wedge {
      animation: rotate-bg-dial-1-2 5s 0.2s linear infinite;
      background: #fc1d20;
      border-radius: 0 8em 8em 0;
      transform-origin: 0 50%;
      left: 4em;
    }

    .marker {
      width: 1em;
      height: 1em;
      background: #fc1d20;
      border-radius: 50%;
      position: absolute;
      top: 0;
      left: calc(50% - 0.5em);
    }
    .end {
      animation: rotate-marker-dial-1 5s 0.2s linear infinite;
      transform-origin: 50% 4em;
    }
  }

  /**** DIAL 2 ****/
  .dial.exercise {
    position: absolute;
    width: 6em;
    height: 6em;
    top: 1em;
    left: 1em;

    &::before {
      background: url(https://cssanimation.rocks/assets/images/posts/watch/2.png) no-repeat center;
      background-size: 50%;
      content: "";
      width: 1.5em;
      height: 1.5em;
      position: absolute;
      top: -0.29em;
      left: calc(50% - 0.75em);
      z-index: 10;
    }

    &::after {
      content: "";
      background: #000;
      border-radius: 50%;
      width: 4em;
      height: 4em;
      position: absolute;
      top: 1em;
      left: 1em;
    }

    .dial-container {
      position: absolute;
      top: 0;
      bottom: 0;
      width: 3em;
      overflow: hidden;
    }
    .wedge {
      border-radius: 50%;
      width: 3em;
      height: 6em;
      position: absolute;
    }
    .container1 {
      left: 3em;
    }
    .container1 {
      .wedge {
        animation: rotate-bg-dial-2-1 5s .5s linear infinite;
        border-radius: 8em 0 0 8em;
        position: absolute;
        background: #9cfc33;
        left: -3em;
        transform-origin: 100% 50%;
      }
    }

    .marker {
      width: 1em;
      height: 1em;
      background: #9cfc33;
      border-radius: 50%;
      position: absolute;
      top: 0;
      left: calc(50% - 0.48em);
    }
    .end {
      animation: rotate-marker-dial-2 5s .5s linear infinite;
      transform-origin: 45% 3em;
    }
  }

  /**** DIAL 3 ****/
  .dial.stand {
    position: absolute;
    width: 4em;
    height: 4em;
    top: 2em;
    left: 2em;

    &::before {
      background: url(https://cssanimation.rocks/assets/images/posts/watch/3.png) no-repeat center;
      background-size: 50%;
      content: "";
      width: 1.5em;
      height: 1.5em;
      position: absolute;
      top: -0.28em;
      left: calc(50% - 0.75em);
      z-index: 10;
    }

    &::after {
      content: "";
      background: #000;
      border-radius: 50%;
      width: 2em;
      height: 2em;
      position: absolute;
      top: 1em;
      left: 1em;
    }

    .dial-container {
      position: absolute;
      top: 0;
      bottom: 0;
      width: 4em;
      overflow: hidden;
    }
    .wedge {
      border-radius: 50%;
      width: 2em;
      height: 4em;
      position: absolute;
    }
    .container1 {
      left: 2em;
    }
    .container1 {
      .wedge {
        position: absolute;
        animation: rotate-bg-dial-3-1 5s 0.5s linear infinite;
        background: #32cbd4;
        border-radius: 8em 0 0 8em;
        left: -2em;
        transform-origin: 100% 50%;
      }
    }
    .marker {
      width: 1em;
      height: 1em;
      background: #32cbd4;
      border-radius: 50%;
      position: absolute;
      top: 0;
      left: calc(50% - 0.5em);
    }
    .end {
      animation: rotate-marker-dial-3 5s 0.5s linear infinite;
      transform-origin: 50% 2em;
    }
  }

  .dial-background {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: 50%;

    &.one {
      background: #400818;

    }

    &.two {
      background: #2d400c;
    }

    &.three {
      background: #163d3b;
    }
  }
}

.pips {
  animation: show-dials 5s 0.1s infinite ease-out;
  position: absolute;
  bottom: 0;
  left: calc(50% - 1em);
  width: 2em;

  div {
    width: 0.25em;
    height: 0.25em;
    background-color: #353535;
    border-radius: 50%;
    display: inline-block;
    margin: 0 0.02em;

    &:first-child {
      background-color: #fff;
    }
  }
}

/** Animations **/

@keyframes rotate-marker-dial-1 {
  0%, 6% {
    transform: none;
  }
  28%, 94% {
    transform: rotateZ(220deg);
  }
  95%, 100% {
    transform: none;
  }
}

@keyframes rotate-bg-dial-1-1 {
  0%, 6% {
    transform: rotateZ(0);
  }
  24%, 94% {
    transform: rotateZ(180deg);
  }
  95%, 100% {
    transform: rotateZ(0);
  }
}

@keyframes rotate-bg-dial-1-2 {
  24% {
    transform: rotateZ(0);
  }
  28%, 94% {
    transform: rotateZ(40deg);
  }
  95%, 100% {
    transform: rotateZ(0);
  }
}

@keyframes rotate-marker-dial-2 {
  20%, 90% {
    transform: rotateZ(160deg);
  }
  91%, 100% {
    transform: none;
  }
}

@keyframes rotate-bg-dial-2-1 {
  0%, 0.5% {
    transform: none;
  }
  19%, 90% {
    transform: rotateZ(160deg);
  }
  91%, 100% {
    transform: none;
  }
}

@keyframes rotate-marker-dial-3 {
  19%, 90% {
    transform: rotateZ(90deg);
  }
  91%, 100% {
    transform: none;
  }
}

@keyframes rotate-bg-dial-3-1 {
  0%, 1% {
    transform: none;
  }
  19%, 90% {
    transform: rotateZ(90deg);
  }
  91%, 100% {
    transform: none;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console