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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

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.

            
              <html>

<head>
  <meta charset="UTF-8">
  <title>Clock Card</title>
  <link rel="stylesheet" href="css/style.css">
</head>

<body>
  <html lang="en">

  <head>
    <meta charset="UTF-8" />
    <link href='https://s3-us-west-2.amazonaws.com/luengo-font/fonts.css' rel='stylesheet' type='text/css'>
  </head>

  <body>
    <div class='card'>
      <div class="text-alignment">
        <time id="currtime" style="text"></time>
      </div>
      <div id='clock'>
        <div class='digit'></div>
        <div class='digit'></div>
        <div class='digit'></div>
        <div class='digit'></div>
        <div class='digit'></div>
        <div class='digit'></div>
        <div class='bighand'></div>
        <div class='lilhand'></div>
        <div class='sechand'></div>
      </div>
    </div>
  </body>

  </html>
  <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
  <script src="js/index.js"></script>
</body>

</html>
            
          
!
            
              * {
  box-sizing: border-box;
  -webkit-transition: background 1s ease-in;
  transition: background 1s ease-in;
}
.card {
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin: auto;
  height:  1400px;
  width: 800px;
  border-style: solid;
  border-width: 10px;
  border-color: white;
  background: #00AEEF;
  border-radius: 50px;
}
iframe { display: none; }
body{
  background-color: transparent;
  font-family: 'Luengo-Bold', sans-serif;
}
#currtime {
  font-family: 'Luengo-Bold';
  color: #fff;
  text-align: right;
  font-size: 100pt;
  margin-right: 25px;
  line-height: 1.4;
}
#currtime span {
  display: inline-block;
  font-family: 'luengolight';
  font-weight: 100;
  font-size: 100pt;
  position: relative;
  top: -.5vw;
}
.text-alignment {
  margin-top: 70px;
  text-align: center;
}

/*Analog Clock CSS*/
#clock {
  position: absolute;
  top: 575px;
  left: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  height: 400px;
  margin: auto;
  border-radius: 100%;
  background: white;
/*   box-shadow: inset 0 5px #3a3e4e, 0 0 0 5px #8087a1, 0 0 0 15px #2f3340, 0 10px 0 20px rgba(0, 0, 0, 0.3); */
}
#clock:before, #clock:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  border-radius: 100%;
}
#clock:before {
  width: 50px;
  height: 50px;
  background: #8087a1;
}
#clock:after {
  width: 30px;
  height: 30px;
  background: #caccd7;
}
#clock .digit {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 10px;
  height: 100%;
  margin: auto;
}
#clock .digit:nth-child(1) {
  -webkit-transform: rotate(30deg);
          transform: rotate(30deg);
}
#clock .digit:nth-child(2) {
  -webkit-transform: rotate(60deg);
          transform: rotate(60deg);
}
#clock .digit:nth-child(3) {
  -webkit-transform: rotate(90deg);
          transform: rotate(90deg);
}
#clock .digit:nth-child(4) {
  -webkit-transform: rotate(120deg);
          transform: rotate(120deg);
}
#clock .digit:nth-child(5) {
  -webkit-transform: rotate(150deg);
          transform: rotate(150deg);
}
#clock .digit:nth-child(6) {
  -webkit-transform: rotate(180deg);
          transform: rotate(180deg);
}
#clock .digit:before, #clock .digit:after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  width: 10px;
  height: 10px;
  margin: 20px 0;
  border-radius: 100%;
  background: #8087a1;
}
#clock .digit:before {
  top: 0;
}
#clock .digit:after {
  bottom: 0;
}
#clock .digit:nth-child(3):before, #clock .digit:nth-child(3):after, #clock .digit:nth-child(6):before, #clock .digit:nth-child(6):after {
  -webkit-transform: scale(1.3);
          transform: scale(1.3);
}
#clock .bighand {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 20px;
  margin: auto;
}
#clock .bighand:before {
  content: '';
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  width: 100%;
  height: 200px;
  border-radius: 10px;
  background: #2f3340;
}
#clock .lilhand {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 20px;
  margin: auto;
}
#clock .lilhand:before {
  content: '';
  position: absolute;
  top: 100px;
  left: 0;
  right: 0;
  width: 100%;
  height: 100px;
  border-radius: 10px;
  background: #242731;
}
#clock .sechand {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 4px;
  margin: auto;
}
#clock .sechand:before {
  content: '';
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  width: 100%;
  height: 150px;
  background: #e57513;
}
            
          
!
            
              var currentTime = document.getElementById("currtime");
var currentDate = document.getElementById("currdate");

var monthNames = ["January", "February", "March", "April", "May", "June",
  "July", "August", "September", "October", "November", "December"
];

function zeropadder(n) {
  return (parseInt(n, 10) < 10 ? '0' : '') + n;
}

function ordinal_suffix_of(i) {
    var j = i % 10,
        k = i % 100;
    if (j == 1 && k != 11) {
        return i + "st";
    }
    if (j == 2 && k != 12) {
        return i + "nd";
    }
    if (j == 3 && k != 13) {
        return i + "rd";
    }
    return i + "th";
}

function updateTime() {
  var timeNow = new Date(),
    hh = timeNow.getHours(),
    mm = timeNow.getMinutes(),
    ss = timeNow.getSeconds(),
    day = timeNow.getDate();
  month = timeNow.getMonth();
  formatAMPM = (hh >= 12 ? 'PM' : 'AM');
  hh = hh % 12 || 12;
  currentTime.innerHTML = monthNames[timeNow.getMonth()] + "<br>" + ordinal_suffix_of(day) + "<br>" + hh + "<span>:</span>" + zeropadder(mm) + formatAMPM;
  setTimeout(updateTime, 1000);
}
updateTime();

// Analog Clock JS
$(function() {
  setInterval(function() {
    var dt = new Date(),
      s = dt.getSeconds() * 6,
      m = dt.getMinutes() * 6,
      h = dt.getHours() * 30;
    $('#clock .sechand').css({
      '-webkit-transform': 'rotate(' + s + 'deg)',
      '-moz-transform': 'rotate(' + s + 'deg)',
      '-o-transform': 'rotate(' + s + 'deg)',
      '-ms-transform': 'rotate(' + s + 'deg)',
      'transform': 'rotate(' + s + 'deg)'
    });
    $('#clock .bighand').css({
      '-webkit-transform': 'rotate(' + m + 'deg)',
      '-moz-transform': 'rotate(' + m + 'deg)',
      '-o-transform': 'rotate(' + m + 'deg)',
      '-ms-transform': 'rotate(' + m + 'deg)',
      'transform': 'rotate(' + m + 'deg)'
    });
    $('#clock .lilhand').css({
      '-webkit-transform': 'rotate(' + h + 'deg)',
      '-moz-transform': 'rotate(' + h + 'deg)',
      '-o-transform': 'rotate(' + h + 'deg)',
      '-ms-transform': 'rotate(' + h + 'deg)',
      'transform': 'rotate(' + h + 'deg)'
    });
  });
});
            
          
!
999px
Loading ..................

Console