css3 - 图标元素动画效果5 - 弹性动画效果
2017-05-08 18:35
423 查看
在线演示(刷新一下动画效果明显)
让图标运动到终点时,并非减速停止在终点,而是到达终点后继续向上运动,超过一定距离后再反方向运动到终点,形成一种往复的效果。
我们可以使用帧动画来实现这样的效果,但是如果使用速度曲线(贝塞尔曲线)将更为简便。
html:
css:
让图标运动到终点时,并非减速停止在终点,而是到达终点后继续向上运动,超过一定距离后再反方向运动到终点,形成一种往复的效果。
我们可以使用帧动画来实现这样的效果,但是如果使用速度曲线(贝塞尔曲线)将更为简便。
html:
<div class="box icon1"> <i class="fa fa-home fa-4x"></i> </div> <div class="box icon2"> <i class="fa fa-search fa-4x"></i> </div> <div class="box icon3"> <i class="fa fa-qq fa-4x"></i> </div> <div class="box icon4"> <i class="fa fa-envelope-o fa-4x"></i> </div>
css:
body {background-color: pink;} .box { cursor: pointer; display: inline-block; width: 100px; height: 100px; border-radius: 50%; background-color: #96CEB4; position: relative; margin-right: 20px; -webkit-animation-fill-mode: both; /*解决动画闪现问题,具体参考见上一篇*/ animation-fill-mode: both; -webkit-animation: move 1s cubic-bezier(.62,-0.91,.45,1.97);/*弹性动画*/ animation: move 1s cubic-bezier(.62,-0.91,.45,1.97); } i { color: #FFEEAD; font-size: 48px; position: absolute; top: 16%; left: 20%; } /*定义动画*/ @-webkit-keyframes move { /*兼容性写法。move是关键帧的动画名称*/ from { /*动画起始状态*/ opacity: 0; -webkit-transform: translateY(100%); } to { /*动画结束状态*/ opacity: 1; -webkit-transform: translateY(0%); } } @keyframes move { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: translateY(0%); } } /*动画延迟*/ .icon1 { -webkit-animation-delay: 0s; animation-delay: 0s; } .icon2 { -webkit-animation-delay: .1s; animation-delay: .1s; } .icon3 { -webkit-animation-delay: .2s; animation-delay: .2s; } .icon4 { -webkit-animation-delay: .3s; animation-delay: .3s; }
相关文章推荐
- css3 - 图标元素动画效果3 - 图标整体在Y轴上移
- css3 - 图标元素动画效果1 - 只执行一次动画
- css3 - 图标元素动画效果4 - 动画延迟
- css3 - 图标元素动画效果2 - 动画无限循环、循环一定次数、反向动画
- <html5+css3+js>用javascript显示隐藏,添加,删除元素,css动画效果
- css3 - 按钮元素动画效果
- css3 实现一个改变元素属性实现的动画效果
- Html+CSS3技术实现动画、天气图标动态效果 效果很酷
- 使用 SVG 动画实现弹性的页面元素效果
- 使用CSS3 Translation为社会化图标添加动画效果
- CSS3中Animation为同一个元素添加多个动画效果
- 酷炫的css3图标loading动画效果代码
- css3动画与动效--按钮元素动画效果
- tween.js是一款可生成平滑动画效果的js动画库。tween.js允许你以平滑的方式修改元素的属性值。它可以通过设置生成各种类似CSS3的动画效果。
- 图标元素动画效果
- SVG 动画实现弹性的页面元素效果
- CSS3使用AnimationEnd为同一个元素添加多个动画效果
- css3中变形函数(同样是对元素来说的)和元素通过改变自身属性达到动画效果
- CSS3 animation 动画效果
- css3动画效果