JSFiddle - React, Tailwind, and code Playground
by kougiland
HTML
<div class="lockup_a">
<h1>N</h1>
<div class="clock">
<div class="circle"></div>
<div class="hour hand"></div>
<div class="minute hand"></div>
<div class="second hand"></div>
</div>
<h1>W</h1>
<h2>THIS</h2>
</div>
<div class="lockup_b">
<h1>N</h1>
<div class="clock">
<div class="circle"></div>
<div class="hour hand"></div>
<div class="minute hand"></div>
<div class="second hand"></div>
</div>
<h1>W</h1>
<h2>THIS</h2>
</div>
CSS
body {
background-color: #fff;
width: 100%;
height: 100%;
-webkit-font-smoothing: antialiased;
}
h1 {
display: inline-block;
margin: 0;
font-family:'Roboto';
font-size: 100px;
letter-spacing: -2px;
position: relative;
top: 0px;
color: #222;
text-shadow: 0 1px #fcfcfc;
}
h2 {
display: inline-block;
margin: 0;
font-family:'Roboto';
font-weight: 200;
letter-spacing: -10px;
font-size: 100px;
position: relative;
top: 0px;
color: #333;
text-shadow: 0 1px #fcfcfc;
}
.clock {
display: inline-block;
position: relative;
height: 50px; width: 50px;
border-radius: 100px;
background: #fff;
border: 13px solid #222;
margin: 0 auto;
top: 1px;
}
.circle {
position: relative;
height: 6px; width: 6px;
top: 22px; left: 22px;
border-radius: 10px;
background: #333;
z-index: 5;
}
.hand {
position: absolute;
width: 4px;
background: #333;
border-radius: 0px;
left: 23px;
margin: 0 auto;
-webkit-transform-origin: center bottom;
}
.second {
width: 2px;
left:24px;
height: 23px;
top: 2px;
background-color: darkRed;
z-index: 4;
}
.minute {
height: 23px;
top: 2px;
}
.hour {
height: 15px;
top: 10px;
}
.lockup_b {
position:relative;
top:-55px;
}
.lockup_b h1 {
display: inline-block;
margin: 0;
font-family:'Roboto';
font-size: 178px;
position: relative;
top: 0px;
color: #222;
text-shadow: 0 1px #fcfcfc;
}
.lockup_b h2 {
display: inline-block;
margin: 0;
font-family:'Roboto';
font-weight: 200;
letter-spacing: -10px;
font-size: 175px;
position: relative;
top: 0px;
color: #333;
text-shadow: 0 1px #fcfcfc;
}
.lockup_b .clock {
display: inline-block;
position: relative;
height: 100px; width: 100px;
border-radius: 100px;
background: #fff;
border: 17px solid #222;
margin: 0 auto;
top: 4px;
}
.lockup_b .circle {
position: relative;
height: 10px; width: 10px;
top: 45px; left: 45px;
border-radius: 10px;
background: #333;
...
JavaScript
var s = 0, d_s = 0;
setInterval(function () {
var d=new Date();
$('.minute').css('-webkit-transform','rotate('+ d.getMinutes()*6 +'deg)');
$('.hour').css('-webkit-transform','rotate('+ (d.getHours()%12)*30 +'deg)');
/* smooth second hand */
if(s == d.getSeconds()) {
d_s++;
} else {
s = d.getSeconds();
d_s = d.getSeconds()*6;
}
$('.second').css('-webkit-transform','rotate('+ d_s +'deg)');
}, 166);