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="">
    <div class="row">
      <div class="mt-5">
        <div id="clock-ani">
          <div id="clock">
            <div class="hour"> 
              <div class="min"></div>
              <div class="min"></div>
              <div class="min"></div>
              <div class="min"></div>
              <div class="min"></div>
            </div>
            <div class="hour">
              <div class="min"></div>
              <div class="min"></div>
              <div class="min"></div>
              <div class="min"></div>
              <div class="min"></div>
            </div>
            <div id="alarm"> </div>
            <div id="min"></div>
            <div id="hour"></div>
            <div id="sec"></div>
            <ol>
              <li></li>
              <li></li>
              <li></li>
              <li></li>
              <li></li>
              <li></li>
              <li></li>
              <li></li>
              <li></li>
              <li></li>
              <li></li>
              <li></li>
            </ol>
          </div>
        </div>
      </div>
    </div>
  </section>
              
            
!

CSS

              
                body {
  background-color: #fafafa;
}

@keyframes zoom {
  100% {
    opacity: 1;
    transform: scale(1);
    visibility: visible;
  }
}
@keyframes shadow {
  0% {
    box-shadow: inset 0 -0.2em 0.2em 0 rgba(0, 0, 0, 0.2),
      inset 0 0.4em 1em 0 rgba(255, 255, 255, 0.8), 0 0 2em -1em transparent;
  }
  100% {
    box-shadow: inset 0 -0.2em 0.2em 0 rgba(0, 0, 0, 0.2),
      inset 0 0.4em 1em 0 rgba(255, 255, 255, 0.8),
      0 1.8em 1.4em -1.4em rgba(0, 0, 0, 0.3);
  }
}
#clock-ani {
  animation-delay: 1s;
  animation-duration: 1.9s;
  animation-fill-mode: both;
  animation-name: zoom;
  transform: scale(0.92);
  visibility: hidden;
  opacity: 0;
}
#clock {
  position: relative;
  margin: 20px auto 80px;
  font-size: 75%;
  font-family: helvetica;
  width: 21em;
  height: 21em;
  border-radius: 50%;
  background: #f0f0f0;
  border: 0.2em solid #d0d0d0;
  box-shadow: 0 1.2em 0 -1em #fff, 0 -0.1em 0.3em 0 #fff, 0 0 0 0.6em #eee,
    0 0.7em 1.2em 0 rgba(0, 0, 0, 0.6), 0 0 0 0.68em #fff,
    inset 0 0.5em 1em 0 rgba(0, 0, 0, 0.2), inset 0 0 8em 0 rgba(0, 0, 0, 0.2);
}
#clock::before {
  display: block;
  content: "";
  position: absolute;
  background: #e9e9e9;
  left: -2em;
  top: -2em;
  width: 25em;
  height: 25em;
  border-radius: 4em;
  z-index: -1;
  animation-duration: 1.8s;
  animation-fill-mode: both;
  animation-name: shadow;
  animation-delay: 0.8s;
}
#clock::after {
  display: block;
  content: "";
  position: absolute;
  height: inherit;
  width: inherit;
  background: transparent;
  top: 0;
  left: 0;
  border-radius: inherit;
  box-shadow: inset 12em 14em 0 -10em rgba(255, 255, 255, 0.25);
  z-index: 4;
}
#clock .hour {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  width: 0.5em;
  height: 17.5em;
  background: transparent;
  box-shadow: 0 -1em 0 -0.1em #383838, 0 1em 0 -0.1em #383838;
  transform: rotate(30deg);
}
#clock .hour:after,
#clock .hour:before {
  display: block;
  content: "";
  position: absolute;
  height: inherit;
  width: inherit;
  background: inherit;
  box-shadow: inherit;
  backface-visibility: inherit;
}
#clock .hour::before {
  transform: rotate(30deg);
}
#clock .hour::after {
  transform: rotate(-30deg);
}
#clock .hour:nth-of-type(1) {
  transform: rotate(-60deg);
}
#clock .min {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  width: 0.3em;
  height: 18.3em;
  background: transparent;
  box-shadow: 0 -0.6em 0 -0.1em #383838, 0 0.6em 0 -0.1em #383838;
  z-index: -1;
  transform: rotate(-54deg);
}
#clock .min:after,
#clock .min:before {
  display: block;
  content: "";
  position: absolute;
  height: inherit;
  width: inherit;
  background: inherit;
  box-shadow: inherit;
  backface-visibility: inherit;
  z-index: 0;
}
#clock .min:before {
  transform: rotate(6deg);
}
#clock .min:after {
  transform: rotate(12deg);
}
#clock .min:nth-child(2) {
  transform: rotate(-36deg);
}
#clock .min:nth-child(3) {
  transform: rotate(-18deg);
}
#clock .min:nth-child(4) {
  transform: rotate(6deg);
}
#clock .min:nth-child(5) {
  transform: rotate(24deg);
}
#alarm {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  background: #f8f8f8;
  width: 2.6em;
  height: 2.6em;
  border-radius: 50%;
  transform: rotate(-66deg);
  box-shadow: 0 0.2em 0.4em 0 rgba(0, 0, 0, 0.1);
  z-index: 2;
}
#alarm:after {
  display: block;
  content: "";
  position: absolute;
  width: 0.5em;
  height: 6em;
  top: -5.6em;
  background: linear-gradient(to bottom, #f6f6f6 0%, #f8f8f8 100%);
  left: 0;
  right: 0;
  margin: 0 auto;
  z-index: -3;
  box-shadow: inset 0 1.2em 0 #4ca440, -0.2em -0.2em 0.3em 0 rgba(0, 0, 0, 0.1);
}
#sec {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  background: radial-gradient(ellipse at center, #ffd322 0%, #fbc900 100%);
  width: 2em;
  height: 2em;
  border-radius: 50%;
  border: 0.14em solid #fbc900;
  z-index: 3;
}
#sec:before,
#sec:after {
  display: block;
  content: "";
  position: absolute;
}
#sec:before {
  background: #fbc900;
  width: 0.8em;
  height: 1.5em;
  top: 1.8em;
  left: 0;
  right: 0;
  margin: 0 auto;
  border-radius: 0 0 2em 2em;
}
#sec:after {
  width: 0.18em;
  height: 7.6em;
  top: -7.6em;
  background: #fbc900;
  left: 0;
  right: 0;
  margin: 0 auto;
}
#min,
#hour {
  z-index: 2;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  background: #fbc900;
  transform-origin: bottom center;
}
#min {
  width: 0.7em;
  height: 9.1em;
  top: -8.6em;
  border-radius: 2em 2em 0 0;
  box-shadow: inset 0 0 0 0.16em #303030, inset 0 -5em 0 0 #303030,
    -0.2em -0.2em 0.4em 0 rgba(0, 0, 0, 0.2);
}
#hour {
  width: 0.8em;
  height: 7.6em;
  top: -7em;
  border-radius: 2em 2em 0 0;
  box-shadow: inset 0 0 0 0.16em #303030, inset 0 -5em 0 0 #303030,
    -0.2em -0.2em 0.4em 0 rgba(0, 0, 0, 0.2);
}
#clock ol {
  position: relative;
  height: inherit;
  width: inherit;
}
#clock ol li {
  counter-increment: customlistcounter;
  font-size: 1.5em;
  display: inline-block;
  position: absolute;
  letter-spacing: -0.1em;
  color: #383838;
  text-align: center;
}
#clock ol li:before {
  content: counter(customlistcounter) "";
}
#clock ol li:nth-child(1) {
  top: 1.2em;
  right: 4.3em;
}
#clock ol li:nth-child(11) {
  top: 1.2em;
  left: 3.8em;
}
#clock ol li:nth-child(2) {
  top: 2.8em;
  right: 2.6em;
}
#clock ol li:nth-child(10) {
  top: 2.8em;
  left: 2.2em;
}
#clock ol li:nth-child(3) {
  top: 5.4em;
  right: 1.76em;
}
#clock ol li:nth-child(9) {
  top: 5.4em;
  left: 1.5em;
}
#clock ol li:nth-child(4) {
  bottom: 4.2em;
  right: 2.5em;
}
#clock ol li:nth-child(8) {
  bottom: 4.2em;
  left: 2.3em;
}
#clock ol li:nth-child(5) {
  bottom: 2.4em;
  right: 4.4em;
}
#clock ol li:nth-child(7) {
  bottom: 2.4em;
  left: 4.1em;
}
#clock ol li:nth-child(6) {
  bottom: 1.8em;
  left: 6.64em;
}
#clock ol li:nth-child(12) {
  top: 0.3em;
  left: 6.3em;
}

/***/

              
            
!

JS

              
                 // JavaScript code for the clock animation
    setInterval(function() {
      // Get the current time
      const now = new Date();

      // Calculate the position of the hour hand
      const hour = now.getHours() % 12;
      const hourAngle = (hour / 12) * 360 + (now.getMinutes() / 60) * 30;
      document.getElementById('hour').style.transform = `rotate(${hourAngle}deg)`;

      // Calculate the position of the minute hand
      const minAngle = (now.getMinutes() / 60) * 360;
      document.getElementById('min').style.transform = `rotate(${minAngle}deg)`;

      // Calculate the position of the second hand
      const secAngle = (now.getSeconds() / 60) * 360;
      document.getElementById('sec').style.transform = `rotate(${secAngle}deg)`;
    }, 1000); // Execute the function every second
              
            
!
999px

Console