css实现三维爱心立方体旋转动画效果代码

代码语言:html

所属分类:三维

代码描述:css实现三维爱心立方体旋转动画效果代码

代码标签: 爱心 立方体 旋转 动画 效果

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

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">





    <style>
        :root {
          --cube-size: 300px;
          --pink-cube-color: #f76488;
          --grey-cube-color: #e7e6e4;
          --core-cube-color: #7a7a7a;
          --heart-color: #feaec9;
          --piece-color: #999;
          --piece-light: #aaa;
        }
        
        body {
          margin: 13em 0;
          background: #2d2f31;
          overflow: hidden;
        }
        
        .container {
          display: flex;
          justify-content: center;
          align-items: center;
        }
        
        .companion-cube {
          width: var(--cube-size);
          height: var(--cube-size);
          position: relative;
          -webkit-backface-visibility: hidden;
                  backface-visibility: hidden;
          transform-style: preserve-3d;
          -webkit-animation: walkCube 6s linear infinite;
                  animation: walkCube 6s linear infinite;
        }
        
        .cube-face {
          width: 100%;
          height: 100%;
          display: flex;
          justify-content: center;
          align-items: center;
          position: absolute;
          background: #666d;
          box-shadow: 0 0 10px #0005 inset;
        }
        
        .cube-face .extracube {
            width: 100%;
            height: 100%;
            position: absolute;
            transform: translateZ(10px);
          }
        
        .cube-face .piece {
            --piece-size: 38%;
        
            z-index: 5;
            position: absolute;
         .........完整代码请登录后点击上方下载按钮下载查看

网友评论0