CSS3 @keyframes 实现匀速旋转魔方(搬运工)
原博文 * https://www.cnblogs.com/shihao905/p/6208324.html
* html
<div id="wrap">
<div class="wrap">
<div class="red">
</div>
<div class="blue">
</div>
<div class="green">
</div>
<div class="orange">
</div>
<div class="white">
</div>
<div class="yellow">
</div>
</div>
</div>
* css
@keyframes box {
0% {
transform: rotatex(0deg) rotateY(0deg) rotateZ(0deg);
}
100% {
transform: rotatex(360deg) rotateY(360deg) rotateZ(360deg);
}
}
#wrap {
width: 400px;
height: 400px;
padding: 100px;
margin: 150px auto;
perspective: 1200px;
}
.wrap {
width: 400px;
height: 400px;
transition: 5s;
transform-style: preserve-3d;
position: relative;
animation: box 10s linear infinite;
transform-origin: center center -200px;
;
}
.wrap div:nth-of-type(1) {
position: absolute;
background: #fe0000;
background-image: url('http://img1.gtimg.com/tj/pics/hv1/117/208/2153/140051982.jpg');
right: -400px;
top: 0;
transform: rotateY(90deg);
transform-origin: left;
}
.wrap div:nth-of-type(2) {
position: absolute;
background: #0000fe;
background-image: url('https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=841408372,3004217725&fm=11&gp=0.jpg');
bottom: -400px;
left: 0;
transform: rotatex(-90deg);
transform-origin: top;
}
.wrap div:nth-of-type(3) {
position: absolute;
background: #00ff01;
background-image: url('https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=2388632836,3966607624&fm=26&gp=0.jpg');
bottom: 0px;
left: 0;
backface-visibility: hidden;
}
.wrap div:nth-of-type(4) {
position: absolute;
background: #ff610a;
background-image: url('https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=192610795,467565159&fm=26&gp=0.jpg');
bottom: 0px;
left: -400px;
transform: rotateY(-90deg);
transform-origin: right;
}
.wrap div:nth-of-type(5) {
position: absolute;
background: #fff;
background-image: url("https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=2936477803,4198185787&fm=15&gp=0.jpg");
top: -400px;
left: 0;
transform: rotatex(90deg);
transform-origin: bottom;
}
.wrap div:nth-of-type(6) {
position: absolute;
background: #ffff00;
background-image: url('http://img0.pclady.com.cn/pclady/1611/02/1612285_jyz.jpg');
bottom: 0px;
left: 0;
transform: translateZ(-400px);
}
.wrap div {
border-radius: 4px;
overflow: hidden;
width: 400px;
height: 400px;
}
CSS3 @keyframes 实现匀速旋转魔方(搬运工)的更多相关文章
- CSS动画之旋转魔方轮播
很久没有回头来复习CSS方面的知识了, 正好又到了月底写文章的deadline......所以这次选择了详细巩固一下CSS3动画有关的知识点,因为之前只是用过一些属性并没有深究细节. 在我自己写完这篇 ...
- 纯CSS做3D旋转魔方
昨天偶然看见网友(简单说 用CSS做一个魔方旋转的效果)做的一个3D旋转魔方 效果就是本博客右侧公告栏所示 在这里把做法展现出来 感兴趣的可以试试 做成自己特有的魔方 <!DOCTYPE h ...
- 用css3实现摩天轮旋转的动画效果
用css3实现摩天轮旋转的动画效果 1.CSS3 @keyframes 规则如需在 CSS3 中创建动画,您需要学习 @keyframes 规则.@keyframes 规则用于创建动画.在 @keyf ...
- 基于css3的3D立方体旋转特效
今天给大家分享一款基于css3的3D立方体旋转特效.这款特效适用浏览器:360.FireFox.Chrome.Safari.Opera.傲游.搜狗.世界之窗. 不支持IE8及以下浏览器.效果图如下 : ...
- CSS3 @keyframes 规则
今天来给大家分享一下CSS3 @keyframes 规则! 在你了解CSS3 @keyframes 规则时我先来给大家说说什么是css3中的动画 动画是使元素从一种样式逐渐变化为另一种样式的效果. 您 ...
- 纯css3实现的圆形旋转分享按钮
之前已经为大家介绍了好几款css3按钮,今天要为大家介绍的是一款纯css3实现的圆形旋转分享按钮.旋转的角度可以自己调整.在demo中演示了三个角度旋转.360度,60度,-360度.如图: 在线预览 ...
- 一款基于css3鼠标经过圆形旋转特效
今天给大家分享一款基于css3鼠标经过圆形旋转特效.当鼠标经过的时候图片边框颜色旋转,图片显示详情.该实例适用浏览器:IE8.360.FireFox.Chrome.Safari.Opera.傲游.搜狗 ...
- CSS3实现3D木块旋转动画
CSS3实现3D木块旋转动画,css3特效,旋转动画,3D,立体效果,CSS3实现3D木块旋转动画是一款迷人的HTML5+CSS3实现的3D旋转动画. 代码下载:http://www.huiyi8.c ...
- Android中让View匀速旋转
项目需求,需要一个实现一个单帧的旋转动画,来提示当前进度,类似与圆圈型的progressbar. 首先定义anim文件: [html] view plaincopyprint? 1. < ...
随机推荐
- spring 手动注册bean
//将applicationContext转换为ConfigurableApplicationContext ConfigurableApplicationContext configurableAp ...
- C++入门经典-例2.4-使用scanf格式输入函数得到用户输入的数据
1:puts函数可以输出提示信息的字符串. 2:代码如下: // 2.4.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" int main( ...
- 套接字选项 之 SO_REUSEADDR && SO_REUSEPORT
说明 本文下面内容基本上是截取自stackoverflow,针对这两个选项,在另外一篇文章中做了总结,请移步<Linux TCP套接字选项 之 SO_REUSEADDR && S ...
- 套接字之send系统调用
send系统调用只是对sendto系统调用进行了封装,传递的参数不包含目的地址信息,数据会发送到已经建立连接的另一端的地址: /* * Send a datagram down a socket. * ...
- 【Linux】单计算机安装PBS系统(Torque)与运维
1.此次使用torque-5.0.0-1_43d8f09a.tar.gz这个版本http://www.adaptivecomputing.com/downloading/?file=/torque/t ...
- 【Introduction】R语言入门关键小结
写在前面:本博客为本人原创,严禁任何形式的转载!本博客只允许放在博客园(.cnblogs.com),如果您在其他网站看到这篇博文,请通过下面这个唯一的合法链接转到原文! 本博客全网唯一合法URL:ht ...
- html 绘图
<html> <head> <title>canvas绘制图形</title> <style> body{ margin: 0px; pad ...
- Spring MVC三种返回方式
spring mvc处理方法支持如下的返回方式:ModelAndView, Model, ModelMap, Map,View, String, void. 下面一一进行说明: 1.ModelAndV ...
- UEditor富文本编辑器时,插入图片没有任何反应
1.信息: Unable to find 'struts.multipart.saveDir' property setting. Defaulting to javax.servlet.contex ...
- 报错:Original error: Could not proxy command to remote server. Original error: Error: read ECONNRESET
问题:Appium的android真机启动手机时,会遇到以下问题: An unknown server-side error occurred while processing the command ...