File size: 6,296 Bytes
0fc9b60 9b83e2f 0fc9b60 9b83e2f 0fc9b60 9b83e2f 0fc9b60 9b83e2f 0fc9b60 9b83e2f 0fc9b60 9b83e2f | 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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | @import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@400;600;700&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: radial-gradient(ellipse at 50% 30%, #0f0c29, #0a0a1a 60%, #000);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
font-family: 'Rajdhani', 'Segoe UI', sans-serif;
overflow: hidden;
}
/* Animated starfield background */
body::before {
content: '';
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
background-image:
radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.6), transparent),
radial-gradient(1px 1px at 30% 50%, rgba(255,255,255,0.4), transparent),
radial-gradient(1px 1px at 55% 15%, rgba(255,255,255,0.5), transparent),
radial-gradient(1px 1px at 70% 80%, rgba(255,255,255,0.3), transparent),
radial-gradient(1px 1px at 85% 40%, rgba(255,255,255,0.5), transparent),
radial-gradient(1px 1px at 15% 90%, rgba(255,255,255,0.4), transparent),
radial-gradient(1px 1px at 45% 65%, rgba(255,255,255,0.3), transparent),
radial-gradient(1px 1px at 90% 10%, rgba(255,255,255,0.6), transparent),
radial-gradient(1px 1px at 25% 75%, rgba(255,255,255,0.4), transparent),
radial-gradient(1px 1px at 60% 35%, rgba(255,255,255,0.5), transparent);
animation: bgDrift 60s linear infinite;
pointer-events: none;
z-index: 0;
}
@keyframes bgDrift {
0% { transform: translateY(0); }
100% { transform: translateY(-100px); }
}
#game-container {
position: relative;
border: 1px solid rgba(100, 140, 255, 0.25);
border-radius: 10px;
box-shadow:
0 0 30px rgba(80, 120, 255, 0.15),
0 0 60px rgba(80, 120, 255, 0.08),
0 0 120px rgba(80, 120, 255, 0.04),
inset 0 0 30px rgba(80, 120, 255, 0.03);
animation: containerPulse 4s ease-in-out infinite;
}
@keyframes containerPulse {
0%, 100% {
box-shadow:
0 0 30px rgba(80, 120, 255, 0.15),
0 0 60px rgba(80, 120, 255, 0.08),
0 0 120px rgba(80, 120, 255, 0.04),
inset 0 0 30px rgba(80, 120, 255, 0.03);
}
50% {
box-shadow:
0 0 40px rgba(100, 140, 255, 0.2),
0 0 80px rgba(100, 140, 255, 0.1),
0 0 140px rgba(100, 140, 255, 0.05),
inset 0 0 40px rgba(100, 140, 255, 0.04);
}
}
canvas {
display: block;
border-radius: 9px;
}
#overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
pointer-events: none;
}
#start-screen,
#game-over-screen,
#pause-screen {
position: absolute;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
background: rgba(3, 3, 18, 0.88);
backdrop-filter: blur(6px);
-webkit-backdrop-filter: blur(6px);
border-radius: 9px;
color: #fff;
pointer-events: auto;
animation: fadeIn 0.4s ease-out;
}
@keyframes fadeIn {
from { opacity: 0; transform: scale(0.97); }
to { opacity: 1; transform: scale(1); }
}
#start-screen h1,
#game-over-screen h1,
#pause-screen h1 {
font-family: 'Orbitron', monospace;
font-weight: 900;
font-size: 2.4rem;
margin-bottom: 0.6rem;
letter-spacing: 3px;
text-shadow:
0 0 10px rgba(100, 160, 255, 0.8),
0 0 30px rgba(100, 160, 255, 0.4),
0 0 60px rgba(100, 160, 255, 0.2);
animation: titleGlow 3s ease-in-out infinite;
}
@keyframes titleGlow {
0%, 100% {
text-shadow:
0 0 10px rgba(100, 160, 255, 0.8),
0 0 30px rgba(100, 160, 255, 0.4),
0 0 60px rgba(100, 160, 255, 0.2);
}
50% {
text-shadow:
0 0 15px rgba(140, 190, 255, 1),
0 0 40px rgba(140, 190, 255, 0.6),
0 0 80px rgba(140, 190, 255, 0.3);
}
}
#game-over-screen h1 {
text-shadow:
0 0 10px rgba(255, 80, 80, 0.8),
0 0 30px rgba(255, 80, 80, 0.4),
0 0 60px rgba(255, 80, 80, 0.2);
animation: gameOverGlow 2s ease-in-out infinite;
}
@keyframes gameOverGlow {
0%, 100% {
text-shadow:
0 0 10px rgba(255, 80, 80, 0.8),
0 0 30px rgba(255, 80, 80, 0.4),
0 0 60px rgba(255, 80, 80, 0.2);
}
50% {
text-shadow:
0 0 15px rgba(255, 100, 100, 1),
0 0 40px rgba(255, 100, 100, 0.6),
0 0 80px rgba(255, 100, 100, 0.3);
}
}
#start-screen p,
#game-over-screen p,
#pause-screen p {
font-size: 1.15rem;
color: #8899bb;
margin-bottom: 0.5rem;
font-weight: 600;
}
#final-score,
#final-level {
font-family: 'Orbitron', monospace;
font-size: 1.3rem !important;
color: #ffdd55 !important;
font-weight: 700;
text-shadow: 0 0 8px rgba(255, 220, 80, 0.4);
}
.controls {
display: flex;
gap: 1rem;
margin: 1.2rem 0 1.8rem;
font-size: 0.9rem;
font-weight: 600;
color: #99aacc;
letter-spacing: 0.5px;
}
.controls span {
background: rgba(100, 140, 255, 0.08);
padding: 0.35rem 0.9rem;
border-radius: 5px;
border: 1px solid rgba(100, 140, 255, 0.18);
transition: background 0.2s;
}
.controls span:hover {
background: rgba(100, 140, 255, 0.15);
}
button {
margin-top: 1.2rem;
padding: 0.85rem 3rem;
font-family: 'Orbitron', monospace;
font-size: 1.15rem;
font-weight: 700;
color: #fff;
background: linear-gradient(135deg, #4a6cf7, #7b3cf7);
border: none;
border-radius: 8px;
cursor: pointer;
transition: transform 0.15s, box-shadow 0.2s;
letter-spacing: 2px;
box-shadow:
0 4px 20px rgba(100, 80, 255, 0.4),
0 0 40px rgba(100, 80, 255, 0.15);
position: relative;
overflow: hidden;
}
button::before {
content: '';
position: absolute;
top: -50%;
left: -60%;
width: 40%;
height: 200%;
background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.12) 50%, transparent 60%);
transition: left 0.6s ease;
}
button:hover::before {
left: 110%;
}
button:hover {
transform: translateY(-2px);
box-shadow:
0 6px 25px rgba(100, 80, 255, 0.6),
0 0 50px rgba(100, 80, 255, 0.2);
}
button:active {
transform: translateY(0) scale(0.98);
}
#restart-btn {
background: linear-gradient(135deg, #e74c6f, #f77b3c);
box-shadow:
0 4px 20px rgba(231, 76, 111, 0.35),
0 0 40px rgba(231, 76, 111, 0.12);
}
#restart-btn:hover {
box-shadow:
0 6px 25px rgba(231, 76, 111, 0.55),
0 0 50px rgba(231, 76, 111, 0.18);
}
|