150个带动画效果的SVG扁平风格图标

这是一组基于SVG制作的精美动画图标。这组图标共150个,分为6大类。这些图标都是扁平风格的图标,有一些还带有长阴影效果,所有的图标在鼠标滑过时都带有一定的动画效果。

使用方法

在线预览   源码下载

HTML结构

这些SVG图标都使用<span>元素作为容器,通过jQuery来动态添加SVG表签。例如浏览器图标的HTML代码为:

<span class="svg-icon flat-filled" id="filled-browser"></span>          
JavaScript

在这个DEMO中,SVG图标的代码都是通过jQuery来动态添加的。你也可以将这些SVG代码直接添加到<span>容器中。

var browserFilled = " <svg class=‘flat_icon‘ xmlns=‘http://www.w3.org/2000/svg‘ width=‘100px‘ height=‘100px‘ viewBox=‘0 0 100 100‘ ><path class=‘circle‘ d=‘M50,2.125c26.441,0,47.875,21.434,47.875,47.875S76.441,97.875,50,97.875C17.857,97.875,2.125,76.441,2.125,50S23.559,2.125,50,2.125z‘/><g class=‘icon‘><path class=‘base‘ d=‘M28.692,24.431h42.615c2.353,0,4.262,1.908,4.262,4.262v42.615c0,2.354-1.909,4.262-4.262,4.262H28.692c-2.354,0-4.262-1.908-4.262-4.262V28.692C24.431,26.338,26.339,24.431,28.692,24.431z‘/><path class=‘screen‘ d=‘M27.982,38.637h44.036v32.672H27.982V38.637z‘/><path class=‘top‘ d=‘M24.431,24.431h51.139v11.364H24.431V24.431z‘/><path class=‘green‘ d=‘M47.159,27.271c1.57,0,2.841,1.273,2.841,2.841s-1.271,2.841-2.841,2.841c-1.569,0-2.841-1.272-2.841-2.841S45.589,27.271,47.159,27.271z‘/><path class=‘orange‘ d=‘M38.344,27.271c1.569,0,2.841,1.273,2.841,2.841s-1.271,2.841-2.841,2.841s-2.841-1.272-2.841-2.841S36.776,27.271,38.344,27.271z‘/><path class=‘red‘ fill=‘‘ d=‘M29.858,27.271c1.569,0,2.841,1.273,2.841,2.841s-1.272,2.841-2.841,2.841c-1.569,0-2.841-1.272-2.841-2.841S28.289,27.271,29.858,27.271z‘/></g></svg>"
$(browserFilled).appendTo(‘#filled-browser‘);         
CSS样式

SVG图标的动画效果通过CSS来完成。下面的代码中没有使用各个浏览器厂商的前缀。

#filled-browser .green { fill: #FFF }
#filled-browser .orange { fill: #FFF }
#filled-browser .red { fill: #FFF }
/* 鼠标滑过时修改浏览器的颜色 */
#filled-browser:hover .circle { fill: #B1EB5B }
#filled-browser:hover .screen { fill: #d6d6d6 }
#filled-browser:hover .base { fill: #b0b0b0 }
#filled-browser:hover .top { fill: #8F8F8F }
#filled-browser:hover .green { fill: #AEE42D }
#filled-browser:hover .orange { fill: #FFD02C }
#filled-browser:hover .red { fill: #E64545 }
/* 鼠标滑过时浏览器的动画 */
#filled-browser:hover .screen {
    animation-delay: 0.2s;
    animation-timing-function: linear;
    animation-iteration-count: 1;
    transform-origin: 50% 50%;
    animation-duration: .4s;
    animation-name: left;
}
#filled-browser:hover .base {
    animation-timing-function: linear;
    animation-iteration-count: 1;
    transform-origin: 50% 50%;
    animation-duration: .4s;
    animation-name: right;
}
#filled-browser:hover .top {
    animation-delay: 0.1s;
    animation-timing-function: linear;
    animation-iteration-count: 1;
    transform-origin: 50% 50%;
    animation-duration: .4s;
    animation-name: right-top;
}
#filled-browser:hover .green {
    animation-timing-function: linear;
    animation-iteration-count: 1;
    transform-origin: 50% 50%;
    animation-duration: .4s;
    animation-name: left-top;
}
#filled-browser:hover .orange {
    animation-delay: 0.05s;
    animation-timing-function: linear;
    animation-iteration-count: 1;
    transform-origin: 50% 50%;
    animation-duration: .4s;
    animation-name: left-top;
}
#filled-browser:hover .red {
    animation-timing-function: linear;
    transform-origin: 50% 50%;
    animation-duration: .4s;
    animation-name: left-top;
}
/* 帧动画 */
@keyframes left-top {
    0% { transform: translate(-100px, -100px) scale(3,3) }
    1% { transform: translate(-100px, -100px) scale(3,3) }
    100% { transform: translate(0px, 0px) scale(1,1) }
}
@keyframes right-top {
    0% { transform: translate(100px, -200px) scale(3,3) }
    1% { transform: translate(100px, -200px) scale(3,3) }
    100% { transform: translate(0px, 0px) scale(1,1) }
}
@keyframes right {
    0% { transform: translate(100px, 0px) }
    1% { transform: translate(100px, 0px) }
    100% { transform: translate(0px, 0px) }
}
@keyframes left {
    0% { transform: translate(-100px, 0px) }
    1% { transform: translate(-100px, 0px) }
    100% { transform: translate(0px, 0px) }
}          

