js实现自适应打台球小球撞击乱碰物理动画效果代码

代码语言:html

所属分类:动画

代码描述:js实现自适应打台球小球撞击乱碰物理动画效果代码,点击台球桌任意位置驱动白球撞击

代码标签: 台球 碰撞 动画

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

<html>

<head>
    <style>
        html, body {
          width: 100%;
          height: 100%;
          margin: 0;
          padding: 0;
        }
        
        body {
          display: flex;
          flex-direction: column;
          justify-content: center;
          align-items: center;
          background: #3F4D63;
          background: repeating-conic-gradient(from 45deg, #3F4D63 0deg 90deg, #495973 90deg 180deg);
          background-size: 50px 50px;
          animation: scrollBackground;
          animation-duration: 5s;
          animation-iteration-count: infinite;
          animation-timing-function: linear;
        }
        
        @keyframes scrollBackground  {
          0% {
            background-position: 0px 0px;
          }
          
          100% {
            background-position: 50px 50px;
          }
        }
        
        h1 {
          color: white;
          font-family: sans-serif;
          font-weight: 100;
          font-size: 1.5em;
          text-shadow: 4px 4px rgba(0, 0, 0, 0.5);
          margin-top: 0;
          margin-bottom: 12px;
        }
        
        .pool-table-border {
          border: 20px solid #7B373B;
          box-shadow: 8px 8px rgba(0, 0, 0, 0.5);
          border-radius: 8px;
        }
        .pool-table-field {
          position: relative;
          width: 600px;
          height: 300px;
          background: #387D7A;
          box-shadow: 6px 6px rgba(0, 0, 0, 0.5) inset;
          background: repeating-conic-gradient(from 45deg, #387D7A 0deg 90deg, #456B7A 90deg 180deg);
          background-size: 50px 50px;
        }
        
        .ball {
          display: flex;
          justify-content: center;
          align-items: center;
          width: 20px;
          .........完整代码请登录后点击上方下载按钮下载查看

网友评论0