-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle.css
More file actions
125 lines (110 loc) · 2.71 KB
/
style.css
File metadata and controls
125 lines (110 loc) · 2.71 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
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
:root {
--boxColor: #0ff7;
--rotateSpeed: 10s;
--bounceSpeed: 1.5s;
}
body {
background-color: black;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
font-size: 75px;
perspective: 10em;
perspective-origin: 50% calc(50% - 2.5em);
}
.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: white;
position: absolute;
left: -.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%, 8%, 93.5%, 100% { transform: scale(1); opacity: 1;}
50% { transform: scale(2); opacity: 0.5; animation-timing-function: ease-in;}
}
.cube {
width: 2em;
height: 2em;
position: absolute;
bottom: -1em;
left: -1em;
animation: cubeHeight var(--bounceSpeed) infinite linear;
}
@keyframes cubeHeight {
0%, 100% { height: 1.5em; }
8%, 93.5% { height: 2em; }
}
.left, .right, .front, .back {
position: absolute;
width: 100%;
height: 100%;
background: var(--boxColor);
box-shadow: 0 0 0.5em #000a inset;
}
.front { transform: translateZ(1em); }
.right { transform: rotateY(90deg) translateZ(1em); }
.back { transform: rotateY(180deg) translateZ(1em); }
.left { transform: rotateY(270deg) translateZ(1em); }
.top {
overflow: hidden;
position: absolute;
width: 2em;
height: 2em;
background: var(--boxColor);
transform: translateY(-50%) rotateX(90deg);
box-shadow: 0 0 0.5em #000a inset;
}
.bottom {
position: absolute;
width: 2em;
height: 2em;
background: rgba(23, 198, 204, 0.411);
bottom: 0;
transform: translateY(50%) rotateX(90deg);
box-shadow: 0 0 2em rgb(0, 255, 255);
}
.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;
}