-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3D.html
More file actions
81 lines (80 loc) · 2.15 KB
/
Copy path3D.html
File metadata and controls
81 lines (80 loc) · 2.15 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
*{
margin: 0px;
}
body{
display: flex;
justify-content: center;
margin: 100px auto;
background-color: black;
}
.cube{
display: flex;
justify-content: center;
height: 200px;
width: 200px;
position: relative;
transform-style: preserve-3d;
transform: rotateX(-15deg) rotateY(15deg);
animation: animate 5s infinite;
}
.face{
height: 50px;
width: 50px;
border: 1px solid white;
position: absolute;
background-color: rgba(112, 106, 189, 0.5)
}
.front{
transform: translateZ(100px);
}
.back{
transform: rotateY(180deg);
}
.left{
transform: rotateY(90deg) translateX(-50px) translateZ(-50px);
}
.right{
transform: rotateY(90deg) translateX(-50px) translateZ(50px);
}
.top{
transform: rotateX(90deg) translateY(50px) translateZ(50px);
}
.bottom{
transform: rotateX(90deg) translateY(50px) translateZ(-50px);
}
@keyframes animate{
0%{
transform: rotateX(45deg) rotateY(360deg);
}
25%{
transform: rotateZ(45deg);
}
}
</style>
</head>
<body>
<div class="cube">
<div class="face front"></div>
<div class="face back"></div>
<div class="face left"></div>
<div class="face right"></div>
<div class="face top"></div>
<div class="face bottom"></div>
</div>
<div class="cube">
<div class="face front"></div>
<div class="face back"></div>
<div class="face left"></div>
<div class="face right"></div>
<div class="face top"></div>
<div class="face bottom"></div>
</div>
</body>
</html>