• CSS3-3D盒子


    <!doctype html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <meta name="Generator" content="EditPlus®">
    <meta name="Author" content="">
    <meta name="Keywords" content="">
    <meta name="Description" content="">
    <title>3D动画box</title>
    <style type=text/css>

    .warpper{position:fixed;top:30%;left:40%;perspective:1000px;}
    .cube{
    300px;height:300px;
    transform-style:preserve-3d;/*设置3D环境*/
    }

    .side{
    300px;height:300px;
    background:rgba(255,121,134,0.6);
    position:absolute;
    font-size:60px;
    color:#fff;
    line-height:300px;
    text-align:center;
    border:1px solid red;
    border-radius: 50%;
    }

    .side_top{
    300px;height:300px;
    /*background:rgba(255,121,134,0.6);*/
    background-image: url(img/01.png);
    position:absolute;
    font-size:60px;
    color:#fff;
    line-height:300px;
    text-align:center;
    border:1px solid red;
    /*border-radius: 50%;*/
    opacity:0.9;
    }

    .side_bottom{
    300px;height:300px;
    /*background:rgba(255,121,134,0.6);*/
    background-image: url(img/02.png);
    position:absolute;
    font-size:60px;
    color:#fff;
    line-height:300px;
    text-align:center;
    border:1px solid red;
    /*border-radius: 50%;*/
    opacity: 0.9;
    }
    .side_left{
    300px;height:300px;
    /*background:rgba(255,121,134,0.6);*/
    background-image: url(img/03.png);
    position:absolute;
    font-size:60px;
    color:#fff;
    line-height:300px;
    text-align:center;
    border:1px solid red;
    /*border-radius: 50%;*/
    opacity: 0.9;
    }
    .side_right{
    300px;height:300px;
    /*background:rgba(255,121,134,0.6);*/
    background-image: url(img/04.png);
    position:absolute;
    font-size:60px;
    color:#fff;
    line-height:300px;
    text-align:center;
    border:1px solid red;
    /*border-radius: 50%;*/
    opacity: 0.9;
    }
    .side_back{
    300px;height:300px;
    /*background:rgba(255,121,134,0.6);*/
    background-image: url(img/05.png);
    position:absolute;
    font-size:60px;
    color:#fff;
    line-height:300px;
    text-align:center;
    border:1px solid red;
    /*border-radius: 50%;*/
    opacity: 0.9;
    }
    .side_front{
    300px;height:300px;
    /*background:rgba(255,121,134,0.6);*/
    background-image: url(img/06.png);
    position:absolute;
    font-size:60px;
    color:#fff;
    line-height:300px;
    text-align:center;
    border:1px solid red;
    /*border-radius: 50%;*/
    opacity: 0.7;
    }

    .top{transform:rotateX(90deg) translateZ(150px);}
    .bottom{transform:rotateX(-90deg) translateZ(150px);}
    .left{transform:rotateY(-90deg) translateZ(150px);}
    .right{transform:rotateY(90deg) translateZ(150px);}
    .back{transform:rotateX(180deg) translateZ(150px);}
    .front{transform:rotateY(0deg) translateZ(150px);}

    </style>
    </head>
    <body>
    <div class="warpper">
    <div class="cube" id="cube">
    <div class="top side_top">1</div>
    <div class="bottom side_bottom">2</div>
    <div class="left side_left">3</div>
    <div class="right side_right">4</div>
    <div class="back side_back">5</div>
    <div class="front side_front">6</div>
    </div>
    </div>



    <!--<script type="text/javascript" src="js/niannian-kuku.js"></script>-->
    <script type="text/javascript">
    var cubeDom = document.getElementById("cube");
    var y = 0;
    setInterval(function(){
    if(y>360){
    y=0;
    }
    y += 5;

    cubeDom.style.transform = "rotateY("+y+"deg) rotateX("+y+"deg)";
    //document.body.style.background = kuku.RandomColor();
    //document.body.innerHTML = kuku.RandomNmb(1,11);
    },100);

    </script>
    </body>
    </html>

  • 相关阅读:
    bootstrap组件+模板地址
    10个自动化测试框架,测试工程师用起来
    IP地址分类(A类 B类 C类 D类 E类)
    来不及解释!Linux常用命令大全,先收藏再说
    凭借祖传配方年入21亿(王守义十三香),一生坚持不上市,亏待自己也要善待员工
    不同手指戴戒指的含义
    Soul App 是一款怎样的产品? SOUL APP 机缘巧合我开始使用 今天第四天内心想知道大家对它的感受 又其实并没有那么想大家把感受具象化再描述出来 嗯 还是希望大家能说一说(网恋需谨慎,小心骗子)
    解放双手,markdown文章神器,Typora+PicGo+七牛云图床实现自动上传图片
    度学习与自然语言处理
    软件测试面试之剖析面试官
  • 原文地址:https://www.cnblogs.com/dingzhaoqiang/p/4745736.html
Copyright © 2020-2023  润新知