各个SVG图标的完整实现代码请参考下载文件。

via:http://www.w2bc.com/article/114332

时间: 2024-08-30 08:12:43

150个带动画效果的SVG扁平风格图标的相关文章

Css3+jQuery打造的一款带动画效果的数字时钟

<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Css3+jQuery打造的一款带动画效果的数字时钟丨任E行F9行车记录仪|gopro官网|电影院座椅|</title> <style type="text/css&quo

/*带动画效果的hover*/

1 <!DOCTYPE html> 2 /*带动画效果的hover*/ 3 <html lang="en"> 4 <head> 5 <meta charset="UTF-8"> 6 <title>Title</title> 7 <style> 8 .ele{ 9 background-color: #dddddd;/*带动画效果的hover*/ 10 } 11 .ele:hover{

Android带动画效果的弹窗

在网络加载数据的时候通常需要很多时间,这个时候程序里面经常需要写一个提示正在加载数据的弹窗,这篇文章用两种方式实现带动画效果的Dialog:帧动画实现和GIF动态图实现,它们都能达到动画的效果 第一种.帧动画实现 自定义一个Dialog,先看一下布局文件dialog_animation.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width=

带动画效果的抽屉菜单栏

带动画效果的抽屉菜单栏 带动画效果的抽屉菜单栏,将android L 中drawer-indicator/back-arrow移植到低版本Android系统中. 下载地址:http://www.devstore.cn/code/info/960.html 运行截图:

带动画效果的jQuery手风琴

带动画效果的jQuery特效手风琴是一款带动画效果的手风琴作品,非常实用,可以用在新闻列表.FAQ等模块,默认的是打开第一个选项,查看其它的时候直接点击加号按钮就展开. 源码地址:http://www.huiyi8.com/sc/11120.html 带动画效果的jQuery手风琴

Android学习笔记(25):带动画效果的View切换ViewAnimator及其子类

ViewAnimator可以实现带动画效果的View切换,其派生的子类是一些带动画效果切换功能的组件. ViewAnimator支持的XML属性: Attribute Name Description android:animateFirstView 设置显示第一个View组件时是否使用动画 android:inAnimation 设置显示组件时使用的动画 android:outAnimation 设置隐藏组件时使用的动画 1. ViewSwitcher视图切换组件. 添加视图的方法: 由Vie

写一个android带动画效果的TabHost(类似微博客户端的切换效果)

先上图: 这个Layout是: <?xml version="1.0" encoding="UTF-8"?> <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="fill_parent" andro

CSS3+Jquery实现带动画效果的下拉选择框

CSS3+JQuery实现带动画效果的下拉选择框. 元素结构为: 1 <div class="box"> 2 <p>this is the first li</p> 3 <div id="blank"></div> 4 <ul> 5 <li class="selected">this is the first li</li> 6 <li >

收藏一个带动画效果的ScrollViewer以及ScrollBar的模板

原文:收藏一个带动画效果的ScrollViewer以及ScrollBar的模板 这里介绍一个带动画效果的ScrollViewer和ScrollBar,总共分为两个资源字典,直接拿来引用即可: 1 ScrollBarStyle.xaml <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft