css实现创意圆环tick时钟效果代码
代码语言:html
所属分类:其他
代码描述:css实现创意圆环tick时钟效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Secular+One&display=swap'>
<style>
@import url("https://fonts.googleapis.com/css2?family=League+Gothic&display=swap");
html,
body {
height: 100%;
overflow: hidden;
}
body {
display: flex;
justify-content: center;
align-items: center;
margin: 0;
font-family: "League Gothic", sans-serif;
background-color: #000000;
}
.clock {
--clock-size: 400px;
--hand-color: #535353;
height: var(--clock-size);
width: var(--clock-size);
margin: auto;
position: relative;
}
.clock .indicator {
height: calc(var(--clock-size) * 0.5);
position: absolute;
width: 0;
left: 0;
right: 0;
margin: auto;
transform-origin: bottom;
}
.clock .indicator::before {
position: absolute;
left: 50%;
transform: translateX(-50%);
margin: auto;
top: -10%;
font-size: 1.5rem;
color: var(--hand-color);
transition: all ease 0.25s;
}
.clock .indicator.active::before {
color: #ffd60a;
text-shadow: 0px 0px #ffd60a;
}
.clock .indicator:nth-child(0) {
transform: rotate(0deg);
}
.clock .indicator:nth-child(0)::before {
content: "TICK";
}
.clock .indicator:nth-child(1) {
transform: rotate(6deg);
height: calc(var(--clock-size) * 0.44);
top: calc(var(--clock-size) * 0.06);
}
.clock .indicator:nth-child(1)::before {
content: "TOCK";
}
.clock .indicator:nth-child(2) {
transform: rotate(12deg);
}
.clock .indicator:nth-child(2)::before {
content: "TICK";
}
.clock .indicator:nth-child(3) {
transform: rotate(18deg);
height: calc(var(--clock-size) * 0.44);
top: calc(var(--clock-size) * 0.06);
}
.clock .indicator:nth-child(3)::before {
content: "TOCK";
}
.clock .indicator:nth-child(4) {
transform: rotate(24deg);
}
.clock .indicator:nth-child(4)::before {
content: "TICK";
}
.clock .indicator:nth-child(5) {
transform: rotate(30deg);
height: calc(var(--clock-size) * 0.44);
top: calc(var(--clock-size) * 0.06);
}
.clock .indicator:nth-child(5)::before {
content: "TOCK";
}
.clock .indicator:nth-child(6) {
transform: rotate(36deg);
}
.clock .indicator:nth-child(6)::before {
content: "TICK";
}
.clock .indicator:nth-child(7) {
transform: rotate(42deg);
height: calc(var(--clock-size) * 0.44);
top: calc(var(--clock-size) * 0.06);
}
.clock .indicator:nth-child(7)::before {
content: "TOCK";
}
.clock .indicator:nth-child(8) {
transform: rotate(48deg);
}
.clock .indicator:nth-child(8)::before {
content: "TICK&qu.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0