图标元素动画效果
来源:互联网 发布:手机游戏变速软件 编辑:程序博客网 时间:2024/06/07 23:28
一、HTML
<span class="home icon">Home</span>
<span class="search icon">Search</span>
<span class="user icon">User</span>
<span class="mail icon">Mail</span>
<span class="chat icon">Chat</span>
二、CSS
@font-face {
font-family: 'icon-font';
src: url('font/flat-ui-icons-regular.ttf'), url('font/flat-ui-icons-regular.eot'),
url('font/flat-ui-icons-regular.woff'), url('font/flat-ui-icons-regular.svg');
}
.icon{
/*使span中的文字不显示*/
font-size:0px;
cursor: pointer;
display:inline-block;
position:relative;
width:100px;
height:100px;
/*显示圆形背景*/
border-radius:50%;
background:#FFF;
margin-right:20px;
/*显示圆形背景*/
-webkit-animation:move 1s cubic-bezier(.62,-0.91,.45,1.97);
animation:move 1s cubic-bezier(.62,-0.91,.45,1.97);
/*动画完成后元素保留第一帧的状态*/
/*因为最后一帧为直接不透明且,动画开始后直接透明,导致图片闪现*/
/*通过设置animation-fill-mode:both;或backwards解决,使最后动画恢复第一帧状态*/
-webkit-animation-fill-mode: both;/*backwards*/
animation-fill-mode: both;
}
.icon::before{
content:"\e609";
font-family: 'icon-font';
/*不能让辅助设备读取*/
speak: none;
font-size:50px;
text-align:center;
display:block;
box-sizing:border-box;
line-height:100px;
color:#8b8ab3;
}
/*每张图标依次出现*/
.home{
-webkit-animation-delay:0s;
animation-delay:0s;
}
.search{
-webkit-animation-delay:.1s;
animation-delay:.1s;
}
.user{
-webkit-animation-delay:.2s;
animation-delay:.2s;
}
.mail{
-webkit-animation-delay:.3s;
animation-delay:.3s;
}
.chat{
-webkit-animation-delay:.4s;
animation-delay:.4s;
}
/*图标*/
.home::before{
content:"\e62e";
}
.search::before{
content:"\e630";
}
.user::before{
content:"\e631";
}
.mail::before{
content:"\e632";
}
.chat::before{
content:"\e62d";
}
/*图标从下至上运动*/
@-webkit-keyframes 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%);
}
}
- 图标元素动画效果
- SharedElement共享元素动画效果
- iOS 图标上下浮动的动画效果
- 《js动画效果》之获取元素属性
- 《js动画效果》之获取元素属性
- JS中元素动画效果Transform属性
- jQquery :animated 给没有动画效果的元素添加动画
- VC如何作出有动画效果的托盘图标
- 使用CSS3 Translation为社会化图标添加动画效果
- 关于Android使用ActionBarDrawerToggle时导航图标没有动画效果
- iOS开发中动画之点赞图标放大效果
- 点击页面上某个元素实现动画的滚动效果
- Jqurey 在显示或隐藏元素时的动画效果
- js 交换两个元素的位置,动画效果
- Android Launcher3 禁止用户拖动图标创建文件夹,控制拖动图标到另一个图标时的动画效果
- 动画效果
- 动画效果
- 动画效果
- 学习笔记之Java7中的ForkJoin并发框架初探(下)—— ForkJoin的应用
- PHP 正则取 url 参数
- Gstreamer插件教程2.3—编写一个插件(Writing a Plugin):chain函数(The chain function)
- SQL Server 查询所有外键子父表关系
- 单片机周期的概念
- 图标元素动画效果
- 周易六十四卦—水泽节卦
- JavaScript练习之图片切换
- ActionMode 就记这么一点,不能更多了
- 学习笔记之ByteBuffer使用和实现以及文件内存映射
- 微信小程序的五大特征(一)
- 学习笔记之ConcurrentLinkedQueue源码分析整理
- 学习笔记之BlockingQueue及其各个实现的分析整理
- C语言strtod()函数:将字符串转换为double