div+css实现贴满图片的六边形立方体盒子旋转动画效果代码

代码语言:html

所属分类:动画

代码描述:div+css实现贴满图片的六边形立方体盒子旋转动画效果代码

代码标签: div css 贴满 图片 六边形 立方体 盒子 旋转 动画

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

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

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

  
  
<style>
body {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #000;
  perspective: 1000px;
  overflow: hidden;
}

.scene {
  width: 200px;
  height: 200px;
  transform-style: preserve-3d;
  -webkit-animation: rotate 20s infinite linear;
          animation: rotate 20s infinite linear;
}

.cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
}

.face {
  position: absolute;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0.8;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.front {
  transform: rotateY(0deg) translateZ(100px);
  background-image: url("//repo.bfw.wiki/random/200x200/景色?rand=11");
}

.right {
  transform: rotateY(90deg) translateZ(100px);
  background-image: url("//repo.bfw.wiki/random/200x200/景色?rand=111");
}

.back {
  transform: rotateY(180deg) translateZ(100px);
  background-image: url("//repo.bfw.wiki/random/200x200/景色?rand=1111");
}

.left {
  transform: rotate.........完整代码请登录后点击上方下载按钮下载查看

网友评论0