css实现旋转的切片小球动画效果代码

代码语言:html

所属分类:动画

代码描述:css实现旋转的切片小球动画效果代码

代码标签: css 切片 旋转 小球 动画

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

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">




    <style>
        * {
          box-sizing: border-box;
        }
        
        .frame {
          position: absolute;
          top: 50%;
          left: 50%;
          width: 400px;
          height: 400px;
          margin-top: -200px;
          margin-left: -200px;
          border-radius: 2px;
          box-shadow: 4px 8px 16px 0 rgba(0, 0, 0, 0.1);
          overflow: hidden;
          background: radial-gradient(circle, #BEE9E8 40%, #CAE9FF);
          color: #333;
          font-family: "Open Sans", Helvetica, sans-serif;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
          display: flex;
          justify-content: center;
          align-items: center;
          perspective: 3000;
        }
        
        .ball {
          width: 200px;
          height: 200px;
          border-radius: 50%;
          position: relative;
          transform-style: preserve-3d;
          -webkit-animation: ballani 15s infinite alternate ease;
                  animation: ballani 15s infinite alternate ease;
        }
        
        @-webkit-keyframes ballani {
          1% {
            transform: rotateX(0deg) rotateY(0deg);
          }
          15% {
            transform: rotateX(180deg) rotateY(0deg);
          }
          30% {
            transform: rotateX(500deg) rotateY(100deg);
          }
          60% {
            transform: rotateX(50deg) rotateY(-190deg);
          }
          70% {
            transform: rotateX(90deg) rotateY(180deg) rotateZ(0deg);
          }
          90% {
            transform: rotateX(80deg) rotateY(180deg) rotateZ(700deg);
          }
          100% {
            transform: rotateX(90deg) rotateY(360deg) rotateZ(720deg);
          }
        }
        
        @keyframes ballani {
          1% {
            transform: rotateX(0deg) rotateY(0deg);
          }
          15% {
            transform: rotateX(180deg) rotateY(0deg);
          }
          30% {
            transform: rotateX(500deg) rotateY(100deg);
          }
          60% {
            transform: rotateX(50deg) rotateY(-190deg);
          }
          70% {
            transform: rotateX(90deg) rotateY(180deg) rotateZ(0deg);
          }
          90% {
            transform: rotateX(80deg) rotateY(180deg) rotateZ(700deg);
          }
          100% {
            transform: rotateX(9.........完整代码请登录后点击上方下载按钮下载查看

网友评论0