js实现柱状数字时钟走动动画效果代码

代码语言:html

所属分类:其他

代码描述:js实现柱状数字时钟走动动画效果代码

代码标签: js 柱状 数字 时钟 走动 动画

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">

  
  
  
<style>
body {
  position: fixed;
  height: 100vh;
  width: 100vw;
  background-color: black;
  display: flex;
  align-items: center;
  justify-content: center;
}

#c {
  display: flex;
  flex-direction: row;
  height: 80vh;
}

.sc {
  /* height: 100%;
  width: 36pt; */
  margin: 0 calc(36pt / 10);
}

.sc.ch {
  --color: hotpink;
}

.sc.cm {
  --color: salmon;
}

.sc.cs {
  --color: orange;
}

.ng {
  display: grid;
  grid-template-columns: repeat(5,calc(36pt / 5));
  grid-template-rows: repeat(5,calc(36pt / 5));
  background-color: inherit;
  width: 36pt;
  height: 36pt;
  margin-bottom: calc(36pt / 5);
}

.sc .ng .np {
  background: var(--color);
  opacity: 25%;
  width: calc(36pt / 5);
  height: calc(36pt / 5);
  transition: opacity 320ms;
  border-radius: calc(36pt / 32);
  box-shadow: 0 0 4pt var(--color), inset 0 0 0.75pt black;
}

#hb,#mb,#sb {
  background: var(--color);
  box-shadow: 0 0 4pt var(--color), inset 0 0 15pt black;
  transition: height 167ms;
}

