-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
136 lines (114 loc) · 2.72 KB
/
Copy pathindex.html
File metadata and controls
136 lines (114 loc) · 2.72 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>3D方块旋转</title>
<style>
html {
height: 100%;
}
body {
perspective: 1000px;
margin: 0;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
/* 圆形渐变 */
background: radial-gradient(white, grey);
}
@keyframes spin {
0% {
transform: rotateX(0) rotateY(0) rotateZ(0);
}
25% {
transform: rotateX(45deg) rotateY(90eg) rotateZ(180deg);
}
50% {
transform: rotateX(180deg) rotateY(90eg) rotateZ(45deg);
}
75% {
transform: rotateX(270deg) rotateY(360eg) rotateZ(180deg);
}
100% {
transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
}
}
.spin-ani {
animation: spin 6s;
animation-timing-function: linear;
animation-iteration-count: infinite;
}
#container {
width: 300px;
height: 300px;
/* border: solid 1px red; */
position: relative;
/* 保留子元素的3D变形效果 */
transform-style: preserve-3d;
}
.page {
width: 300px;
height: 300px;
background-size: 100% 100%;
position: absolute;
left: 0;
top: 0;
border-radius: 50px;
font-size: 1000%;
color: red;
display: flex;
justify-content: center;
align-items: center;
}
#d1 {
/* up */
/* background-image: url(1.jpg); */
background-color: #000000;
transform: translateY(-150px) rotateX(90deg);
}
#d2 {
/* down */
/* background-image: url(2.jpg); */
background-color: #0000FF;
transform: translateY(150px) rotateX(90deg) rotateZ(-90deg);
}
#d3 {
/* front */
/* background-image: url(3.jpg); */
background-color: #008000;
transform: translateZ(150px) rotateZ(180deg);
}
#d4 {
/* back */
/* background-image: url(4.jpg); */
background-color: #008080;
transform: translateZ(-150px);
}
#d5 {
/* left */
/* background-image: url(5.jpg); */
background-color: #0089DC;
transform: translateX(-150px) rotateY(90deg);
}
#d6 {
/* right */
/* background-image: url(6.jpg); */
background-color: #00FFFF;
transform: translateX(150px) rotateY(90deg);
}
</style>
</head>
<body>
<div id="container" class="spin-ani">
<div class="page" id="d1"><div>1</div></div>
<div class="page" id="d2"><div>2</div></div>
<div class="page" id="d3"><div>3</div></div>
<div class="page" id="d4"><div>4</div></div>
<div class="page" id="d5"><div>5</div></div>
<div class="page" id="d6"><div>6</div></div>
</div>
</body>
</html>