css3 一个简单的静态立方体
<meta charset="utf8"> <style>
.cube {
position: absolute;
left: 50%;
top: 250px;
} .rightFace,.leftFace,.topFace div{
position: absolute;
padding: 10px;
width: 180px;
height: 180px;
} .leftFace {
transform: skew(0deg, 30deg);
background-color: #ccc;
} .rightFace {
transform: skew(0deg, -30deg);
background-color: #ddd;
left: 200px;
} .topFace {
transform: rotate(60deg);
} .topFace div {
transform: skew(0deg, -30deg) scale(1, 1.16);
background-color: #eee;
font-size: 0.862em;
top: -300px;
left: -48px;
} </style> <div class="cube">
<div class="topFace">
<div>
上
</div>
</div>
<div class="leftFace">
左
</div>
<div class="rightFace">
右
</div>
</div>
原版
<meta charset="utf8">
<style>
/*
Cube Experiment
Date: 26th March 2009
Author: Paul Hayes
*/ #experiment {
min-height: 500px;
} .cube {
position: absolute;
left: 50%;
top: 250px;
margin-left: -200px;
} .cube p {
line-height: 14px;
font-size: 12px;
} .cube h2 {
font-weight: bold;
} .rightFace,
.leftFace,
.topFace div {
padding: 10px;
width: 180px;
height: 180px;
} .rightFace,
.leftFace,
.topFace {
position: absolute;
} .leftFace {
-webkit-transform: skew(0deg, 30deg);
-moz-transform: skew(0deg, 30deg);
-o-transform: skew(0deg, 30deg);
-ms-transform: skew(0deg, 30deg);
transform: skew(0deg, 30deg);
background-color: #ccc;
} .rightFace {
-webkit-transform: skew(0deg, -30deg);
-moz-transform: skew(0deg, -30deg);
-o-transform: skew(0deg, -30deg);
-ms-transform: skew(0deg, -30deg);
transform: skew(0deg, -30deg);
background-color: #ddd;
left: 200px;
} .topFace div {
-webkit-transform: skew(0deg, -30deg) scale(1, 1.16);
-moz-transform: skew(0deg, -30deg) scale(1, 1.16);
-o-transform: skew(0deg, -30deg) scale(1, 1.16);
-ms-transform: skew(0deg, -30deg) scale(1, 1.16);
transform: skew(0deg, -30deg) scale(1, 1.16);
background-color: #eee;
font-size: 0.862em;
} .topFace {
-webkit-transform: rotate(60deg);
-moz-transform: rotate(60deg);
-o-transform: rotate(60deg);
-ms-transform: rotate(60deg);
transform: rotate(60deg);
top: -158px;
left: 100px;
} /* Optional WebKit Animations */
/* .rightFace {
-webkit-transition: -webkit-transform 1s linear;
} .leftFace {
-webkit-transition: -webkit-transform 1s linear;
} .topFace {
-webkit-transition: -webkit-transform 1s linear;
} .cube:hover .rightFace {
-webkit-transform: skew(0deg, -30deg) translate(100px, 100px);
} .cube:hover .leftFace {
-webkit-transform: skew(0deg, 30deg) translate(-100px, 100px);
} .cube:hover .topFace {
-webkit-transform: rotate(60deg) translate(-50px, -50px);
} /* Video */
.cube video {
left: -20px;
top: -20px;
position: relative;
} .cube div.rightFace video {
left: -301px;
top: -35px;
opacity: 0.9;
} .cube div.leftFace video {
opacity: 0.7;
top: -35px;
left: -100px;
} .cube div.rightFace,
.cube div.leftFace {
overflow: hidden;
} .cube div.topFace.video div {
background-color: #000;
color: #fff;
} </style> <div id="experiment">
<div class="cube">
<div class="topFace"><div>
<h2>Top cube face</h2>
<p>The top face is nested in an extra div tag to give correct rotation of skewed rectangle.</p>
<p>This face is also scaled, so the font size has been reduced to accommodate.</p>
</div></div>
<div class="leftFace">
<h2>Left cube face</h2>
<p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="rightFace">
<h2>Right cube face</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
</div>
</div>
地址
http://paulrhayes.com/experiments/cube/multiCubes.html
http://paulrhayes.com/experiments/cube/index.html
css3 一个简单的静态立方体的更多相关文章
- Socket——实现一个简单的静态网页服务器
整体结构就是使用ServerSocket监听一个地址,当有接受到请求之后,解析请求中的资源路径.服务器资源路径存放在项目下的一个目录中,服务器会到这个目录中根据请求的路径去寻找相应的资源.如果找到了则 ...
- 初始nginx(启动运行) 使用nginx做一个简单的静态资源服务器
第一次接触nginx的时候,那时候公司还是用的一些不知名的小技术,后来公司发展问题,重新招了人,然后接触到nginx,公司 使用nginx用来做代理服务器,所有请求 都先经过nginx服务器,然后交由 ...
- Css打造一个简单的静态七巧板
偶然在微博上看到用css写一个七巧板,正好也有一些源代码,于是就试着敲了敲. 主要是利用了css3的transform,实现平移,旋转,变形,直接用看到的代码敲出来之后有些问题,因为宽度上下面绿色的三 ...
- nginx 配一个简单的静态文件服务器 和一个虚似机
下面是个图片服务器: server { listen ; server_name img.xxx.xxx.com; root /data/site/img.xxx.xxx.com; access_lo ...
- 用node搭建简单的静态资源管理器
我们都知道,老牌的3p服务器都是自带静态资源管理器的.但是node不同,它没有web容器,它的路由地址和真实地址可以没有联系,所有node的优点,是可以把路由做得相当漂亮. 但静态资源管理器也是必不可 ...
- 使用Node.js快速搭建简单的静态文件服务器
做前端有时会采用一些复杂框架,在文件系统中直接打开页面(用file:///方式打开),往往会报跨域的错,类似于“XMLHttpRequest cannot load ...(文件名). Cross o ...
- Windows 上静态编译 Libevent 2.0.10 并实现一个简单 HTTP 服务器(无数截图)
[文章作者:张宴 本文版本:v1.0 最后修改:2011.03.30 转载请注明原文链接:http://blog.s135.com/libevent_windows/] 本文介绍了如何在 Window ...
- Windows 上静态编译 Libevent 2.0.10 并实现一个简单 HTTP 服务器(图文并茂,还有实例下载)
[文章作者:张宴 本文版本:v1.0 最后修改:2011.03.30 转载请注明原文链接:http://blog.s135.com/libevent_windows/] 本文介绍了如何在 Window ...
- 一个简单的Web服务器-支持静态资源请求
目标 实现一个简单的Web服务器,能够根据HTTP请求的URL响应对应的静态资源,如果静态资源不存在则响应404. HttpServer 使用ServerSocket实现的一个服务器,request根 ...
随机推荐
- PHP图像操作:3D图、缩放、旋转、裁剪、加入水印(一)
来源:http://www.ido321.com/875.html 1.利用php gd库的函数绘制3D扇形统计图 1: <?php 2: header("content-type&q ...
- Netty Client和Server端实现
本文基于Nett4.0.26.Final版本浅析Client与Server端通讯,先看服务器端: public class Server { public static void run(int po ...
- IM开发基础知识补课(四):正确理解HTTP短连接中的Cookie、Session和Token
本文引用了简书作者“骑小猪看流星”技术文章“Cookie.Session.Token那点事儿”的部分内容,感谢原作者. 1.前言 众所周之,IM是个典型的快速数据流交换系统,当今主流IM系统(尤其移动 ...
- git 关联远程分支
问题解析: git本地新建一个分支后,必须要做远程分支关联.如果没有关联, git 会在下面的操作中提示你显示的添加关联.关联目的是如果在本地分支下操作: git pull, git push ,不需 ...
- js 创建数组方法以及区别
示例代码: <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF ...
- Android Exception 7(attempt to re-open an already-closed object )
07-23 18:16:17.641: W/SQLiteConnectionPool(28390): A SQLiteConnection object for database '/storage/ ...
- linux下自己下载的程序装哪?
有两个选择: /usr/local:类似于C:\Program Files /opt:类似于D:\soft 其实都可以,关键是保持一致.
- spoj 694 求一个字符串中不同子串的个数
SPOJ Problem Set (classical) 694. Distinct Substrings Problem code: DISUBSTR Given a string, we need ...
- 【PHP】组合条件搜索SQL
前端html多个搜索条件组合 后台一个sql语句,很方便和简洁:仅提供思路. 也可以配合着进行分页操作,非常赞~
- Excel 时间格式相减
https://jingyan.baidu.com/article/3065b3b6e8b9dabecff8a4d6.html datedif函数是excel的隐藏函数,主要用于计算日期之差,不是四舍 ...