forked from ecole-du-web/Cube-3D
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle.css
More file actions
63 lines (55 loc) · 1.17 KB
/
style.css
File metadata and controls
63 lines (55 loc) · 1.17 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
*,
::before,
::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
background: #222;
}
.container {
width: 200px;
height: 200px;
perspective: 1000px;
margin: 100px auto 0;
}
.cube {
transform-style: preserve-3d;
width: 100%;
height: 100%;
position: relative;
animation: spin 5s infinite linear;
}
.face {
position: absolute;
width: 100%;
height: 100%;
background-image: repeating-linear-gradient(0deg, rgba(70,70,70, 0.2) 0px, rgba(70,70,70, 0.2) 1px,transparent 1px, transparent 21px),repeating-linear-gradient(90deg, rgba(70,70,70, 0.2) 0px, rgba(70,70,70, 0.2) 1px,transparent 1px, transparent 21px),linear-gradient(90deg, rgb(255,255,255),rgb(255,255,255));
}
.top {
transform: rotateX(90deg) translateZ(100px);
}
.bottom {
transform: rotateX(-90deg) translateZ(100px);
}
.right {
transform: rotateY(90deg) translateZ(100px);
}
.left {
transform: rotateY(-90deg) translateZ(100px);
}
.front {
transform: rotateX(0deg) translateZ(100px);
}
.back {
transform: rotateX(-180deg) translateZ(100px);
}
@keyframes spin {
from {
transform: rotateX(0deg) rotateY(0deg);
}
to {
transform: rotateX(360deg) rotateY(360deg);
}
}