css实现三维3d盒子表面文字移动动画效果代码

代码语言:html

所属分类:三维

代码描述:css实现三维3d盒子表面文字移动动画效果代码

代码标签: 3d 盒子 表面 文字 移动 动画 效果

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


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

<head>

  <meta charset="UTF-8">
  

  
  
  
<style>
@import url("https://fonts.googleapis.com/css?family=Cute+Font&display=swap");
.box {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}
.box__surface {
  position: absolute;
  top: calc(50% - 100px);
  left: calc(50% - 100px);
  width: 200px;
  height: 200px;
  background: #1b2735;
  display: flex;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  overflow: hidden;
  text-align: center;
}
.box__surface:nth-child(1) {
  transform: translateZ(100px);
  -webkit-transform: translateZ(100px);
}
.box__surface:nth-child(1) .overall {
  animation: move1 12s infinite normal;
  -webkit-animation: move1 12s infinite normal;
}
.box__surface:nth-child(2) {
  transform: rotateY(90deg) translateZ(100px);
  -webkit-transform: rotateY(90deg) translateZ(100px);
}
.box__surface:nth-child(2) .overall {
  animation: move2 12s infinite normal;
  -webkit-animation: move2 12s infinite normal;
}
.box__surface:nth-child(3) {
  transform: rotateX(90deg) translateZ(100px);
  -webkit-transform: rotateX(90deg) translateZ(100px);
}
.box__surface:nth-child(3) .overall {
  animation: move3 12s infinite normal;
  -webkit-animation: move3 12s infinite normal;
}
.box__surface:nth-child(4) {
  transform: rotateX(-90deg) translateZ(100px);
  -webkit-transform: rotateX(-90deg) translateZ(100px);
}
.box__surface:nth-child(4) .overall {
  animation: move3 12s infinite normal;
  -webkit-animation: move3 12s infinite normal;
}
.box__surface:nth-child(5) {
  transform: rotateY(-90deg) translateZ(100px);
  -webkit-transform: rotateY(-90deg) translateZ(100px);
}
.box__surface:nth-child(5) .overall {
  animation: move2 12s infinite normal;
  -webkit-animation: move2 12s infinite normal;
}
.box__surface:nth-child(6) {
  transform: rotateY(180deg) translateZ(100px);
  -webkit-transform: rotateY(180deg) translateZ(100px);
}
.box__surface:nth-child(6) .overall {
  animation: move4 12s infinite normal;
  -webkit-animation: move4 12s infinite normal;
}

.overall {
  position: absolute;
  top: 0;
  left: 0;
  width: 800px;
  height: 800px;
}

.row {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  display: -ms-flexbox;
  width: 800px;
  height: 200px;
  margin: 0;
  line-height: 200px;
  font-size: 80px;
}
.row:nth-of-type(1n) {
  top: 0;
}
.row:nth-of-type(2n) {
  top: 200px;
}
.row:nth-of-ty.........完整代码请登录后点击上方下载按钮下载查看

网友评论0