-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrotateCube.html
77 lines (74 loc) · 2 KB
/
rotateCube.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>rotateCube</title>
<style>
*{
margin: 0;
padding: 0;
}
body{
background: #000000;
-webkit-perspective: 800px;
-webkit-perspective-origin: center 50%;
}
#container{
margin: 100px auto;
height: 200px;
width: 200px;
position: relative;
-webkit-transform-style: preserve-3d;
-webkit-animation: rotate 3s ease infinite;
}
@-webkit-keyframes rotate {
from{
}to{
-webkit-transform: rotateY(-360deg) rotateX(360deg) rotateZ(-90deg);
}
}
.cube{
height: 200px;
width: 200px;
position: absolute;
text-align: center;
line-height: 200px;
border-radius: 10px;
}
.four{
-webkit-transform: rotateY(180deg) translateZ(100px);
background: rgba(255,0,0,0.6);
}
.one{
-webkit-transform: rotateX(90deg) translateZ(100px);
background: rgba(255,255,0,0.6);
}
.six{
-webkit-transform: rotateX(-90deg) translateZ(100px);
background: rgba(0,255,255,0.6);
}
.three{
-webkit-transform: rotateY(-90deg) translateZ(100px);
background: rgba(0,0,255,0.6);
}
.five{
-webkit-transform: rotateY(90deg) translateZ(100px);
background: rgba(255,0,255,0.6);
}
.two{
-webkit-transform: translateZ(100px);
background: rgba(0,255,0,0.6);
}
</style>
</head>
<body>
<div id="container">
<div class="cube one">1</div>
<div class="cube two">2</div>
<div class="cube three">3</div>
<div class="cube four">4</div>
<div class="cube five">5</div>
<div class="cube six">6</div>
</div>
</body>
</html>