div+css实现三维游戏手柄旋转动画效果代码

代码语言:html

所属分类:三维

代码描述:div+css实现三维游戏手柄旋转动画效果代码

代码标签: div css 三维 游戏 手柄 旋转

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

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">





    <style>
        @import url(https://fonts.googleapis.com/css?family=Squada+One);
        *:after,
        *:before {
          content: '';
          position: absolute;
          width: inherit;
          height: inherit;
        }
        body {
          perspective: 800px;
          background: #EEE;
        }
        .controller {
          margin: 60px auto;
          transform-style: preserve-3d;
          width: 400px;
          height: 180px;
          background: #353334;
          position: relative;
          transform-origin: 50% 100%;
          animation: rotate 4.5s infinite;
          animation-direction: alternate;
          font-family: 'Squada One', cursive;
          box-shadow: 
            0 25px 0 15px #d0cfcd inset,
            0 0 0 15px #d0cfcd inset
            ;
        }
        .controller:before {
          height: 100px;
          background: rgba(0,0,0,.3);
          box-shadow: 0 0 20px 10px #EEE inset;
          -webkit-filter: blur(20px);
          border-radius: 50px;
          transform:
            rotateX(70deg)
            translateZ(-160px);
        }
        .controller:after {
          background: #CCC;
          background-image:
            radial-gradient(#222 8px, transparent 8px),
            radial-gradient(#222 8px, transparent 8px),
            radial-gradient(#222 8px, transparent 8px),
            radial-gradient(#222 8px, transparent 8px),
            radial-gradient(#222 8px, transparent 8px),
            radial-gradient(#222 8px, transparent 8px);
          background-repeat: no-repeat;
          background-size: 16px 16px;
          background-position: 
            374px 154px,
            50% 154px,
            10px 154px,
            374px 10px,
            50% 10px,
            10px 10px;
          transform: translateZ(-40px);
        }
        .controller .logo {
          font-size: 20px;
          color: #a42d17;
          position: absolute;
          left: 270px;
          top: 40px;
          transform: translateZ(1px);
        }
        .sides {
          list-style: none;
          marg.........完整代码请登录后点击上方下载按钮下载查看

网友评论0