css+js实现精美秒表计时器代码

代码语言:html

所属分类:布局界面

代码描述:css+js实现精美秒表计时器代码

代码标签: 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 {
  transform: rotate(180deg);
}
.stopwatch .n10 {
  transform: rotate(60deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n10:after {
  transform: rotate(180deg);
}
.stopwatch .n10 {
  height: 12px;
  width: 1px;
  transform: rotate(60deg) translateY(87px);
  background-color: #f00;
}
.stopwatch .n10:after {
  content: '10';
  top: -15px;
  right: -5px;
  position: absolute;
  color: #000;
  font-size: 10px;
}
.stopwatch .n11 {
  transform: rotate(66deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n11:after {
  transform: rotate(180deg);
}
.stopwatch .n12 {
  transform: rotate(72deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n12:after {
  transform: rotate(180deg);
}
.stopwatch .n13 {
  transform: rotate(78deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n13:after {
  transform: rotate(180deg);
}
.stopwatch .n14 {
  transform: rotate(84deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n14:after {
  transform: rotate(180deg);
}
.stopwatch .n15 {
  transform: rotate(90deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n15:after {
  transform: rotate(180deg);
}
.stopwatch .n15 {
  height: 12px;
  width: 1px;
  transform: rotate(90deg) translateY(87px);
  background-color: #f00;
}
.stopwatch .n15:after {
  content: '15';
  top: -15px;
  right: -5px;
  position: absolute;
  color: #000;
  font-size: 10px;
}
.stopwatch .n15 {
  height: 16px;
  width: 2px;
  transform: rotate(90deg) translateY(86px);
  font-weight: 600;
}
.stopwatch .n15:after {
  margin-top: 2px;
  color: #f00;
}
.stopwatch .n16 {
  transform: rotate(96deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n16:after {
  transform: rotate(180deg);
}
.stopwatch .n17 {
  transform: rotate(102deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n17:after {
  transform: rotate(180deg);
}
.stopwatch .n18 {
  transform: rotate(108deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n18:after {
  transform: rotate(180deg);
}
.stopwatch .n19 {
  transform: rotate(114deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n19:after {
  transform: rotate(180deg);
}
.stopwatch .n20 {
  transform: rotate(120deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n20:after {
  transform: rotate(180deg);
}
.stopwatch .n20 {
  height: 12px;
  width: 1px;
  transform: rotate(120deg) translateY(87px);
  background-color: #f00;
}
.stopwatch .n20:after {
  content: '20';
  top: -15px;
  right: -5px;
  position: absolute;
  color: #000;
  font-size: 10px;
}
.stopwatch .n21 {
  transform: rotate(126deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n21:after {
  transform: rotate(180deg);
}
.stopwatch .n22 {
  transform: rotate(132deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n22:after {
  transform: rotate(180deg);
}
.stopwatch .n23 {
  transform: rotate(138deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n23:after {
  transform: rotate(180deg);
}
.stopwatch .n24 {
  transform: rotate(144deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n24:after {
  transform: rotate(180deg);
}
.stopwatch .n25 {
  transform: rotate(150deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n25:after {
  transform: rotate(180deg);
}
.stopwatch .n25 {
  height: 12px;
  width: 1px;
  transform: rotate(150deg) translateY(87px);
  background-color: #f00;
}
.stopwatch .n25:after {
  content: '25';
  top: -15px;
  right: -5px;
  position: absolute;
  color: #000;
  font-size: 10px;
}
.stopwatch .n26 {
  transform: rotate(156deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n26:after {
  transform: rotate(180deg);
}
.stopwatch .n27 {
  transform: rotate(162deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n27:after {
  transform: rotate(180deg);
}
.stopwatch .n28 {
  transform: rotate(168deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n28:after {
  transform: rotate(180deg);
}
.stopwatch .n29 {
  transform: rotate(174deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n29:after {
  transform: rotate(180deg);
}
.stopwatch .n30 {
  transform: rotate(180deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n30:after {
  transform: rotate(180deg);
}
.stopwatch .n30 {
  height: 12px;
  width: 1px;
  transform: rotate(180deg) translateY(87px);
  background-color: #f00;
}
.stopwatch .n30:after {
  content: '30';
  top: -15px;
  right: -5px;
  position: absolute;
  color: #000;
  font-size: 10px;
}
.stopwatch .n30 {
  height: 16px;
  width: 2px;
  transform: rotate(180deg) translateY(86px);
  font-weight: 600;
}
.stopwatch .n30:after {
  margin-top: 2px;
  color: #f00;
}
.stopwatch .n31 {
  transform: rotate(186deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n31:after {
  transform: rotate(180deg);
}
.stopwatch .n32 {
  transform: rotate(192deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n32:after {
  transform: rotate(180deg);
}
.stopwatch .n33 {
  transform: rotate(198deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n33:after {
  transform: rotate(180deg);
}
.stopwatch .n34 {
  transform: rotate(204deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n34:after {
  transform: rotate(180deg);
}
.stopwatch .n35 {
  transform: rotate(210deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n35:after {
  transform: rotate(180deg);
}
.stopwatch .n35 {
  height: 12px;
  width: 1px;
  transform: rotate(210deg) translateY(87px);
  background-color: #f00;
}
.stopwatch .n35:after {
  content: '35';
  top: -15px;
  right: -5px;
  position: absolute;
  color: #000;
  font-size: 10px;
}
.stopwatch .n36 {
  transform: rotate(216deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n36:after {
  transform: rotate(180deg);
}
.stopwatch .n37 {
  transform: rotate(222deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n37:after {
  transform: rotate(180deg);
}
.stopwatch .n38 {
  transform: rotate(228deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n38:after {
  transform: rotate(180deg);
}
.stopwatch .n39 {
  transform: rotate(234deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n39:after {
  transform: rotate(180deg);
}
.stopwatch .n40 {
  transform: rotate(240deg) translateY(89px);
  transform-origin: center center;
}
.stopwatch .n40:after {
  transform: rotate(180deg);
}
.stopwatch .n40 {
  height: 12px;
  width: 1px;
  t.........完整代码请登录后点击上方下载按钮下载查看

网友评论0