zoukankan      html  css  js  c++  java
  • 3d旋转

    <!DOCTYPE html>
    <html lang="zh-cmn-Hans">
    <head>
    <meta charset="utf-8" />
    <meta name="copyright" content="www.doyoe.com" />
    <style>
    body {
    -webkit-perspective: 800px;
    perspective: 800px;
    -webkit-perspective-origin: 50%;
    perspective-origin: 50%;
    }
    .cube {
    display: inline-block;
    width: 100px;
    height: 100px;
    margin: 50px;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    -webkit-animation: rotate 5s infinite;
    animation: rotate 5s infinite;
    }
    .cube > div {
    position: absolute;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, .2);
    background-color: rgba(255, 255, 255, .1);
    color: gray;
    font-size: 20px;
    line-height: 100px;
    text-align: center;
    }
    .front {
    -webkit-transform: translatez(50px);
    transform: translatez(50px);
    }
    .back {
    -webkit-transform: rotatey(180deg) translatez(50px);
    transform: rotatey(180deg) translatez(50px);
    }
    .right {
    -webkit-transform: rotatey(90deg) translatez(50px);
    transform: rotatey(90deg) translatez(50px);
    }
    .left {
    -webkit-transform: rotatey(-90deg) translatez(50px);
    transform: rotatey(-90deg) translatez(50px);
    }
    .top {
    -webkit-transform: rotatex(90deg) translatez(50px);
    transform: rotatex(90deg) translatez(50px);
    }
    .bottom {
    -webkit-transform: rotatex(-90deg) translatez(50px);
    transform: rotatex(-90deg) translatez(50px);
    }
    @-webkit-keyframes rotate {
    from {
    -webkit-transform: rotatey(0);
    }
    to {
    -webkit-transform: rotatey(360deg);
    }
    }
    @keyframes rotate {
    from {
    transform: rotatey(0);
    }
    to {
    transform: rotatey(360deg);
    }
    }
    .c1 > div {
    -webkit-backface-visibility: visible;
    backface-visibility: visible;
    }
    .c2 > div {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    }
    </style>
    </head>
    <body>
    <div class="cube c1">
    <div class="front">1</div>
    <div class="back">2</div>
    <div class="right">3</div>
    <div class="left">4</div>
    <div class="top">5</div>
    <div class="bottom">6</div>
    </div>
    
    <div class="cube c2">
    <div class="front">1</div>
    <div class="back">2</div>
    <div class="right">3</div>
    <div class="left">4</div>
    <div class="top">5</div>
    <div class="bottom">6</div>
    </div>
    </body>
    </html>
  • 相关阅读:
    一个简单的进程察看器
    查找素数的程序
    两种动态创建对象的方法
    我对企业管理信息系统的看法
    下定决心,准备买dopod535,做基于M$ smartphone 2003(ce.net 4.2)的开发了
    工作流中对于事务处理的思考
    第二次安装.net2005地感受
    贴一个Microsoft Business Framework的图片上来,可能有些兄弟还不知道。
    SizeOf与Structure与Managed Code
    校园招聘技术面试方面的小题目
  • 原文地址:https://www.cnblogs.com/zyl-Tara/p/6139656.html
Copyright © 2011-2022 走看看