-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.css
69 lines (55 loc) · 980 Bytes
/
style.css
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
* {
box-sizing: border-box;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
perspective: 400px;
}
.cube {
display: flex;
justify-content: center;
align-items: center;
transform-style: preserve-3d;
}
.cube:hover {
animation: spin 5s linear infinite;
}
.side {
--size: 75px;
width: var(--size);
height: var(--size);
position: absolute;
background-color: hsla(200, 100%, 50%, 0.5);
border: 1px solid hsla(200, 100%, 10%, 0.5);
display: flex;
justify-content: center;
align-items: center;
transform: rotateY(var(--rotate-y, 0)) rotateX(var(--rotate-x, 0))
translateZ(calc(var(--size) / 2));
}
.left {
--rotate-y: -90deg;
}
@keyframes spin {
0% {
transform: rotateX(0) rotateY(0);
}
100% {
transform: rotateX(360deg) rotateY(360deg);
}
}
.right {
--rotate-y: 90deg;
}
.back {
--rotate-y: 180deg;
}
.top {
--rotate-x: 90deg;
}
.bottom {
--rotate-x: -90deg;
}