Giter Club home page Giter Club logo

Comments (10)

hellojackhui avatar hellojackhui commented on May 15, 2024 2

svg实现方案

<svg classname="loading" viewbox="25 25 50 50">
  <circle cx="50" cy="50" r="25" classname="path" fill="none" />
</svg>
.loading {
  width: 50px;
  height: 50px;
  animation: rotate 2s linear 0s infinite;
}
.path {
  animation: dash 2s ease-in-out infinite;
  stroke: #00b390;
  stroke-width: 2;
  stroke-dasharray: 90 150;
  stroke-dashoffset: 0;
  stroke-linecap: round;
}

@keyframes rotate {
  from {
    tranform: rotate(0deg);
  } 
  to {
    tranform: rotate(360deg);
  }
}

@keyframes dash {
  0% {
    stroke-dasharray:  1 150;
    stroke-dashoffset: 0;
  } 
  50% {
    stroke-dasharray: 90 150;
    stroke-dashoffset: -40px;
  }
  100% {
    stroke-dasharray: 90 150;
    stroke-dashoffset: -120px;
  }
}

from daily-question.

chen-rongliang avatar chen-rongliang commented on May 15, 2024

svg比较实在

from daily-question.

jak983464779 avatar jak983464779 commented on May 15, 2024

transform 单词写错了吧

from daily-question.

chen-rongliang avatar chen-rongliang commented on May 15, 2024

transform 单词写错了吧

应该是,随手写的,没留意拼写。

from daily-question.

02220 avatar 02220 commented on May 15, 2024

我直接copy,把错的单词更改了也不效果

from daily-question.

chen-rongliang avatar chen-rongliang commented on May 15, 2024

我直接copy,把错的单词更改了也不效果

IDE补全多填了些文字....你把svg和circle的classname改成class就好了

from daily-question.

02220 avatar 02220 commented on May 15, 2024

我直接copy,把错的单词更改了也不效果

IDE补全多填了些文字....你把svg和circle的classname改成class就好了

尴尬了,这么低级的错误

from daily-question.

hwb2017 avatar hwb2017 commented on May 15, 2024

通过svg实现的简单Loading动画
https://codepen.io/hwb2017/pen/XWgNVyr

from daily-question.

Indusy avatar Indusy commented on May 15, 2024

用的伪元素
https://codepen.io/indusy/pen/BaYmBXo

from daily-question.

Tsukishima1 avatar Tsukishima1 commented on May 15, 2024

写了三个简单的loading作参考
https://codepen.io/Tsukishima1/pen/MWRqdgJ

from daily-question.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.