-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle.css
More file actions
137 lines (112 loc) · 3.02 KB
/
style.css
File metadata and controls
137 lines (112 loc) · 3.02 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
126
127
128
129
130
131
132
133
134
135
136
137
:root {
--boxColor: #0ff7;
--rotateSpeed: 30s;
--bounceSpeed: 1.6s;
}
body {
background-color: #000;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
font-size: 75px;
perspective: 10em;
perspective-origin: 50% calc(50% - 2em);
overflow: hidden;
}
@keyframes sceneRotate {
to { transform: rotateY(360deg) }
}
.scene {
position: relative;
transform-style: preserve-3d;
animation: sceneRotate var(--rotateSpeed) infinite linear;
}
@keyframes ballBounce {
0%, 100% { bottom: 0.5em }
50% { bottom: 3em; animation-timing-function: ease-in; }
}
.ball {
position: absolute;
left: -0.5em;
bottom: 1em;
width: 1em; height: 1em;
border-radius: 50%;
background-color: #fff;
background-image: radial-gradient(
circle at top,
#fff, 40%, #000
);
animation:
ballBounce var(--bounceSpeed) infinite ease-out,
sceneRotate var(--rotateSpeed) infinite linear reverse;
}
@keyframes ballShadow {
0%, 8%, 93.5%, 100% { transform: scale(1); opacity: 1; }
50% { transform: scale(2); opacity: 0.5; 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 cubeScale {
0%, 100% { transform: scaleY(0.75) }
8%, 93.5% { transform: scaleY(1) }}
.cube {
--_size: 2em;
transform-style: preserve-3d;
position: absolute;
bottom: -1em;
left: -1em;
width: var(--_size);
height: var(--_size);
animation: cubeScale var(--bounceSpeed) infinite ease-in-out;
transform-origin: bottom;
.left, .right, .front, .back, .top, .bottom {
position: absolute;
width: 100%;
height: 100%;
background-color: var(--boxColor);
box-shadow: 0 0 0.5em #000a inset;
}
.top { transform: translateY(-50%) rotateX(90deg) }
.bottom { transform: translateY(50%) rotateX(90deg) }
.front { transform: translateZ(calc(var(--_size) / 2)) }
.back { transform: translateZ(calc(var(--_size) / -2)) }
.right { transform: rotateY(90deg) translateZ(calc(var(--_size) / 2)) }
.left { transform: rotateY(-90deg) translateZ(calc(var(--_size) / 2)) }
}
.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;
}
/* @keyframes exampleAnimation {
0% { transform: translateY(0) rotateX(0); }
100% { 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;
animation: exampleAnimation 2s infinite;
} */