<!doctype html>
<meta charset= "UTF-8" >
<meta name= "Generator" content= "editplus®" >
<meta name= "Author" content= "" >
<meta name= "Keywords" content= "" >
<meta name= "Description" content= "" >
<title>3d Animation box</title>
<style type=text/css>
. warpper{position:fixed;top:30%;left:40%;p erspective:1000px;}
. cube{
width:300px;height:300px;
transform-style:preserve-3d;/* setting up a 3D environment */
}
. side{
width: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{
width: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{
width: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{
width: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{
width: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{
width: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{
width: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>
<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>
Css3-3d Box