css+js实现精美秒表计时器代码
代码语言:html
所属分类:布局界面
代码描述:css+js实现精美秒表计时器代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import url("https://fonts.googleapis.com/css2?family=Playwrite+BE+VLG:wght@100..400&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
body {
background-color: #111;
display: grid;
place-items: center;
height: 100vh;
width: 100vw;
font-family: 'Poppins';
}
.stopwatch {
width: 200px;
height: 200px;
background-color: #efefef;
border-radius: 50%;
display: grid;
place-items: center;
border: 12px solid #ccc;
box-shadow: inset 1px 1px 1px rgba(0,0,0,0.35), inset -1px -1px 1px rgba(0,0,0,0.35);
position: relative;
}
.stopwatch .dot {
width: 10px;
height: 10px;
border-radius: 50%;
background-color: #aaa;
z-index: 99;
box-shadow: inset 1px 1px 1px rgba(255,255,255,0.25), inset -1px -1px 1px rgba(0,0,0,0.25), 1px 1px 2px rgba(0,0,0,0.25);
position: absolute;
}
.stopwatch .minutes {
position: absolute;
width: 25px;
height: 20px;
right: 50px;
border-radius: 3px;
box-shadow: inset 0 0 2px rgba(0,0,0,0.5);
display: grid;
place-items: center;
font-size: 12px;
}
.stopwatch .minutes:after {
content: 'mins';
font-size: 8px;
position: absolute;
margin-bottom: -32px;
}
.stopwatch .secondhand {
height: 60px;
width: 3px;
border-radius: 50% 50% 0 0;
transform: translateY(-30px) rotate(0deg);
transform-origin: bottom center;
background-color: #f00;
position: absolute;
transition: transform 0.75s ease-in-out;
box-shadow: 1px 1px 2px rgba(0,0,0,0.75);
}
.stopwatch .notch {
width: 1px;
height: 8px;
background-color: #000;
position: absolute;
rotate: 180deg;
}
.stopwatch .n1 {
transform: rotate(6deg) translateY(89px);
transform-origin: center center;
}
.stopwatch .n1:after {
transform: rotate(180deg);
}
.stopwatch .n2 {
transform: rotate(12deg) translateY(89px);
transform-origin: center center;
}
.stopwatch .n2:after {
transform: rotate(180deg);
}
.stopwatch .n3 {
transform: rotate(18deg) translateY(89px);
transform-origin: center center;
}
.stopwatch .n3:after {
transform: rotate(180deg);
}
.stopwatch .n4 {
transform: rotate(24deg) translateY(89px);
transform-origin: center center;
}
.stopwatch .n4:after {
transform: rotate(180deg);
}
.stopwatch .n5 {
transform: rotate(30deg) translateY(89px);
transform-origin: center center;
}
.stopwatch .n5:after {
transform: rotate(180deg);
}
.stopwatch .n5 {
height: 12px;
width: 1px;
transform: rotate(30deg) translateY(87px);
background-color: #f00;
}
.stopwatch .n5:after {
content: '5';
top: -15px;
right: -5px;
position: absolute;
color: #000;
font-size: 10px;
}
.stopwatch .n6 {
transform: rotate(36deg) translateY(89px);
transform-origin: center center;
}
.stopwatch .n6:after {
transform: rotate(180deg);
}
.stopwatch .n7 {
transform: rotate(42deg) translateY(89px);
transform-origin: center center;
}
.stopwatch .n7:after {
transform: rotate(180deg);
}
.stopwatch .n8 {
transform: rotate(48deg) translateY(89px);
transform-origin: center center;
}
.stopwatch .n8:after {
transform: rotate(180deg);
}
.stopwatch .n9 {
transform: rotate(54deg) translateY(89px);
transform-origin: center center;
}
.stopwatch .n9:after.........完整代码请登录后点击上方下载按钮下载查看
网友评论0