

css3加载动画 - 好看的loading效果的实现
source link: https://www.fly63.com/article/detial/11184
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

扫一扫分享
loading效果在实际开发中是很常见的,尤其是在Ajax请求的时候,可以给用户一个很好的交互体验。
以前大部分web开发加载(loading)特效是采用gif图片形式展现,随着html5+css3技术的成熟,纯CSS3版本Loading加载动画效果已经可以比拟gif动画效果。
通过css3实现loading动画,主要用到的属性:
@keyframes:用于定义动画
animation:用于使用动画
代码如下
实现上述效果,我们首先定义一个div容器,里面包含4个空的div,然后定义rotate旋转的动画,对每个子div设置动画延迟进行实现。
<div class="load_3">
<div></div><div></div><div></div><div></div>
</div>
<style>
.load_3 {
display: inline-block;
position: relative;
width: 64px;
height: 64px;
}
.load_3 div {
box-sizing: border-box;
display: block;
position: absolute;
width: 51px;
height: 51px;
margin: 6px;
border: 6px solid #61E8EA;
border-radius: 50%;
animation: load_3 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
border-color: #61E8EA transparent transparent transparent;
}
.load_3 div:nth-child(1) {
animation-delay: -0.45s;
}
.load_3 div:nth-child(2) {
animation-delay: -0.3s;
}
.load_3 div:nth-child(3) {
animation-delay: -0.15s;
}
@keyframes load_3 {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style>
工具推荐
该工具共20多种不同的loading效果,全部使用animation帧动画制作而成。这些特效代码简洁,效果炫酷,非常值得学习借鉴。
地址:点击进入
Recommend
-
54
three-dots.css是一款CSS3 loading三圆点加载动画特效库。three-dots.css中集成了14种三圆点loading动画特效,以及三种增强动画效果。 查看演示
-
11
by zhangxinxu from http://www.zhangxinxu.com/wordpress/?p=5963 本文可全文转载,但需得到原作者书面许可,同时保留原作者和出处,摘要引流则随...
-
13
by zhangxinxu from http://www.zhangxinxu.com 本文地址:http://www.zhangxinxu.com/wordpress/?p=498...
-
12
昨天在简书上看到一篇文章,介绍了一个加载动画的实现过程 一款Loading动画的实现思路(一) 只可惜原动画是IOS上制作的,而看了一下,作者的实现思路比较复杂,于是趁着...
-
13
字体图标加鼠标悬停效果 CSS3 transition 属性transition 属性是一个简写属性,用于设置四个过渡属性: transition-property transition-duration transition-timing-function transition-delay
-
7
by zhangxinxu from http://www.zhangxinxu.com 本文地址:http://www.zhangxinxu.com/wordpress/?p=810...
-
8
7 种最棒的 Vue Loading 加载动画组件测评与推荐 - 穷尽市面上所有加载动画效果(Vue loader)类型 - 卡拉云 HiJiangChuan
-
6
来自程序员的浪漫_css3新年烟花效果更新日期: 2023-01-01阅读: 45标签: ...
-
4
CSS3实现的4种3D文字效果更新日期: 2023-01-04阅读: 14标签: 效果分...
-
10
OpenHarmony北向应用开发—做一个 loading加载动画 作者:离北况归 2023-04-11 09:12:31 作为一个OpenHarmony南向开发者,接触北向应用开发并不多。北向开发ArkUI老是改来改去,对笔者这样的入门选手来说学习成本其...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK