-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.css
130 lines (124 loc) · 2.57 KB
/
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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
:root {
--boxColor: #0ff7;
--rotateSpeed: 30s;
--bounceSpeed: 2s;
}
body {
background-color: #000;
min-height: 100vh;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
font-size: 75px;
perspective: 10em;
perspective-origin: 50% calc(50% - 2em);
}
.scene {
position: relative;
transform-style: preserve-3d;
animation: sceneRotate var(--rotateSpeed) infinite linear;
}
@keyframes sceneRotate {
to {
transform: rotateY(360deg);
}
}
.ball {
width: 1em;
height: 1em;
border-radius: 50%;
background-color: lightblue;
position: absolute;
left: -0.5em;
bottom: 1em;
background-image: radial-gradient(circle at top, lightblue, #000);
animation: ballBounce var(--bounceSpeed) infinite ease-out, sceneRotate var(--rotateSpeed) infinite linear reverse;
}
@keyframes ballBounce {
0%, 100% {
bottom: 0.5em;
}
50% {
bottom: 3em;
animation-timing-function: ease-in;
}
}
.ballShadow {
position: absolute;
width: 100%;
height: 100%;
background-image: radial-gradient(#0007, #0000 50%);
animation: ballShadow var(--bounceSpeed) infinite ease-out;
}
@keyframes ballShadow {
0%, 100% {
transform: scale(1);
opacity: 1;
}
50% {
transform: scale(2);
opacity: 0.5;
animation-timing-function: ease-in;
}
}
.cube {
width: 2em;
height: 2em;
transform-style: preserve-3d;
position: absolute;
bottom: -1em;
left: -1em;
animation: cubeHeight var(--bounceSpeed) infinite linear;
}
@keyframes cubeHeight {
0%, 8%, 93.5%, 100% {
height: 1.5em;
}
8%, 93.5% {
height: 2em;
}
}
.cube .left, .cube .right, .cube .front, .cube .back {
position: absolute;
width: 100%;
height: 100%;
background: var(--boxColor);
box-shadow: 0 0 0.5em #000a inset;
}
.cube .front {
transform: translateZ(1em);
}
.cube .right {
transform: rotateY(90deg) translateZ(1em);
}
.cube .back {
transform: rotateY(180deg) translateZ(1em);
}
.cube .left {
transform: rotateY(270deg) translateZ(1em);
}
.cube .top {
position: absolute;
width: 2em;
height: 2em;
background: var(--boxColor);
transform: translateY(-50%) rotateX(90deg);
box-shadow: 0 0 0.5em #000a inset;
}
.cube .bottom {
position: absolute;
width: 2em;
height: 2em;
bottom: 0;
transform: translateY(-50%) rotateX(90deg);
}
.floor {
position: absolute;
top: 1em;
transform: translate(-50%, -50%) rotateX(90deg);
width: 15em;
height: 15em;
background-image: radial-gradient(#0000, #000 75%), repeating-conic-gradient(from 45deg, #111 0deg 90deg, #222 90deg 180deg);
background-size: 100%, 1em 1em;
}