css实例教程 一款纯css3实现的超炫动画背画特效


Posted in HTML / CSS onNovember 05, 2014

之前为大家介绍了很多款由纯css3实现的特效。今天要再给大家带来一款纯css3实现的超炫动画背画特效。代码非常简单,没有引用任何其它js代码。css代码也不多。效果非常炫。一起看下效果图:

css实例教程 一款纯css3实现的超炫动画背画特效

实现的代码:

html代码:

复制代码
代码如下:
<div class='fake-gif'>
<span class='stripe'></span><span class='stripe'></span><span class='stripe'></span>
<span class='stripe'></span><span class='stripe'></span><span class='stripe'></span>
<span class='stripe'></span><span class='stripe'></span><span class='stripe'></span>
<span class='stripe'></span><span class='stripe'></span><span class='stripe'></span>
<span class='stripe'></span><span class='stripe'></span><span class='stripe'></span>
<span class='stripe'></span><span class='stripe'></span><span class='stripe'></span>
<span class='stripe'></span><span class='stripe'></span><span class='stripe'></span>
<span class='stripe'></span><span class='stripe'></span><span class='stripe'></span>
<span class='stripe'></span><span class='stripe'></span>
</div>

css3代码:

复制代码
代码如下:
body{
background: #000;
-webkit-perspective:35px;
-moz-perspective:35px;
-ms-perspective:35px;
-o-perspective:35px;
perspective:35px;
-webkit-transform-style:preserve-3d;
-moz-transform-style:preserve-3d;
-ms-transform-style:preserve-3d;
-o-transform-style:preserve-3d;
transform-style:preserve-3d;
-webkit-transform: rotateX(45deg) rotateY(0deg) rotateZ(45deg);
-moz-transform:rotateX(45deg) rotateY(0deg) rotateZ(45deg);
-ms-transform:rotateX(45deg) rotateY(0deg) rotateZ(45deg);
-o-transform:rotateX(45deg) rotateY(0deg) rotateZ(45deg);
transform:rotateX(45deg) rotateY(0deg) rotateZ(45deg);
}

