saldamen's picture
сделай подходящие текстуры, улучши управление
fcc2dcd verified
Raw History Blame Contribute Delete
4.76 kB
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
body {
font-family: 'Press Start 2P', cursive;
min-height: 100vh;
display: flex;
flex-direction: column;
background: linear-gradient(to bottom, #0f0c29, #302b63, #24243e);
background-attachment: fixed;
}
.game-container {
border: 4px solid #f59e0b;
box-shadow: 0 0 30px rgba(245, 158, 11, 0.5);
background-image: url('http://static.photos/space/1024x576/42');
background-size: cover;
background-position: center;
overflow: hidden;
position: relative;
}
.game-container::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 100%);
pointer-events: none;
}
#player {
transition: left 0.1s ease-out;
background-image: url('https://opengameart.org/sites/default/files/spaceship_0.png');
background-size: contain;
background-repeat: no-repeat;
background-position: center;
width: 64px;
height: 64px;
filter: drop-shadow(0 0 10px rgba(66, 135, 245, 0.8));
transform: rotate(90deg);
}
.enemy {
position: absolute;
width: 48px;
height: 48px;
background-image: url('https://opengameart.org/sites/default/files/enemyShip_0.png');
background-size: contain;
background-repeat: no-repeat;
background-position: center;
filter: drop-shadow(0 0 10px rgba(235, 72, 72, 0.8));
transition: transform 0.1s ease-out;
animation: pulse 1s infinite alternate, float 3s infinite ease-in-out;
transform: rotate(-90deg);
}
@keyframes pulse {
from { transform: scale(1); }
to { transform: scale(1.1); }
}
.power-up {
position: absolute;
width: 32px;
height: 32px;
background-image: url('http://static.photos/yellow/32x32/4');
background-size: contain;
background-repeat: no-repeat;
background-position: center;
filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
animation: float 2s infinite ease-in-out, spin 4s infinite linear;
}
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
@keyframes float {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-10px); }
}
#lives-container {
display: flex;
gap: 10px;
font-size: 28px;
}
#lives-container span {
transition: transform 0.2s;
}
#lives-container span:hover {
transform: scale(1.2);
}
.bullet {
position: absolute;
width: 16px;
height: 32px;
background-image: url('https://opengameart.org/sites/default/files/laserBlue16.png');
background-size: contain;
background-repeat: no-repeat;
background-position: center;
filter: drop-shadow(0 0 5px rgba(66, 135, 245, 0.8));
animation: glow 0.5s infinite alternate;
}
@keyframes glow {
from { filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.8)); }
to { filter: drop-shadow(0 0 10px rgba(245, 158, 11, 1)); }
}
.game-over {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.9);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
z-index: 100;
color: #f59e0b;
font-size: 2rem;
text-shadow: 0 0 10px rgba(245, 158, 11, 0.8);
background-image: url('http://static.photos/black/1024x576/5');
background-size: cover;
}
.game-over h2 {
font-size: 3rem;
margin-bottom: 2rem;
color: #ff4d4d;
text-shadow: 0 0 15px rgba(255, 77, 77, 0.8);
}
.game-over button {
background: linear-gradient(to right, #f59e0b, #ff4d4d);
border: none;
padding: 1rem 2rem;
font-size: 1.2rem;
border-radius: 50px;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
}
.game-over button:hover {
transform: scale(1.05);
box-shadow: 0 0 25px rgba(245, 158, 11, 0.8);
}
.hidden {
display: none;
}
/* Starfield animation */
.star {
position: absolute;
background-color: white;
border-radius: 50%;
animation: twinkle 3s infinite alternate;
opacity: 0.7;
}
@keyframes twinkle {
0% { opacity: 0.3; }
100% { opacity: 1; }
}
/* New stats styling */
.stats > div {
background: rgba(31, 41, 55, 0.7);
backdrop-filter: blur(5px);
border: 1px solid #f59e0b;
border-radius: 10px;
transition: all 0.3s ease;
}
.stats > div:hover {
transform: translateY(-5px);
box-shadow: 0 10px 20px rgba(245, 158, 11, 0.2);
}
.controls button {
border: 2px solid #f59e0b;
transition: all 0.2s ease;
}
.controls button:hover {
transform: scale(1.05);
box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
}