.ng._0 .np:nth-child(1),.ng._0 .np:nth-child(2),.ng._0 .np:nth-child(3),.ng._0 .np:nth-child(4),.ng._0 .np:nth-child(5),.ng._0 .np:nth-child(6),.ng._0 .np:nth-child(10),.ng._0 .np:nth-child(11),.ng._0 .np:nth-child(15),.ng._0 .np:nth-child(16),.ng._0 .np:nth-child(20),.ng._0 .np:nth-child(21),.ng._0 .np:nth-child(22),.ng._0 .np:nth-child(23),.ng._0 .np:nth-child(24),.ng._0 .np:nth-child(25)
,.ng._1 .np:nth-child(1),.ng._1 .np:nth-child(2),.ng._1 .np:nth-child(3),.ng._1 .np:nth-child(8),.ng._1 .np:nth-child(13),.ng._1 .np:nth-child(18),.ng._1 .np:nth-child(21),.ng._1 .np:nth-child(22),.ng._1 .np:nth-child(23),.ng._1 .np:nth-child(24),.ng._1 .np:nth-child(25)
,.ng._2 .np:nth-child(1),.ng._2 .np:nth-child(2),.ng._2 .np:nth-child(3),.ng._2 .np:nth-child(4),.ng._2 .np:nth-child(5),.ng._2 .np:nth-child(10),.ng._2 .np:nth-child(11),.ng._2 .np:nth-child(12),.ng._2 .np:nth-child(13),.ng._2 .np:nth-child(14),.ng._2 .np:nth-child(15),.ng._2 .np:nth-child(16),.ng._2 .np:nth-child(21),.ng._2 .np:nth-child(22),.ng._2 .np:nth-child(23),.ng._2 .np:nth-child(24),.ng._2 .np:nth-child(25)
,.ng._3 .np:nth-child(1),.ng._3 .np:nth-child(2),.ng._3 .np:nth-child(3),.ng._3 .np:nth-child(4),.ng._3 .np:nth-child(5),.ng._3 .np:nth-child(10),.ng._3 .np:nth-child(13),.ng._3 .np:nth-child(14),.ng._3 .np:nth-child(15),.ng._3 .np:nth-child(20),.ng._3 .np:nth-child(21),.ng._3 .np:nth-child(22),.ng._3 .np:nth-child(23),.ng._3 .np:nth-child(24),.ng._3 .np:nth-child(25)
,.ng._4 .np:nth-child(1),.ng._4 .np:nth-child(5),.ng._4 .np:nth-child(6),.ng._4 .np:nth-child(10),.ng._4 .np:nth-child(11),.ng._4 .np:nth-child(12),.ng._4 .np:nth-child(13),.ng._4 .np:nth-child(14),.ng._4 .np:nth-child(15),.ng._4 .np:nth-child(20),.ng._4 .np:nth-child(25)
,.ng._5 .np:nth-child(1),.ng._5 .np:nth-child(2),.ng._5 .np:nth-child(3),.ng._5 .np:nth-child(4),.ng._5 .np:nth-child(5),.ng._5 .np:nth-child(6),.ng._5 .np:nth-child(11),.ng._5 .np:nth-child(12),.ng._5 .np:nth-child(13),.ng._5 .np:nth-child(14),.ng._5 .np:nth-child(15),.ng._5 .np:nth-child(20),.ng._5 .np:nth-child(21),.ng._5 .np:nth-child(22),.ng._5 .np:nth-child(23),.ng._5 .np:nth-child(24),.ng._5 .np:nth-child(25)
,.ng._6 .np:nth-child(1),.ng._6 .np:nth-child(2),.ng._6 .np:nth-child(3),.ng._6 .np:nth-child(4),.ng._6 .np:nth-child(5),.ng._6 .np:nth-child(6),.ng._6 .np:nth-child(11),.ng._6 .np:nth-child(12),.ng._6 .np:nth-child(13),.ng._6 .np:nth-child(14),.ng._6 .np:nth-child(15),.ng._6 .np:nth-child(16),.ng._6 .np:nth-child(20),.ng._6 .np:nth-child(21),.ng._6 .np:nth-child(22),.ng._6 .np:nth-child(23),.ng._6 .np:nth-child(24),.ng._6 .np:nth-child(25)
,.ng._7 .np:nth-child(1),.ng._7 .np:nth-child(2),.ng._7 .np:nth-child(3),.ng._7 .np:nth-child(4),.ng._7 .np:nth-child(5),.ng._7 .np:nth-child(10),.ng._7 .np:nth-child(13),.ng._7 .np:nth-child(14),.ng._7 .np:nth-child(15),.ng._7 .np:nth-child(20),.ng._7 .np:nth-child(25)
,.ng._8 .np:nth-child(1),.ng._8 .np:nth-child(2),.ng._8 .np:nth-child(3),.ng._8 .np:nth-child(4),.ng._8 .np:nth-child(5),.ng._8 .np:nth-child(6),.ng._8 .np:nth-child(10),.ng._8 .np:nth-child(11),.ng._8 .np:nth-child(12),.ng._8 .np:nth-child(13),.ng._8 .np:nth-child(14),.ng._8 .np:nth-child(15),.ng._8 .np:nth-child(16),.ng._8 .np:nth-child(20),.ng._8 .np:nth-child(21),.ng._8 .np:nth-child(22),.ng._8 .np:nth-child(23),.ng._8 .np:nth-child(24),.ng._8 .np:nth-child(25)
,.ng._9 .np:nth-child(1),.ng._9 .np:nth-child(2),.ng._9 .np:nth-child(3),.ng._9 .np:nth-child(4),.ng._9 .np:nth-child(5),.ng._9 .np:nth-child(6),.ng._9 .np:nth-child(10),.ng._9 .np:nth-child(11),.ng._9 .np:nth-child(12),.ng._9 .np:nth-child(13),.ng._9 .np:nth-child(14),.ng._9 .np:nth-child(15),.ng._9 .np:nth-child(20),.ng._9 .np:nth-child(21),.ng._9 .np:nth-child(22),.ng._9 .np:nth-child(23),.ng._9 .np:nth-child(24),.ng._9 .np:nth-child(25)
{
  opacity: 100%
}
</style>


</head>

<body >
  <div id="c">
  <div class="sc ch">
    <div class="ng _1" id="hfd">
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
    </div>
    <div class="ng _0" id="hld">
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
      <div class="np"></div>
    </div>
    <div id=.........完整代码请登录后点击上方下载按钮下载查看

网友评论0