-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCube 1.html
More file actions
88 lines (73 loc) · 1.6 KB
/
Copy pathCube 1.html
File metadata and controls
88 lines (73 loc) · 1.6 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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css" media="all">
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: #ccc;
}
.cube {
transform-style: preserve-3d;
width: 200px;
height: 200px;
position: relative;
animation: spin 15s linear;
}
@keyframes spin {
100% {
transform: rotateY(360deg) rotateX(360deg);
}
}
.cube div {
position: absolute;
width: 100%;
height: 100%;
border: 2px solid;
}
.front {
background: violet;
transform: translateZ(200px);
}
.back {
background: green;
transform: rotateY(180deg);
}
.left {
background: yellow;
transform-origin: 100%;
transform: translateX(-200px) rotateY(90deg);
}
.right {
background: blue;
transform-origin: 0;
transform: translateX(200px) rotateY(-90deg);
}
.top {
background: orange;
transform-origin: 0 100%;
transform: translateY(-200px) rotateX(-90deg);
}
.bottom {
background: red;
transform-origin: 0 0;
transform: translateY(200px) rotateX(90deg);
}
</style>
<title>Cube</title>
</head>
<body>
<div class="cube">
<div class="front"></div>
<div class="back"></div>
<div class="left"></div>
<div class="right"></div>
<div class="top"></div>
<div class="bottom"></div>
</div>
</body>
</html>