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="clock-body">
  <div class="clock">
    <div class="dails">
      <h2 class="hour-number twelve">12</h2>
      <h2 class="hour-number three">3</h2>
      <h2 class="hour-number six">6</h2>
      <h2 class="hour-number nine">9</h2>
      <div class="hour-dail"></div>
      <div class="minute-dail"></div>
      <div class="seconds-dail"></div>
      <div class="center-dail"></div>
    </div>
  </div>
</div>
<div class="clock-shadow"></div>
              
            
!

CSS

              
                *{
    box-sizing: border-box;
}
body{
    background: rgb(29, 27, 36);
    padding: ;
    margin: 0;
    font-family: sans-serif;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    height: 100vh;
}
h1{
    background: linear-gradient(tomato, rgb(212, 40, 40));
    font-size: 2.8em;
    
}
.heading{
    background-clip: text;
    -webkit-background-clip: text;
    color: rgba(0, 0, 0, .2);
}
.clock-body{
    width: 550px;
    height: 550px;
    border-radius: 20%;
    background: tomato;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 1px 10px 40px 40px  rgb(212, 40, 40);
    margin: 0 1em;
}
.clock{
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgb(60, 60, 78);
    border: 30px solid rgba(212, 40, 40, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 5px 5px 50px 20px black;
}

.dails{
    width: 340px;
    height: 340px;
    background: rgba(66, 66, 105, 0.5);
    border-radius: 50%;
    position: relative;
    box-shadow: 5px 5px 30px 10px black;
    display: flex;
    justify-content: center;
    align-items: center;
}
.hour-dail{
    width: 1px;
    height: 100px;
    padding: 0 4px 0 4px;
    background: white;
    box-shadow: 3px 3px 10px black;
    position: absolute;
    top: 70px;
    left: 50%;
    transform: rotate(0deg) translateX(-50%);
    transform-origin: bottom center;
}
.minute-dail{
    width: 1px;
    height: 150px;
    padding: 0 4px 0 4px;
    background: white;
    box-shadow: 3px 3px 10px black;
    position: absolute;
    top: 20px;
    left: 50%;
    transform: rotate(0deg) translateX(-50%);
    transform-origin: bottom center;
}
.seconds-dail{
    width: 1px;
    height: 150px;
    padding: 0 1px 0 1px;
    background: white;
    box-shadow: 3px 3px 10px black;
    position: absolute;
    top: 20px;
    left: 50%;
    transform: rotate(0deg) translateX(-50%);
    transform-origin: bottom center;
    z-index: 1;
}
.center-dail{
    width: 40px;  
    height: 40px;
    background: white;
    border-radius: 50%;
    box-shadow: 2px 2px 10px black;
    z-index: 100;
    
}
.clock-shadow{
    width: 450px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .2);
    margin-top: 1.5em;
    box-shadow: 0 0 5px 10px rgba(0, 0, 0, .2);
}
h2{
    background: linear-gradient(rgb(212, 40, 40), tomato);
    font-size: 2.8em;
    padding: 0;
    margin: 0;    
}

.hour-number{
    position: absolute;
    color: tomato;
    font-size: 4em;
    font-weight: bold;
    font-family: sans-serif;
    z-index: 0;
    background-clip: text;
    -webkit-background-clip: text;
    color: rgba(0, 0, 0, .2);
}
.twelve{
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}
.three{
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}
.six{
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%); 
}
.nine{
    top: 50%;
    left: 20px;
    transform: translateY(-50%); 
}
              
            
!

JS

              
                const secDail = document.querySelector(".seconds-dail");
const minDail = document.querySelector(".minute-dail");
const hrsDail = document.querySelector(".hour-dail");

const setDate = () => {
  let now = new Date().toLocaleString("en-US", {
    timeZone: "Africa/Johannesburg"
  });
  now = new Date(now);
  const seconds = now.getSeconds();
  const minutes = now.getMinutes();
  const hours = now.getHours();
  const secondsDegrees = (seconds / 60) * 360;
  const minutesDegrees = (minutes / 60) * 360;
  const hoursDegrees = (hours / 12 ) * 360;
  secDail.style.transform = `rotate(${secondsDegrees}deg)`;
  minDail.style.transform = `rotate(${minutesDegrees}deg)`;
  hrsDail.style.transform = `rotate(${hoursDegrees}deg)`;
};
setInterval(setDate, 1000);

              
            
!
999px

Console