div+css实现立体渐变方块旋转动画效果代码

代码语言:html

所属分类:动画

代码描述:div+css实现立体渐变方块旋转动画效果代码

代码标签: div css 立体 渐变 方块 旋转 动画

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

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

<head>
    <meta charset="UTF-8">
<style>
    * {
  margin: 0;
  padding: 0;
  box-shadow: border-box;
  position: relative;
  font-family: Cascadia Code;
}
.flex {
  display: flex;
  align-items: center;
  justify-content: center;
}
body {
  width: 100%;
  height: 100%;
  background: #000;
  animation: col 18s linear infinite;
}
@keyframes col {
  to {
    filter: hue-rotate(360deg);
  }
}
.Txt {
  color: #99f3ff;
  animation: col 18s linear infinite;
}
.cube {
  width: 200px;
  height: 200px;
  transform: rotateX(60deg) rotate(45deg);
  transform-style: preserve-3d;
  top: 100px;
  animation: rot 8s linear infinite;
}
@keyframes rot {
  0% {
    transform: rotateX(60deg) rotate(45deg);
  }
  100% {
    transform: rotateX(60deg) rotate(405deg);
  }
}
.cube > div {
  width: 200px;
  height: 200px;
  position: absolute;
  background: #fff;
}
#left {
  left: 0px;
  top: 0px;
  transform-origin: left;
  transform: rotateY(90deg);
  background: linear-gradient(90deg, #222, #00e7ff);
}
#right {
  right: 0px;
  top: 0px;
  transform-origin: right;
  background: linear-gradient(-90deg, #222, #00e7ff);
  transform: rotateY(-90deg);
}
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0