美文网首页
css loading

css loading

作者: 真是个非常帅气的昵称呢 | 来源:发表于2021-01-21 11:20 被阅读0次
    <!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>Document</title>
      <style>
        #loading{
          width: 50px;
          height: 50px;
          border: 3px solid lightblue;
          border-top-color: lightcoral;
          border-radius: 50%;
          animation: rotateloading 1s infinite;
        }
        @keyframes rotateloading {
          0%{
            transform: rotate(0deg);
          }
          100%{
            transform: rotate(360deg);
          }
        }
        .loading-svg{
          width: 100px;
          height: 100px;
          background-color: lightgray;
          animation: loading-rotate 1.5s infinite ease-in-out;
        }
        .path{
          stroke: #409eff;
          stroke-width: 2;
          animation: loading-dash 1.5s ease-in-out infinite;
        }
        @keyframes loading-rotate {
          to{
            transform: rotate(1turn);
          }
        }
        @keyframes loading-dash {
          0%{
            stroke-dasharray: 1,126;
            stroke-dashoffset: 0;
          }
          50%{
            stroke-dasharray: 95,126;
            stroke-dashoffset: -31px;
          }
          to{
            stroke-dasharray: 6,120;
            stroke-dashoffset: -120px;
          }
        }
      </style>
    </head>
    <body>
      <svg viewBox="0 0 50 50" class="loading-svg">
        <Circle cx="25" cy="25" r="20" fill="none" class="path"></Circle>
      </svg>
    
    
    
    
      <div id="loading"></div>
    </body>
    </html>
    

    相关文章

      网友评论

          本文标题:css loading

          本文链接:https://www.haomeiwen.com/subject/yamrzktx.html