zoukankan      html  css  js  c++  java
  • 原生js实现 正方体旋转

    使用CSS3新特性实现:

      

    <!DOCTYPE html>
    <html>
    <head>
    	<meta charset="UTF-8">
    	<link rel="stylesheet" type="text/css" href="gong.css" />
    	<title>魔方</title>
    	<style type="text/css">
    		.box {
    			display: block;
    			 200px;
    			height: 200px;
    			margin: 100px auto;
    			position: relative;
    			transform-style: preserve-3d;
    		}
    		.box:hover {
    			transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
    			transition: 10s;
    		}
    		li {
    			list-style: none;
    			position: absolute;
    			top: 0;
    			left: 0;
    			 100%;
    			height: 100%;
    			opacity: .3;
    		}
    		li:nth-child(1) {
    			transform: translateZ(-100px);
    			background: paleturquoise;
    		}
    		li:nth-child(2) {
    			transform: translateZ(100px);
    			background: palegoldenrod;
    		}
    		li:nth-child(3) {
    			background: #00AAEE;
    			transform: translateX(100px) rotateY(90deg);
    		}
    		li:nth-child(4) {
    			background: black;
    			transform: translateX(-100px) rotateY(90deg);
    		}
    		li:nth-child(5) {
    			background: blueviolet;
    			transform: translateY(100px) rotateX(90deg);
    		}
    		li:nth-child(6) {
    			background: palevioletred;
    			transform: translateY(-100px) rotateX(90deg);
    		}
    	</style>
    </head>
    <body>
    	<ul class="box">
    		<li></li>
    		<li></li>
    		<li></li>
    		<li></li>
    		<li></li>
    		<li></li>
    	</ul>
    </body>
    </html>
    

      

    集思广益,仅供学习,侵权即删!!
  • 相关阅读:
    C语言I博客作业03
    C语言I博客作业02
    JSON Template
    Mac系统登录不进系统解决办法
    Mac怎么安装并配置Homebrew?
    tensorflow 安装命令
    删除表重复数据
    redhat安装docker
    Rabbit MQ 入门指南
    Maven 集成Tomcat7插件
  • 原文地址:https://www.cnblogs.com/hudunyu/p/13854053.html
Copyright © 2011-2022 走看看