【CSS3】用纯CSS实现加载中动画效果
2017-03-17 15:33
751 查看
演示效果:
HTML代码:
CSS代码:
HTML代码:
<div class="pswp__preloader__icn"> <div class="pswp__preloader__cut"> <div class="pswp__preloader__donut"></div> </div> </div>
CSS代码:
body{background:#fff;} .pswp__preloader__icn { opacity:0.75; width: 24px; height: 24px; -webkit-animation: clockwise 500ms linear infinite; animation: clockwise 500ms linear infinite; } /* The idea of animating inner circle is based on Polymer loading indicator by Keanu Lee https://blog.keanulee.com/2014/10/20/the-tale-of-three-spinners.html */ .pswp__preloader__cut { position: relative; width: 12px; height: 24px; overflow: hidden; position: absolute; top: 0; left: 0; } .pswp__preloader__donut { box-sizing: border-box; width: 24px; height: 24px; border: 2px solid #000; border-radius: 50%; border-left-color: transparent; border-bottom-color: transparent; position: absolute; top: 0; left: 0; background: none; margin:0; -webkit-animation: donut-rotate 1000ms cubic-bezier(.4,0,.22,1) infinite; animation: donut-rotate 1000ms cubic-bezier(.4,0,.22,1) infinite; } @-webkit-keyframes clockwise { 0% { -webkit-transform: rotate(0deg) } 100% { -webkit-transform: rotate(360deg) } } @keyframes clockwise { 0% { transform: rotate(0deg) } 100% { transform: rotate(360deg) } } @-webkit-keyframes donut-rotate { 0% { -webkit-transform: rotate(0) } 50% { -webkit-transform: rotate(-140deg) } 100% { -webkit-transform: rotate(0) } } @keyframes donut-rotate { 0% { transform: rotate(0) } 50% { transform: 4000 rotate(-140deg) } 100% { transform: rotate(0) } } body{margin:40px}
相关文章推荐
- 使用CSS3实现超炫的Loading(加载)动画效果
- 使用CSS3实现超炫的Loading(加载)动画效果
- css3 | 中的animation/@keyframes xz动画效果-如何使用纯css实现动画效果? 用法:animation:xz 3s 2 4s alternate; 参数:animati
- CSS3实现的图片加载动画效果
- 使用 CSS3 实现超炫的 Loading(加载)动画效果以及cs3的在线制作工具
- 8款使用 CSS3 实现超炫的 Loading(加载)的动画效果
- 通过JS和CSS,实现网页加载中的动画效果
- 利用css换行技术实现加载中动画效果
- css3实现三种不同的loading加载动画效果
- 使用 CSS3 实现超炫的 Loading(加载)动画效果
- 使用 CSS3 实现超炫的 Loading(加载)动画效果
- 使用 CSS3 实现超炫的 Loading(加载)动画效果
- css3实现三种不同的loading加载动画效果
- 使用 CSS3 实现超炫的 Loading(加载)动画效果
- 使用 CSS3 实现超炫的 Loading(加载)动画效果
- 使用 CSS3 实现超炫的 Loading(加载)动画效果
- 10个CSS和jQuery的加载中(loading)动画效果实现
- CSS3实现的图片加载动画效果
- CSS3实现的图片加载动画效果
- JS+CSS实现网页加载中的动画效果