css方块矩阵实现的数字跳动动画效果代码
代码语言:html
所属分类:动画
代码描述:css方块矩阵实现的数字跳动动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<html> <head> <style> :root { --color-grey: #2a2a21; --color-yellow: #edce4c; --color-bright-yellow: #ffe45e; --color-mustard: #dbbd3b; } body, html { display: flex; align-items: center; justify-content: center; width: 100vw; height: 100vh; overflow: hidden; background: linear-gradient(tobottom left, var(--color-bright-yellow), var(--color-mustard)); } .timer { box-shadow: 10px 10px 60px rgba(27, 27, 27, 0.9); display: grid; -webkit-column-gap: 1px; column-gap: 1px; row-gap: 1px; grid-template-columns: repeat(3, 100px); grid-template-rows: repeat(5, 100px); } .block { height: 100px; position: relative; transition: 400ms -webkit-transform ease; transition: 400ms transform ease; transition: 400ms transform ease, 400ms -webkit-transform ease; -webkit-transform-style: preserve-3d; transform-style: preserve-3d; width: 100px; } .block > div { box-shadow: 0 0 30px rgba(0, 0, 0, 0.3) inset, 0 0 30px rgba(0, 0, 0, 0.3) inset; position: absolute; width: 100%; height: 100%; } .block .front, .block .back { background-color: var(--color-bright-yellow); } .block .top, .block .bottom { background-color: var(--color-grey); } .block .front { -webkit-transform: rotateY(0deg) translateZ(50px); transform: rotateY(0deg) translateZ(50px); } .block .top { -webkit-transform: rotateX(90deg) translateZ(50px); transform: rotateX(90deg) translateZ(50px); } .block .back { -webkit-transform: rotateY(180deg) translateZ(50px); transform: rotateY(180deg) translateZ(50px); } .block .bottom { -webkit-transform: rotateX(-90deg) translateZ(50px); transform: rotateX(-90deg) translateZ(50px); } .show-front { -webkit-transform: translateZ(-100px) rotateX(0deg); transform: translateZ(-100px) rotateX(0deg); } .show-top { -webkit-transform: translateZ(-100px) rotateX(-90deg); transform: translateZ(-100px) rotateX(-90deg); } .show-back { -webkit-transform: translateZ(-100px) rotateX(-180deg); transform: translateZ(-100px) rotateX(-180deg); } .show-bottom { -webkit-transform: translateZ(-100px) rotateX(-270deg); transform: translateZ(-100px) rotateX(-270deg); } </style> </head> <body > <div class="timer"> <div class="block" data-rotate="-90" style="transform: translateZ(-100px) rotateX(-90deg);"> <div class="front"></div> <div class="top"></div> <div class="back"></div> <div class="bottom"></div> </div> <div class="block" data-rotate="-90" style="transform: translateZ(-100px) rotateX(-90deg);"> <div class="front"></div> <div class="top"></div> <div class="back"></div> <div class="bottom"></div> </div> <div class="block" data-rotate="-90" style="transform: translateZ(-100px) rotateX(-90deg);"> <div class="front"></div> <div class="top"></div> <div class="back"></div> <div class="bottom"></div> </div> <div class="block" data-rotate="-90" style="transform: translateZ(-100px) rotateX(-90deg);"> <div class="front"></div> <div class="top"></div> <div class="back"></div> <div class="bottom"></div> </div> <div class="block" data-rotate=""> <div class="front"></div> <div class="top"></div> <div class="back"></div> <div class="bottom"></div> </div> <div class="block" data-rotate="-90" style="transform: translateZ(-100px) rotateX(-90deg);"> <div class="front"></div> <div class="top"></div> <div class="back"></div> <div class="bottom"></div> </div> <div class="block" data-rotate="-90" style="transform: translateZ(-100px) rotateX(-90deg);"> <div class="front"></div> <div class="top"></div> <div class="back"></div> <div class="bottom"></div> </div> <div class="block" data-rotate=""> <div class="front"></div> <div class="top"></div> <div class="back"></div> <div class="bo.........完整代码请登录后点击上方下载按钮下载查看
网友评论0