-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle.css
More file actions
95 lines (91 loc) · 1.88 KB
/
style.css
File metadata and controls
95 lines (91 loc) · 1.88 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
:root {
--size: 12px;
}
body {
margin: 0;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
background-color: #000;
overflow: hidden;
}
.line {
display: flex;
overflow: visible;
transform-style: preserve-3d;
}
.result {
--bg: transparent;
background-color: var(--bg);
width: var(--size);
height: var(--size);
transform-style: preserve-3d;
overflow: visible;
backface-visibility: visible;
overflow: visible;
position: relative;
}
.face {
position: absolute;
background-color: var(--bg);
width: var(--size);
height: var(--size);
opacity: 0.5;
}
.face.front {
transform: rotateY(0deg) translateZ(calc(var(--size) / 2));
}
.face.right {
transform: rotateY(90deg) translateZ(calc(var(--size) / 2));
}
.face.back {
transform: rotateY(180deg) translateZ(calc(var(--size) / 2));
}
.face.left {
transform: rotateY(-90deg) translateZ(calc(var(--size) / 2));
}
.face.top {
transform: rotateX(90deg) translateZ(calc(var(--size) / 2));
}
.face.bottom {
transform: rotateX(-90deg) translateZ(calc(var(--size) / 2));
}
.container {
--angle: 70deg;
transform-style: preserve-3d;
overflow: visible;
animation: rotateX 45s linear infinite;
transform-origin: center;
margin-top: 100px;
position: relative;
}
.container.floor {
background-color: hsl(0 0% 100% / 50%);
position: absolute;
animation: unset;
top: 0;
right: 0;
left: 0;
bottom: 0;
margin-top: unset;
}
@keyframes rotateX {
0% {
transform: rotateX(var(--angle)) rotateZ(0deg);
}
100% {
transform: rotateX(var(--angle)) rotateZ(360deg);
}
}
input {
position: absolute;
top: 10px;
left: 50%;
transform: translateX(-50%);
width: 90%;
text-align: center;
font-size: 26px;
z-index: 100;
}