jquery+css实现三维数字滚轮式时间倒计时动画效果代码

代码语言:html

所属分类:其他

代码描述:jquery+css实现三维数字滚轮式时间倒计时动画效果代码

代码标签: jquery css 三维 数字 滚轮 时间 倒计时 动画

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

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

<head>
  <meta charset="UTF-8">

  
  
  
<style>
@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono&display=swap");
body {
  height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  font-family: "JetBrains Mono", monospace;
  perspective: 1000px;
  perspective-origin: calc(50% - 0) calc(50% - 0);
  background: #f9f9f9;
}

.holder {
  width: 350px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  justify-content: space-between;
  transform-style: preserve-3d;
  animation: hold 30s infinite ease-in-out;
}

.holder:after {
  content: "";
  width: 500px;
  height: 300px;
  left: -150px;
  top: -50px;
  position: absolute;
  background: rgba(249, 249, 249, 0.9);
  filter: blur(20px);
}

.holder:before {
  content: "";
  width: 200px;
  height: 100px;
  left: 0;
  top: 50px;
  position: absolute;
  background: rgba(0, 0, 0, 0.2);
  transform: translateY(230px) rotateX(90deg);
  filter: blur(20px);
}

@keyframes hold {
  0%, 100% {
    transform: rotateY(-30deg) rotateX(-2deg);
  }
  50% {
    transform: rotateY(38deg) rotateX(8deg);
  }
}
.reel {
  position: relative;
  transform-style: preserve-3d;
}

.reel div {
  position: absolute;
  text-align: center;
  width: 50px;
  height: 100px;
  font-size: 72px;
  line-height: 100px;
  animation: fade 10s infinite linear;
}

.reel div:nth-child(1) {
  --left: 0px;
  transform: translate(-50%, -50%) rotateX(0deg) translateZ(154px);
  animation-delay: 0s;
}

.reel div:nth-child(2) {
  --left: 50px;
  transform: translate(-50%, -50%) rotateX(36deg) translateZ(154px);
  animation-delay: 1s;
}

.reel div:nth-child(3) {
  --left: 100px;
  transform: translate(-50%, -50%) rotateX(72deg) translateZ(154px);
  animation-delay: 2s;
}

.reel div:nth-child(4) {
  --left: 150px;
  transform: translate(-50%, -50%) rotateX(108deg) translateZ(154px);
  animation-delay: 3s;
}

.reel div:nth-child(5) {
  --left: 200px;
  transform: translate(-50%, -50%) rotateX(144deg) translateZ(154px);
  animation-delay: 4s;
}

.reel div:nth-child(6) {
  --left: 250px;
  transform: translate(-50%, -50%) rotateX(180deg) translateZ(154px);
  animation-delay: 5s;
}

.reel div:nth-child(7) {
  --left: 300px;
  transform: translate(-50%, -50%) rotateX(216deg) translateZ(154px);
  animation-delay: 6s;
}

.reel div:nth-child(8) {
  --left: 350px;
  transform: translate(-50%, -50%) rotateX(252deg) translateZ(154px);
  animation-delay: 7s;
}

.reel div:nth-child(9) {
  --left: 400px;
  transform: translate(-50%, -50%) rotateX(288deg) translateZ(154px);
  animation-delay: 8s;
}

.reel div:nth-child(10) {
  --left: 450px;
  transform: translate(-50%, -50%) rotateX(324deg) translateZ(154px);
  animation-delay: 9s;
}

* {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

#ones {
  animation: increment-ones 10s infinite ease-in;
}

#tens {
  animation: increment-tens 100s infinite ease-in;
}

#hundreds {
  animation: increment-hund 1000s infinite ease-in;
}

#thousands {
  animation: increment-thou 10000s infinite ease-in;
}

#tenthousands {
  animation: increment-tenthou 100000s infinite ease-in;
}

#hundredthousands {
  animation: increment-hunthou 1000000s infinite ease-in;
}

#millions {
  animation: increment-million 10000000s infinite ease-in;
}

#tenmillions {
  animation: increment-tenmillion 10000000s infinite ease-in;
}

@keyframes increment-ones {
  0% {
    transform: rotateX(0);
  }
  10% {
    transform: rotateX(-36deg);
  }
  20% {
    transform: rotateX(-72deg);
  }
  30% {
    transform: rotateX(-108deg);
  }
  40% {
    transform: rotateX(-144deg);
  }
  50% {
    transform: rotateX(-180deg);
  }
  60% {
    transform: rotateX(-216deg);
  }
  70% {
    transform: rotateX(-252deg);
  }
  80% {
    transform: rotateX(-288deg);
  }
  90% {
    transform: rotateX(-324deg);
  }
  100% {
    transform: rotateX(-360deg);
  }
}
@keyframes increment-tens {
  0%, 9% {
    transform: rotateX(0);
  }
  100% {
    transform: rotateX(-360deg);
  }
  10%, 19% {
    transform: rotateX(-36deg);
  }
  20%, 29% {
    transform: rotateX(-72deg);
  }
  30%, 39% {
    transform: rotateX(-108deg);
  }
  40%, 49% {
    transform: rotateX(-144deg);
  }
  50%, 59% {
    transform: rotateX(-180deg);
  }
  60%, 69% {
    transform: rotateX(-216deg);
  }
  70%, 79% {
    transform: rotateX(-252deg);
  }
  80%, 89% {
    transform: rotateX(-288deg);
  }
  90%, 99% {
    transform: rotateX(-324deg);
  }
}
@keyframes increment-hund {
  0%, 9.9% {
    transform: rotateX(0);
  }
  100% {
    transform: rotateX(-360deg);
  }
  10%, 19.9% {
    transform: rotateX(-36deg);
  }
  20%, 29.9% {
    transform: rotateX(-72deg);
  }
  30%, 39.9% {
    transform: rotateX(-108deg);
  }
  40%, 49.9% {
    transform: rotateX(-144deg);
  }
  50%, 59.9% {
    transform: rotateX(-180deg);
  }
  60%, 69.9% {
    transform: rotateX(-216deg);
  }
  70%, 79.9% {
    transform: rotateX(-252deg);
  }
  80%, 89.9% {
    transform: rotateX(-288deg);
  }
  90%, 99.9% {
    transform: rotateX(-324deg);
  }
}
@keyframes increment-thou {
  0%, 9.99% {
    transform: rotateX(0);
  }
  100% {
    transform: rotateX(-360deg);
  }
  10%, 19.99% {
    transform: rotateX(-36deg);
  }
  20%, 29.99% {
    transform: rotateX(-72deg);
  }
  30%, 39.99% {
    transform: rotateX(-108deg);
  }
  40%, 49.99% {
    transform: rotateX(-144deg);
  }
  50%, 59.99% {
    transform: rotateX(-180deg);
  }
  60%, 69.99% {
    transform: rotateX(-216deg);
  }
  70%, 79.99% {
    transform: rotateX(-252deg);
  }
  80%, 89.99% {
    transform: rotateX(-288deg);
  }
  90%, 99.99% {
    transform: rotateX(-324deg);
  }
}
@keyframes increment-tenthou {
  0%, 9.........完整代码请登录后点击上方下载按钮下载查看

网友评论0