-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
100 lines (86 loc) · 2.43 KB
/
index.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.wrapper {
position: relative;
margin: auto;
width: 500px;
height: 500px;
/* border: 1px solid #000; */
perspective: 600px;
}
.wrapper:hover {
border: 1px solid #000;
}
.box {
position: absolute;
top: 100px;
left: 150px;
margin: auto;
width: 200px;
height: 200px;
transform-style: preserve-3d;
animation: turn 5s linear infinite;
font-size: 30px;
color: #fff;
}
.item {
position: absolute;
width: 200px;
height: 200px;
opacity: 0.5;
text-align: center;
line-height: 200px;
}
.item1 {
background: red;
transform: translateZ(100px);
}
.item2 {
background: green;
transform: rotate3d(1, 0, 0, 90deg) translateZ(100px);
}
.item3 {
background: deeppink;
transform: rotate3d(1, 0, 0, 180deg) translateZ(100px);
}
.item4 {
background: deepskyblue;
transform: rotate3d(1, 0, 0, -90deg) translateZ(100px);
}
.item5 {
background: orange;
transform: rotate3d(0, 1, 0, 90deg) translateZ(100px);
}
.item6 {
background: #333;
transform: rotate3d(0, 1, 0, -90deg) translateZ(100px);
}
@keyframes turn {
0% {
transform: rotateX(0) rotateY(0) rotateZ(0);
}
100% {
transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
}
}
</style>
</head>
<body>
<div class="wrapper">
<div class="box">
<div class="item item1">1</div>
<div class="item item2">2</div>
<div class="item item3">3</div>
<div class="item item4">4</div>
<div class="item item5">5</div>
<div class="item item6">6</div>
</div>
</div>
</body>
</html>