CSS3 3D图片立方体旋转
html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS3制作3D图片立方体旋转特效</title>
<link rel="stylesheet" href="3d.css">
</head>
<body>
<div class="wrap">
<div class="cube">
<div class="out_front">
<img src="img/1.png" class="pic">
</div>
<div class="out_back">
<img src="img/2.png" class="pic">
</div>
<div class="out_left">
<img src="img/3.png" class="pic">
</div>
<div class="out_right">
<img src="img/4.png" class="pic">
</div>
<div class="out_top">
<img src="img/5.png" class="pic">
</div>
<div class="out_bottom">
<img src="img/6.png" class="pic">
</div>
<span class="in_front">
<img src="img/7.png" class="in_pic">
</span>
<span class="in_back">
<img src="img/8.png" class="in_pic">
</span>
<span class="in_left">
<img src="img/9.png" class="in_pic">
</span>
<span class="in_right">
<img src="img/10.png" class="in_pic">
</span>
<span class="in_top">
<img src="img/11.png" class="in_pic">
</span>
<span class="in_bottom">
<img src="img/12.png" class="in_pic">
</span>
</div>
</div>
</body>
</html>
css
html{
background:linear-gradient(#ff0 0%,#000 80%);
height: 100%;
}
.wrap{
width: 650px;
height: 200px;
margin: 150px 360px;
position: relative;
}
.cube{
width: 200px;
height: 200px;
margin: 0 auto;
transform-style: preserve-3d;
transform: rotateX(-30deg) rotateY(-80deg);
-webkit-animation: rotate 20s infinite;
animation-timing-function: linear;
}
@-webkit-keyframes rotate{
from{transform: rotateX(0deg) rotateY(0deg);}
to{transform: rotateX(360deg) rotateY(360deg);}
}
.cube div{
position: absolute;
width: 200px;
height: 200px;
opacity: 0.8;
transition: all .4s;
}
.pic{
width: 200px;
height: 200px;
}
.cube .out_front{
transform: rotateY(0deg) translateZ(100px);
}
.cube .out_back{
transform: translateZ(-100px) rotateY(180deg);
}
.cube .out_left{
transform: rotateY(90deg) translateZ(100px);
}
.cube .out_right{
transform: rotateY(-90deg) translateZ(100px);
}
.cube .out_top{
transform: rotateX(90deg) translateZ(100px);
}
.cube .out_bottom{
transform: rotateX(-90deg) translateZ(100px);
}
.cube span{
display: bloack;
width: 100px;
height: 100px;
position: absolute;
top: 50px;
left: 50px;
}
.cube .in_pic{
width: 100px;
height: 100px;
}
.cube .in_front{
transform: rotateY(0deg) translateZ(50px);
}
.cube .in_back{
transform: translateZ(-50px) rotateY(180deg);
}
.cube .in_left{
transform: rotateY(90deg) translateZ(50px);
}
.cube .in_right{
transform: rotateY(-90deg) translateZ(50px);
}
.cube .in_top{
transform: rotateX(90deg) translateZ(50px);
}
.cube .in_bottom{
transform: rotateX(-90deg) translateZ(50px);
}
.cube:hover .out_front{
transform: rotateY(0deg) translateZ(200px);
}
.cube:hover .out_back{
transform: translateZ(-200px) rotateY(180deg);
}
.cube:hover .out_left{
transform: rotateY(90deg) translateZ(200px);
}
.cube:hover .out_right{
transform: rotateY(-90deg) translateZ(200px);
}
.cube:hover .out_top{
transform: rotateX(90deg) translateZ(200px);
}
.cube:hover .out_bottom{
transform: rotateX(-90deg) translateZ(200px);
}
CSS3 3D图片立方体旋转的更多相关文章
- 纯css3 3D图片立方体旋转动画特效
纯css3 3D立方体模块,鼠标触碰,模块炸开,大立方体中套小立方体 效果展示 手机扫描二维码体验效果: 效果图如下: 源码下载:http://hovertree.com/h/bjaf/0qmul8g ...
- 网页特效:用CSS3制作3D图片立方体旋转特效
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title&g ...
- 制作3D图片立方体旋转特效
<!DOCTYPE html><html><head><meta charset="utf-8" /><title>CS ...
- 超绚丽CSS3多色彩发光立方体旋转动画
CSS3添加了几个动画效果的属性,通过设置这些属性,可以做出一些简单的动画效果而不需要再去借助JavaScript.css3动画的属性主要分为三类:transform.transition以及anim ...
- CSS3实现图片循环旋转
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title&g ...
- 利用CSS3给图片添加旋转背景特效
首先看旋转特效:http://***/demo/201512/2015-12-09-css3-image-hover-animate/index.html 这是一款纯CSS3实现的当鼠标滑过图片时文字 ...
- 手把手教你玩转CSS3 3D技术
手把手教你玩转 CSS3 3D 技术 要玩转css3的3d,就必须了解几个词汇,便是透视(perspective).旋转(rotate)和移动(translate).透视即是以现实的视角来看屏幕上 ...
- 纯CSS3实现超立体的3D图片侧翻倾斜效果
看到网友分享的一款CSS3 3D图片侧翻倾斜特效,觉得效果非常棒,其实话说回来,这玩意儿的实现真的非常简单,主要是创意不错.先来看看效果图.那么接下来我们分析一下源码吧,显示html代码,非常简单: ...
- 利用纯CSS3实现超立体的3D图片侧翻倾斜效果
原文:利用纯CSS3实现超立体的3D图片侧翻倾斜效果 上午的时候我在jQuery论坛上看到网友分享的一款CSS3 3D图片侧翻倾斜特效,觉得效果非常棒,其实话说回来,这玩意儿的实现真的非常简单,主要是 ...
随机推荐
- VMVare的窗口自适应
啊!好久没来博客园了.原因很简单,我把密码丢了. 最近才从系统申请重置了密码,这不,又能登录了.你可能好奇,是的,我也在疑惑:我是不是搞IT的啊?因为只要密码丢失,我就认为世界完蛋了,我完蛋了:) 这 ...
- vs2008将 win32项目改为console项目
属性-linker-system-subsystem
- c# 有序链表合并 链表反转
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...
- Docker容器中安装vim
我在docker中安装了jexus.使用vim编辑default配置文件的时候提示 vim: command not found 原因是docker中没有安装vim命令 如果你直接输入 apt-ge ...
- 五、latex文档的篇章结构
- 爬虫---爬虫er与反爬虫er之间的斗争 转发
转自:昵称:python修行路 https://www.cnblogs.com/zhaof/p/7326260.html
- DeleteFile 删除文件
#include <Windows.h> #include <tchar.h> int WINAPI _tWinMain(HINSTANCE hInstance, HINSTA ...
- PHP----------linux下如何安装redis扩展。安装redis可以在我的博客redis里面寻找。
1.扩展下载地址:wget https://github.com/phpredis/phpredis/archive/develop.zip 2.下载完了以后解压压缩包 解压以后切换到 cd phpr ...
- Elasticsearch.安装插件(head)
Elasticsearch.安装插件(head) 环境: Linux 7.x jdk1.8 目录结构(跟目录多了两个文件) /resources ### 存放软件源 /u01/ ...
- 1、写在开头的话——Tinking in Java 绪论之我见
新兵道歉!版式不懂,技术若有错误,请指正,或发我邮箱1300431700@qq.com 不胜感激! 本文力图通过文章总结的形式,阐述自己的观点,迫使自己思考书中精髓,即使跟技术无关! 正文开始! “上 ...