-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
81 lines (70 loc) · 1.39 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
<!DOCTYPE html>
<html>
<head>
<title>Spinning 3D Cube</title>
<style>
.cube-container {
position: relative;
margin: 50px auto;
width: 200px;
height: 200px;
perspective: 800px;
}
.cube {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
transform-style: preserve-3d;
animation: spin 8s linear infinite;
}
.cube-face {
position: absolute;
width: 200px;
height: 200px;
background-color: rgba(255, 255, 255, 0.5);
border: 1px solid black;
opacity: 0.8;
}
.cube-face.front {
transform: translateZ(100px);
}
.cube-face.back {
transform: rotateY(180deg) translateZ(100px);
}
.cube-face.right {
transform: rotateY(90deg) translateZ(100px);
}
.cube-face.left {
transform: rotateY(-90deg) translateZ(100px);
}
.cube-face.top {
transform: rotateX(90deg) translateZ(100px);
}
.cube-face.bottom {
transform: rotateX(-90deg) translateZ(100px);
}
@keyframes spin {
from {
transform: rotateY(0deg);
}
to {
transform: rotateY(360deg);
}
}
</style>
</head>
<body>
<div class="cube-container">
<div class="cube">
<div class="cube-face front"></div>
<div class="cube-face back"></div>
<div class="cube-face right"></div>
<div class="cube-face left"></div>
<div class="cube-face top"></div>
<div class="cube-face bottom"></div>
</div>
</div>
</body>
</html>