css3动画(animation)效果3-正方体合成
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>旋转的星球</title>
<style type="text/css">
ul{
margin: 0;
padding: 0;
list-style: none;
}
.box{
height: 100px;
width: 100px;
perspective: 500px;
margin: 50px 0 0 50px;
}
.list{
position: relative;
height: 100px;
width: 100px;
background-color: blue;
transform-style: preserve-3d;
transform-origin: 0 0 0;
animation: rotate 1s 10s 3 both linear;
}
.in{
position: absolute;
height: 100px;
width: 100px;
}
.list .in:nth-child(6){
background-color: pink;
transform-origin: top;
animation: in6 2s both;
}
.list .in:nth-child(5){
background-color: lightgreen;
transform-origin: right;
animation: in5 2s 2s both;
}
.list .in:nth-child(4){
background-color: lightblue;
transform-origin: bottom;
animation: in4 2s 4s both;
}
.list .in:nth-child(3){
background-color: lightcoral;
transform-origin: left;
animation: in3 2s 6s both;
}
.list .in:nth-child(2){
background-color: lightcyan;
animation: in2 2s 8s both;
}
.list .in:nth-child(1){background-color: lightsalmon;}
.box:hover .list{animation-play-state: paused;}
.box:hover .in{animation-play-state: paused;}
@keyframes in6{100%{transform: rotateX(90deg);}}
@keyframes in5{100%{transform: rotateY(90deg);}}
@keyframes in4{100%{transform: rotateX(-90deg);}}
@keyframes in3{100%{transform: rotateY(-90deg);}}
@keyframes in2{100%{transform: translateZ(100px);}}
@keyframes rotate{100%{transform: rotate3d(1,1,1,360deg);}}
</style>
</head>
<body>
<div class="box">
<ul class="list" id="list">
<li class="in"></li>
<li class="in"></li>
<li class="in"></li>
<li class="in"></li>
<li class="in"></li>
<li class="in"></li>
</ul>
</div>
<script type="text/javascript">
list.addEventListener('animationend',function(e){
e = e || event;
var target = e.target || e.srcElement;
if(target.nodeName == 'UL'){
list.style.animationName = 'none';
var children = list.getElementsByTagName('li');
for(var i = 0; i < children.length;i++){
children[i].style.animationName = 'none';
}
setTimeout(function(){
list.style.animationName = 'rotate';
var children = list.getElementsByTagName('li');
for(var i = 0; i < children.length;i++){
children[i].style.animationName = 'in' + (i+1);
}
},100);
}
},false);
</script>
<strong>【简要介绍】</strong>
<p>该效果主要通过设置计算后的延迟时间来达到正方体的各个边顺序动画的效果。一次动画结束后,通过触发animationend事件重置animation-name来实现重复动画的效果</p>
</body>
</html>
效果图:


原链接:https://www.cnblogs.com/xiaohuochai/p/5419236.html
css3动画(animation)效果3-正方体合成的更多相关文章
- 前端CSS3动画animation用法
前端CSS3动画animation用法 学习如下动画属性 @keyframes animation-name animation-duration animation-delay animation- ...
- CSS3 动画animation
关键帧 什么是关键帧.一如上面对Flash原理的描述一样,我们知道动画其实由许多静态画面组成,第一个这样的静态画面可以表述为一帧.其中关键帧是在动画过程中体现了物理明显变化的那些帧. 比如之前的例子中 ...
- css3 动画(animation)-简单入门
css3之动画(animation) css3中我们可以使用动画,由于取代以前的gif图片,flash动画,以及部分javascript代码(相信有很多同学都用过jquery中的animate方法来做 ...
- CSS3 动画 animation和@keyframes
CSS3 @keyframes 规则 如需在 CSS3 中创建动画,您需要学习 @keyframes 规则. @keyframes 规则用于创建动画.在 @keyframes 中规定某项 CSS 样式 ...
- CSS3动画animation认识,animate.css的使用
CSS动画 可以取代js动画 在移动端会更加流畅! 下面是一个的绘制太阳系各大行星运行轨迹笔记,可以自学参考! -------------------------------------------- ...
- css3动画animation
动画:animation animations这物似乎还是只在webkit,moz核心的浏览器上起作用 <!DOCTYPE html><html lang="en&qu ...
- CSS3 动画Animation的8大属性
animation复合属性.检索或设置对象所应用的动画特效. 如果有多个属性值时以","隔开,适用于所有元素,包含伪对象:after和:before 1.animation-nam ...
- css3动画-animation
animation驱使一组css style变化到另外一组css style,它可以定义keyframes的集合,指定style的开始和结束状态,它是transition的增强. 配置animatio ...
- 最新的css3动画按钮效果
效果演示 插件下载
- 纯CSS3动画按钮效果
在线演示 本地下载
随机推荐
- 分别用js和css实现瀑布流
下午查找了瀑布流的相关原理,找了一些css3实现的还有js实现的,最后总结了一些比较简单的,易懂的整理起来 1.css3实现 只要运用到 column-count分列 column-width固 ...
- 10 华电内部文档搜索系统 search04
上一节我们着重讲解了权限过滤器的使用.这一节讲解一下补充一下Struts 2下面对应的Checkbox的使用.对索引下面的数据进行维护操作,一次可以删除多个.在Struts 2下面使用对应的Check ...
- Chrome谷歌浏览器屏蔽百度搜索右侧广告推荐方法
先上图百度广告,其实屏蔽广告很简单 主要分成以下三步: 下载Adblock Plus插件 安装Adblock Plus插件 开启屏蔽 一.下载Adblock Plus插件(官网离线版) 二.安装Adb ...
- Python实现常见算法[1]——冒泡排序
#!/usr/bin/python def BUBBLE_SORT(L, x, y): j = y while j>x: i = x while i<j: if L[i] > L[i ...
- DBArtist之Oracle入门第3步: 安装配置PL/SQL Developer
操作系统: WINDOWS 7 (64位) 数据库: Oracle 11gR2 (64位) PL/SQL Developer : PL/SQL ...
- Log4J的配置文件详解
来自: http://www.blogjava.net/zJun/archive/2006/06/28/55511.html Log4J的配置文件(Configuration File)就是用来设置记 ...
- Cloudstack4.2之改变数据卷容量的大小(Resize Data Volumes)
下图标注了这个功能在cloudstack4.2 UI中的位置 在cloudstack中是通过磁盘服务来设定卷的大小的.管理员可以设置相应的磁盘服务以供用户来使用.为了增强系统的灵活性,方便最终用户的使 ...
- 2-字符串模拟- URL映射
问题描述 试题编号: 201803-3 试题名称: URL映射 时间限制: 1.0s 内存限制: 256.0MB 问题描述: 问题描述 URL 映射是诸如 Django.Ruby on Rails 等 ...
- python用sqlite3模块操作sqlite数据库-乾颐堂
SQLite是一个包含在C库中的轻量级数据库.它并不需要独立的维护进程,并且允许使用非标准变体(nonstandard variant)的SQL查询语句来访问数据库. 一些应用可是使用SQLite保存 ...
- 关于更新vs2017后发布的问题 命令“bower install”已退出,代码为 9009
更新vs2017 尝试发布 出现 命令“bower install”已退出,代码为 9009 然后我点工具测试了一下nodejs 出现下图弹窗 百度了一下 没找到对策,有没有大侠知道怎么解决 解决 ...