web-html5-scripts/web-snippets/clock-pure-css/style.css

394 lines
8.9 KiB
CSS
Raw Normal View History

html,
body {
height: 100%;
}
body {
background: #1b1e23;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-family: sans-serif;
color: white;
}
p {
color: #f4eed7;
font-size: 0.8em;
opacity: 0.75;
}
.clock {
height: 200px;
width: 200px;
border-radius: 100px;
display: flex;
justify-content: center;
position: relative;
}
.clock__second, .clock__minute, .clock__hour, .clock__indicator {
position: absolute;
left: calc(50% - 1px);
width: 2px;
background: #f4eed7;
-webkit-transform-origin: bottom center;
transform-origin: bottom center;
z-index: 2;
border-radius: 1px;
}
.clock__second {
height: 90px;
margin-top: 10px;
background: #4b9aaa;
-webkit-animation: time 60s infinite steps(60);
animation: time 60s infinite steps(60);
z-index: 3;
}
.clock__minute {
height: 80px;
margin-top: 20px;
opacity: 0.75;
-webkit-animation: time 3600s linear infinite;
animation: time 3600s linear infinite;
}
.clock__hour {
height: 60px;
margin-top: 40px;
-webkit-animation: time 43200s linear infinite;
animation: time 43200s linear infinite;
}
.clock__indicator {
height: 98px;
border-top: 2px solid #4b9aaa;
background: none;
}
.clock__indicator:nth-of-type(5n) {
opacity: 1;
height: 93px;
border-top: 7px solid #f4eed7;
}
.clock__axis {
background: #4b9aaa;
width: 5px;
height: 5px;
border-radius: 3px;
position: absolute;
z-index: 4;
top: 97px;
}
section:nth-of-type(1) {
-webkit-transform: rotateZ(calc(6deg * 1));
transform: rotateZ(calc(6deg * 1));
}
section:nth-of-type(2) {
-webkit-transform: rotateZ(calc(6deg * 2));
transform: rotateZ(calc(6deg * 2));
}
section:nth-of-type(3) {
-webkit-transform: rotateZ(calc(6deg * 3));
transform: rotateZ(calc(6deg * 3));
}
section:nth-of-type(4) {
-webkit-transform: rotateZ(calc(6deg * 4));
transform: rotateZ(calc(6deg * 4));
}
section:nth-of-type(5) {
-webkit-transform: rotateZ(calc(6deg * 5));
transform: rotateZ(calc(6deg * 5));
}
section:nth-of-type(6) {
-webkit-transform: rotateZ(calc(6deg * 6));
transform: rotateZ(calc(6deg * 6));
}
section:nth-of-type(7) {
-webkit-transform: rotateZ(calc(6deg * 7));
transform: rotateZ(calc(6deg * 7));
}
section:nth-of-type(8) {
-webkit-transform: rotateZ(calc(6deg * 8));
transform: rotateZ(calc(6deg * 8));
}
section:nth-of-type(9) {
-webkit-transform: rotateZ(calc(6deg * 9));
transform: rotateZ(calc(6deg * 9));
}
section:nth-of-type(10) {
-webkit-transform: rotateZ(calc(6deg * 10));
transform: rotateZ(calc(6deg * 10));
}
section:nth-of-type(11) {
-webkit-transform: rotateZ(calc(6deg * 11));
transform: rotateZ(calc(6deg * 11));
}
section:nth-of-type(12) {
-webkit-transform: rotateZ(calc(6deg * 12));
transform: rotateZ(calc(6deg * 12));
}
section:nth-of-type(13) {
-webkit-transform: rotateZ(calc(6deg * 13));
transform: rotateZ(calc(6deg * 13));
}
section:nth-of-type(14) {
-webkit-transform: rotateZ(calc(6deg * 14));
transform: rotateZ(calc(6deg * 14));
}
section:nth-of-type(15) {
-webkit-transform: rotateZ(calc(6deg * 15));
transform: rotateZ(calc(6deg * 15));
}
section:nth-of-type(16) {
-webkit-transform: rotateZ(calc(6deg * 16));
transform: rotateZ(calc(6deg * 16));
}
section:nth-of-type(17) {
-webkit-transform: rotateZ(calc(6deg * 17));
transform: rotateZ(calc(6deg * 17));
}
section:nth-of-type(18) {
-webkit-transform: rotateZ(calc(6deg * 18));
transform: rotateZ(calc(6deg * 18));
}
section:nth-of-type(19) {
-webkit-transform: rotateZ(calc(6deg * 19));
transform: rotateZ(calc(6deg * 19));
}
section:nth-of-type(20) {
-webkit-transform: rotateZ(calc(6deg * 20));
transform: rotateZ(calc(6deg * 20));
}
section:nth-of-type(21) {
-webkit-transform: rotateZ(calc(6deg * 21));
transform: rotateZ(calc(6deg * 21));
}
section:nth-of-type(22) {
-webkit-transform: rotateZ(calc(6deg * 22));
transform: rotateZ(calc(6deg * 22));
}
section:nth-of-type(23) {
-webkit-transform: rotateZ(calc(6deg * 23));
transform: rotateZ(calc(6deg * 23));
}
section:nth-of-type(24) {
-webkit-transform: rotateZ(calc(6deg * 24));
transform: rotateZ(calc(6deg * 24));
}
section:nth-of-type(25) {
-webkit-transform: rotateZ(calc(6deg * 25));
transform: rotateZ(calc(6deg * 25));
}
section:nth-of-type(26) {
-webkit-transform: rotateZ(calc(6deg * 26));
transform: rotateZ(calc(6deg * 26));
}
section:nth-of-type(27) {
-webkit-transform: rotateZ(calc(6deg * 27));
transform: rotateZ(calc(6deg * 27));
}
section:nth-of-type(28) {
-webkit-transform: rotateZ(calc(6deg * 28));
transform: rotateZ(calc(6deg * 28));
}
section:nth-of-type(29) {
-webkit-transform: rotateZ(calc(6deg * 29));
transform: rotateZ(calc(6deg * 29));
}
section:nth-of-type(30) {
-webkit-transform: rotateZ(calc(6deg * 30));
transform: rotateZ(calc(6deg * 30));
}
section:nth-of-type(31) {
-webkit-transform: rotateZ(calc(6deg * 31));
transform: rotateZ(calc(6deg * 31));
}
section:nth-of-type(32) {
-webkit-transform: rotateZ(calc(6deg * 32));
transform: rotateZ(calc(6deg * 32));
}
section:nth-of-type(33) {
-webkit-transform: rotateZ(calc(6deg * 33));
transform: rotateZ(calc(6deg * 33));
}
section:nth-of-type(34) {
-webkit-transform: rotateZ(calc(6deg * 34));
transform: rotateZ(calc(6deg * 34));
}
section:nth-of-type(35) {
-webkit-transform: rotateZ(calc(6deg * 35));
transform: rotateZ(calc(6deg * 35));
}
section:nth-of-type(36) {
-webkit-transform: rotateZ(calc(6deg * 36));
transform: rotateZ(calc(6deg * 36));
}
section:nth-of-type(37) {
-webkit-transform: rotateZ(calc(6deg * 37));
transform: rotateZ(calc(6deg * 37));
}
section:nth-of-type(38) {
-webkit-transform: rotateZ(calc(6deg * 38));
transform: rotateZ(calc(6deg * 38));
}
section:nth-of-type(39) {
-webkit-transform: rotateZ(calc(6deg * 39));
transform: rotateZ(calc(6deg * 39));
}
section:nth-of-type(40) {
-webkit-transform: rotateZ(calc(6deg * 40));
transform: rotateZ(calc(6deg * 40));
}
section:nth-of-type(41) {
-webkit-transform: rotateZ(calc(6deg * 41));
transform: rotateZ(calc(6deg * 41));
}
section:nth-of-type(42) {
-webkit-transform: rotateZ(calc(6deg * 42));
transform: rotateZ(calc(6deg * 42));
}
section:nth-of-type(43) {
-webkit-transform: rotateZ(calc(6deg * 43));
transform: rotateZ(calc(6deg * 43));
}
section:nth-of-type(44) {
-webkit-transform: rotateZ(calc(6deg * 44));
transform: rotateZ(calc(6deg * 44));
}
section:nth-of-type(45) {
-webkit-transform: rotateZ(calc(6deg * 45));
transform: rotateZ(calc(6deg * 45));
}
section:nth-of-type(46) {
-webkit-transform: rotateZ(calc(6deg * 46));
transform: rotateZ(calc(6deg * 46));
}
section:nth-of-type(47) {
-webkit-transform: rotateZ(calc(6deg * 47));
transform: rotateZ(calc(6deg * 47));
}
section:nth-of-type(48) {
-webkit-transform: rotateZ(calc(6deg * 48));
transform: rotateZ(calc(6deg * 48));
}
section:nth-of-type(49) {
-webkit-transform: rotateZ(calc(6deg * 49));
transform: rotateZ(calc(6deg * 49));
}
section:nth-of-type(50) {
-webkit-transform: rotateZ(calc(6deg * 50));
transform: rotateZ(calc(6deg * 50));
}
section:nth-of-type(51) {
-webkit-transform: rotateZ(calc(6deg * 51));
transform: rotateZ(calc(6deg * 51));
}
section:nth-of-type(52) {
-webkit-transform: rotateZ(calc(6deg * 52));
transform: rotateZ(calc(6deg * 52));
}
section:nth-of-type(53) {
-webkit-transform: rotateZ(calc(6deg * 53));
transform: rotateZ(calc(6deg * 53));
}
section:nth-of-type(54) {
-webkit-transform: rotateZ(calc(6deg * 54));
transform: rotateZ(calc(6deg * 54));
}
section:nth-of-type(55) {
-webkit-transform: rotateZ(calc(6deg * 55));
transform: rotateZ(calc(6deg * 55));
}
section:nth-of-type(56) {
-webkit-transform: rotateZ(calc(6deg * 56));
transform: rotateZ(calc(6deg * 56));
}
section:nth-of-type(57) {
-webkit-transform: rotateZ(calc(6deg * 57));
transform: rotateZ(calc(6deg * 57));
}
section:nth-of-type(58) {
-webkit-transform: rotateZ(calc(6deg * 58));
transform: rotateZ(calc(6deg * 58));
}
section:nth-of-type(59) {
-webkit-transform: rotateZ(calc(6deg * 59));
transform: rotateZ(calc(6deg * 59));
}
section:nth-of-type(60) {
-webkit-transform: rotateZ(calc(6deg * 60));
transform: rotateZ(calc(6deg * 60));
}
@-webkit-keyframes time {
to {
-webkit-transform: rotateZ(360deg);
transform: rotateZ(360deg);
}
}
@keyframes time {
to {
-webkit-transform: rotateZ(360deg);
transform: rotateZ(360deg);
}
}