.fake-gif {
position: relative;
margin: 10rem auto 0 auto;
width: 20rem;
height: 20rem;</p> <p>
}
.fake-gif .stripe {
position: absolute;
border-radius: 50%;
-webkit-box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
-webkit-transform: translate3d(0px, 0px, 0px);
transform: translate3d(0px, 0px, 0px);
}
.fake-gif .stripe:nth-child(odd) {
left: 0;
width: 100%;
height: 5%;
background-color: rgba(109, 60, 209, 0.5);
box-shadow: 0px 6px 40px #5800FF, inset 0px 2px 5px #DF00FF;</p> <p>}
.fake-gif .stripe:nth-child(even) {
top: 0;
width: 5%;
height: 100%;
background-color: rgba(0, 240, 40, 0.5);
box-shadow: 0px 6px 40px #007D35, inset 0px 2px 5px #7CFFB5;
}
.fake-gif .stripe:nth-child(4n+1) {
z-index: 3;
}
.fake-gif .stripe:nth-child(4n+2) {
z-index: 4;
}
.fake-gif .stripe:nth-child(4n+3) {
z-index: 1;
}
.fake-gif .stripe:nth-child(4n) {
z-index: 2;
}
.fake-gif .stripe:nth-child(2) {
left: 4.7%;
-webkit-animation: move-y 2.7s 0.2s infinite;
animation: move-y 2.7s 0.2s infinite;
}
.fake-gif .stripe:nth-child(4) {
left: 11.9%;
-webkit-animation: move-y 2.7s 0.4s infinite;
animation: move-y 2.7s 0.4s infinite;
}
.fake-gif .stripe:nth-child(6) {
left: 19.1%;
-webkit-animation: move-y 2.7s 0.6s infinite;
animation: move-y 2.7s 0.6s infinite;
}
.fake-gif .stripe:nth-child(8) {
left: 26.3%;
-webkit-animation: move-y 2.7s 0.8s infinite;
animation: move-y 2.7s 0.8s infinite;
}
.fake-gif .stripe:nth-child(10) {
left: 33.5%;
-webkit-animation: move-y 2.7s 1s infinite;
animation: move-y 2.7s 1s infinite;
}
.fake-gif .stripe:nth-child(12) {
left: 40.7%;
-webkit-animation: move-y 2.7s 1.2s infinite;
animation: move-y 2.7s 1.2s infinite;
}
.fake-gif .stripe:nth-child(14) {
left: 47.9%;
-webkit-animation: move-y 2.7s 1.4s infinite;
animation: move-y 2.7s 1.4s infinite;
}
.fake-gif .stripe:nth-child(16) {
left: 55.1%;
-webkit-animation: move-y 2.7s 1.6s infinite;
animation: move-y 2.7s 1.6s infinite;
}
.fake-gif .stripe:nth-child(18) {
left: 62.3%;
-webkit-animation: move-y 2.7s 1.8s infinite;
animation: move-y 2.7s 1.8s infinite;
}
.fake-gif .stripe:nth-child(20) {
left: 69.5%;
-webkit-animation: move-y 2.7s 2s infinite;
animation: move-y 2.7s 2s infinite;
}
.fake-gif .stripe:nth-child(22) {
left: 76.7%;
-webkit-animation: move-y 2.7s 2.2s infinite;
animation: move-y 2.7s 2.2s infinite;
}
.fake-gif .stripe:nth-child(24) {
left: 83.9%;
-webkit-animation: move-y 2.7s 2.4s infinite;
animation: move-y 2.7s 2.4s infinite;
}
.fake-gif .stripe:nth-child(26) {
left: 91.1%;
-webkit-animation: move-y 2.7s 2.6s infinite;
animation: move-y 2.7s 2.6s infinite;
}
.fake-gif .stripe:nth-child(1) {
top: 3.6%;
-webkit-animation: move-x 2.7s 0.1s infinite;
animation: move-x 2.7s 0.1s infinite;
}
.fake-gif .stripe:nth-child(3) {
top: 10.8%;
-webkit-animation: move-x 2.7s 0.3s infinite;
animation: move-x 2.7s 0.3s infinite;
}
.fake-gif .stripe:nth-child(5) {
top: 18%;
-webkit-animation: move-x 2.7s 0.5s infinite;
animation: move-x 2.7s 0.5s infinite;
}
.fake-gif .stripe:nth-child(7) {
top: 25.2%;
-webkit-animation: move-x 2.7s 0.7s infinite;
animation: move-x 2.7s 0.7s infinite;
}
.fake-gif .stripe:nth-child(9) {
top: 32.4%;
-webkit-animation: move-x 2.7s 0.9s infinite;
animation: move-x 2.7s 0.9s infinite;
}
.fake-gif .stripe:nth-child(11) {
top: 39.6%;
-webkit-animation: move-x 2.7s 1.1s infinite;
animation: move-x 2.7s 1.1s infinite;
}
.fake-gif .stripe:nth-child(13) {
top: 46.8%;
-webkit-animation: move-x 2.7s 1.3s infinite;
animation: move-x 2.7s 1.3s infinite;
}
.fake-gif .stripe:nth-child(15) {
top: 54%;
-webkit-animation: move-x 2.7s 1.5s infinite;
animation: move-x 2.7s 1.5s infinite;
}
.fake-gif .stripe:nth-child(17) {
top: 61.2%;
-webkit-animation: move-x 2.7s 1.7s infinite;
animation: move-x 2.7s 1.7s infinite;
}
.fake-gif .stripe:nth-child(19) {
top: 68.4%;
-webkit-animation: move-x 2.7s 1.9s infinite;
animation: move-x 2.7s 1.9s infinite;
}
.fake-gif .stripe:nth-child(21) {
top: 75.6%;
-webkit-animation: move-x 2.7s 2.1s infinite;
animation: move-x 2.7s 2.1s infinite;
}
.fake-gif .stripe:nth-child(23) {
top: 82.8%;
-webkit-animation: move-x 2.7s 2.3s infinite;
animation: move-x 2.7s 2.3s infinite;
}
.fake-gif .stripe:nth-child(25) {
top: 90%;
-webkit-animation: move-x 2.7s 2.5s infinite;
animation: move-x 2.7s 2.5s infinite;
}</p> <p>@-webkit-keyframes move-y {
0%, 100% {
-webkit-transform: translateZ(-25px);
transform: translateZ(-25px);
}</p> <p> 50% {
-webkit-transform: translateZ(25px);
transform: translateZ(25px);
}
}</p> <p>@-webkit-keyframes move {
0%, 100% {
-webkit-transform: rotateX(-25deg) rotateY(-25deg);
transform: rotateX(-25deg) rotateY(-25deg);
}</p> <p> 50% {
-webkit-transform: rotateX(25px) rotateY(25deg);
transform: rotateX(25px) rotateY(25deg);
}
}</p> <p>@keyframes move-y {
0%, 100% {
-webkit-transform: translateY(-25%);
transform: translateY(-25%);
}</p> <p> 50% {
-webkit-transform: translateY(25%);
transform: translateY(25%);
}
}
@-webkit-keyframes move-x {
0%, 100% {
-webkit-transform: translateZ(-25px);
transform: translateZ(-25px);
}</p> <p> 50% {
-webkit-transform: translateZ(25px);
transform: translateZ(25px);
}
}
@keyframes move-x {
0%, 100% {
-webkit-transform: translateX(-25%);
transform: translateX(-25%);
}</p> <p> 50% {
-webkit-transform: translateX(25%);
transform: translateX(25%);
}
}

以上就是纯css3实现的超炫动画背画特效,是不是很简单,谢谢阅读,希望能帮到大家,请继续关注三水点靠木,我们会努力分享更多优秀的文章。
HTML / CSS 相关文章推荐
CSS3系列教程:背景图片(背景大小和多背景图) 应用说明
Dec 19 HTML / CSS
纯CSS3制作的简洁蓝白风格的登录模板(非IE效果更好)
Aug 11 HTML / CSS
使用CSS媒体查询(Media Queries)和JavaScript判断浏览器设备类型的方法
Apr 03 HTML / CSS
使用css3实现超炫的loading加载动画效果
May 07 HTML / CSS
css3实现冲击波效果的示例代码
Jan 11 HTML / CSS
css3实现椭圆轨迹旋转的示例代码
Oct 29 HTML / CSS
CSS3实现时间轴特效
Nov 02 HTML / CSS
Html5新增标签与样式及让元素水平垂直居中
Jul 11 HTML / CSS
解决html5中video标签无法播放mp4问题的办法
May 07 HTML / CSS
HTML5实现移动端复制功能
Apr 19 HTML / CSS
Html5移动端适配IphoneX等机型的方法
Jun 25 HTML / CSS
一款纯css3实现的非常实用的鼠标悬停特效演示
Nov 05 #HTML / CSS
利用css3实现的简单的鼠标悬停按钮
Nov 04 #HTML / CSS
一款简洁的纯css3代码实现的动画导航
Oct 31 #HTML / CSS
一款纯css3实现的响应式导航
Oct 31 #HTML / CSS
CSS3提交意见输入框样式代码
Oct 30 #HTML / CSS
css3实例教程 一款纯css3实现的环形导航菜单
Oct 20 #HTML / CSS
在HTML5中如何使用CSS建立不可选的文字
Oct 17 #HTML / CSS
You might like
用php简单实现加减乘除计算器
2014/01/06 PHP
PHP函数in_array()使用详解
2014/08/20 PHP
php+mysqli实现将数据库中一张表信息打印到表格里的方法
2015/01/28 PHP
[原创]CI(CodeIgniter)简单统计访问人数实现方法
2016/01/19 PHP
PHP删除二维数组中相同元素及数组重复值的方法示例
2017/05/05 PHP
PHP异常处理定义与使用方法分析
2017/07/25 PHP
PHP对象的浅复制与深复制的实例详解
2017/10/26 PHP
基于jquery的图片懒加载js
2010/06/30 Javascript
javascript写的日历类(基于pj)
2010/12/28 Javascript
JavaScript验证电子邮箱的函数
2014/08/22 Javascript
javascript实现输出指定行数正方形图案的方法
2015/08/03 Javascript
JS实现新浪博客左侧的Blog管理菜单效果代码
2015/10/22 Javascript
javascript对象的创建和访问
2016/03/08 Javascript
基于Angularjs实现分页功能
2016/05/30 Javascript
JavaScript的instanceof运算符学习教程
2016/06/08 Javascript
利用jQuery的动画函数animate实现豌豆发射效果
2016/08/28 Javascript
bootstrap的常用组件和栅格式布局详解
2017/05/02 Javascript
ES6 javascript中class静态方法、属性与实例属性用法示例
2017/10/30 Javascript
vue组件name的作用小结
2018/05/23 Javascript
JS数据类型STRING使用实例解析
2019/12/18 Javascript
纯JS开发baguetteBox.js响应式画廊插件
2020/06/28 Javascript
[02:07]TI9显影之尘系列 - Vici Gaming
2019/08/20 DOTA
Python中的文件和目录操作实现代码
2011/03/13 Python
利用Python实现Windows定时关机功能
2017/03/21 Python
用 Python 爬了爬自己的微信朋友(实例讲解)
2017/08/25 Python
python中学习K-Means和图片压缩
2017/11/20 Python
numpy实现合并多维矩阵、list的扩展方法
2018/05/08 Python
基于windows下pip安装python模块时报错总结
2018/06/12 Python
matplotlib调整子图间距,调整整体空白的方法
2018/08/03 Python
Python学习之路之pycharm的第一个项目搭建过程
2020/06/18 Python
详解Python多线程下的list
2020/07/03 Python
澳大利亚百货商店中销量第一的商务衬衫品牌:Van Heusen
2018/07/26 全球购物
大学生简单自荐信
2013/11/10 职场文书
家长给孩子的评语
2014/01/30 职场文书
机动车交通事故协议书
2015/01/29 职场文书
Python 全局空间和局部空间
2022/04/06 Python