Flux-web / style.css
GarGerry's picture
Update style.css
f5f4767 verified
raw
history blame
2.87 kB
/* Reset styling untuk memastikan semua elemen berada dalam tampilan yang rapi */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* Menetapkan body agar game terlihat proporsional di semua perangkat */
body {
font-family: 'Arial', sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #121212;
}
/* Kontainer utama game dengan ukuran tetap proporsional */
.game-container {
width: 80vw; /* Lebar 80% dari layar */
height: 60vh; /* Tinggi 60% dari layar */
position: relative;
background: linear-gradient(45deg, #00b3b3, #cc00cc);
border-radius: 10px;
box-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
overflow: hidden;
}
/* Styling untuk bola */
.ball {
position: absolute;
width: 30px;
height: 30px;
background-color: #ffcc00;
border-radius: 50%;
top: 10%;
left: 50%;
transform: translateX(-50%);
animation: ballAnimation 4s linear infinite;
}
/* Animasi untuk pergerakan bola */
@keyframes ballAnimation {
0% { top: 10%; }
50% { top: 90%; }
100% { top: 10%; }
}
/* Styling untuk platform */
.platform {
position: absolute;
bottom: 5%;
width: 15vw; /* Platform proporsional dengan lebar layar */
height: 5vh; /* Platform proporsional dengan tinggi layar */
background-color: #ff6600;
border-radius: 5px;
left: 50%;
transform: translateX(-50%);
}
/* Styling untuk kontrol tombol */
.controls {
position: absolute;
bottom: 20px;
display: flex;
justify-content: space-between;
width: 80%;
padding: 10px;
}
.controls button {
font-size: 1.5rem;
padding: 10px 15px;
background-color: #333;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}
.controls button:hover {
background-color: #555;
}
/* Styling untuk skor dan nyawa */
.score-board, .lives {
position: absolute;
top: 10px;
font-size: 1.2rem;
color: white;
font-weight: bold;
}
.score-board {
left: 10px;
}
.lives {
right: 10px;
}
/* Game Over message */
.game-over-message {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: rgba(0, 0, 0, 0.8);
color: white;
text-align: center;
padding: 30px;
border-radius: 15px;
display: none; /* Hidden by default */
box-shadow: 0 0 30px rgba(0, 255, 255, 0.7);
}
.game-over-message h2 {
font-size: 2rem;
}
.game-over-message p {
font-size: 1.5rem;
}
.game-over-message button {
padding: 12px 25px;
background-color: #ff6600;
color: white;
font-size: 1.2rem;
border-radius: 10px;
cursor: pointer;
transition: background-color 0.2s ease;
}
.game-over-message button:hover {
background-color: #e64a19;
}