Update style.css
Browse files
style.css
CHANGED
@@ -1,102 +1,108 @@
|
|
1 |
-
/*
|
2 |
-
|
3 |
margin: 0;
|
4 |
padding: 0;
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
|
|
7 |
display: flex;
|
8 |
justify-content: center;
|
9 |
align-items: center;
|
10 |
height: 100vh;
|
11 |
-
|
12 |
}
|
13 |
|
14 |
-
/*
|
15 |
.game-container {
|
16 |
-
width: 80
|
17 |
-
height:
|
18 |
position: relative;
|
19 |
background: linear-gradient(45deg, #00b3b3, #cc00cc);
|
20 |
-
border-radius:
|
21 |
-
box-shadow:
|
|
|
22 |
}
|
23 |
|
24 |
-
/* Styling bola */
|
25 |
.ball {
|
26 |
position: absolute;
|
27 |
width: 30px;
|
28 |
height: 30px;
|
29 |
background-color: #ffcc00;
|
30 |
border-radius: 50%;
|
31 |
-
top:
|
32 |
left: 50%;
|
33 |
transform: translateX(-50%);
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
}
|
37 |
|
38 |
-
/* Styling platform */
|
39 |
.platform {
|
40 |
position: absolute;
|
41 |
-
bottom:
|
42 |
-
width:
|
43 |
-
height:
|
44 |
background-color: #ff6600;
|
45 |
border-radius: 5px;
|
46 |
left: 50%;
|
47 |
transform: translateX(-50%);
|
48 |
-
box-shadow: 0px 0px 15px rgba(255, 102, 0, 0.6);
|
49 |
-
}
|
50 |
-
|
51 |
-
/* Styling untuk skor dan nyawa */
|
52 |
-
.score-board, .lives {
|
53 |
-
position: absolute;
|
54 |
-
top: 10px;
|
55 |
-
font-size: 1.5em;
|
56 |
-
color: #ffffff;
|
57 |
-
background-color: rgba(0, 0, 0, 0.5);
|
58 |
-
padding: 10px;
|
59 |
-
font-weight: bold;
|
60 |
-
border-radius: 10px;
|
61 |
}
|
62 |
|
63 |
-
|
64 |
-
left: 10px;
|
65 |
-
}
|
66 |
-
|
67 |
-
.lives {
|
68 |
-
right: 10px;
|
69 |
-
}
|
70 |
-
|
71 |
-
/* Kontrol tombol */
|
72 |
.controls {
|
73 |
position: absolute;
|
74 |
bottom: 20px;
|
75 |
display: flex;
|
76 |
-
justify-content:
|
77 |
-
|
78 |
-
|
79 |
}
|
80 |
|
81 |
.controls button {
|
82 |
-
|
83 |
-
|
84 |
-
background-color:
|
85 |
color: white;
|
86 |
border: none;
|
87 |
border-radius: 5px;
|
88 |
cursor: pointer;
|
89 |
-
transition: background-color 0.
|
90 |
}
|
91 |
|
92 |
.controls button:hover {
|
93 |
-
background-color:
|
94 |
-
transform: scale(1.1);
|
95 |
}
|
96 |
|
97 |
-
/* Styling untuk
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
.game-over-message {
|
99 |
-
position:
|
100 |
top: 50%;
|
101 |
left: 50%;
|
102 |
transform: translate(-50%, -50%);
|
@@ -105,49 +111,28 @@ body {
|
|
105 |
text-align: center;
|
106 |
padding: 30px;
|
107 |
border-radius: 15px;
|
108 |
-
display: none; /*
|
109 |
-
|
110 |
-
box-shadow: 0px 0px 30px rgba(0, 255, 255, 0.7);
|
111 |
}
|
112 |
|
113 |
.game-over-message h2 {
|
114 |
-
font-size:
|
115 |
-
margin-bottom: 10px;
|
116 |
-
text-transform: uppercase;
|
117 |
-
color: #00b3b3;
|
118 |
-
font-weight: 700;
|
119 |
}
|
120 |
|
121 |
.game-over-message p {
|
122 |
-
font-size: 1.
|
123 |
-
margin-bottom: 20px;
|
124 |
}
|
125 |
|
126 |
.game-over-message button {
|
|
|
127 |
background-color: #ff6600;
|
128 |
color: white;
|
129 |
-
|
130 |
-
padding: 12px 25px;
|
131 |
-
font-size: 1.6em;
|
132 |
border-radius: 10px;
|
133 |
cursor: pointer;
|
134 |
-
transition: background-color 0.
|
135 |
}
|
136 |
|
137 |
.game-over-message button:hover {
|
138 |
background-color: #e64a19;
|
139 |
-
transform: scale(1.1);
|
140 |
-
}
|
141 |
-
|
142 |
-
/* Styling untuk timer */
|
143 |
-
.timer {
|
144 |
-
position: absolute;
|
145 |
-
top: 50px;
|
146 |
-
right: 10px;
|
147 |
-
font-size: 1.5em;
|
148 |
-
color: white;
|
149 |
-
background-color: rgba(0, 0, 0, 0.5);
|
150 |
-
padding: 10px;
|
151 |
-
font-weight: bold;
|
152 |
-
border-radius: 10px;
|
153 |
}
|
|
|
1 |
+
/* Reset styling untuk memastikan semua elemen berada dalam tampilan yang rapi */
|
2 |
+
* {
|
3 |
margin: 0;
|
4 |
padding: 0;
|
5 |
+
box-sizing: border-box;
|
6 |
+
}
|
7 |
+
|
8 |
+
/* Menetapkan body agar game terlihat proporsional di semua perangkat */
|
9 |
+
body {
|
10 |
+
font-family: 'Arial', sans-serif;
|
11 |
display: flex;
|
12 |
justify-content: center;
|
13 |
align-items: center;
|
14 |
height: 100vh;
|
15 |
+
background-color: #121212;
|
16 |
}
|
17 |
|
18 |
+
/* Kontainer utama game dengan ukuran tetap proporsional */
|
19 |
.game-container {
|
20 |
+
width: 80vw; /* Lebar 80% dari layar */
|
21 |
+
height: 60vh; /* Tinggi 60% dari layar */
|
22 |
position: relative;
|
23 |
background: linear-gradient(45deg, #00b3b3, #cc00cc);
|
24 |
+
border-radius: 10px;
|
25 |
+
box-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
|
26 |
+
overflow: hidden;
|
27 |
}
|
28 |
|
29 |
+
/* Styling untuk bola */
|
30 |
.ball {
|
31 |
position: absolute;
|
32 |
width: 30px;
|
33 |
height: 30px;
|
34 |
background-color: #ffcc00;
|
35 |
border-radius: 50%;
|
36 |
+
top: 10%;
|
37 |
left: 50%;
|
38 |
transform: translateX(-50%);
|
39 |
+
animation: ballAnimation 4s linear infinite;
|
40 |
+
}
|
41 |
+
|
42 |
+
/* Animasi untuk pergerakan bola */
|
43 |
+
@keyframes ballAnimation {
|
44 |
+
0% { top: 10%; }
|
45 |
+
50% { top: 90%; }
|
46 |
+
100% { top: 10%; }
|
47 |
}
|
48 |
|
49 |
+
/* Styling untuk platform */
|
50 |
.platform {
|
51 |
position: absolute;
|
52 |
+
bottom: 5%;
|
53 |
+
width: 15vw; /* Platform proporsional dengan lebar layar */
|
54 |
+
height: 5vh; /* Platform proporsional dengan tinggi layar */
|
55 |
background-color: #ff6600;
|
56 |
border-radius: 5px;
|
57 |
left: 50%;
|
58 |
transform: translateX(-50%);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
}
|
60 |
|
61 |
+
/* Styling untuk kontrol tombol */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
.controls {
|
63 |
position: absolute;
|
64 |
bottom: 20px;
|
65 |
display: flex;
|
66 |
+
justify-content: space-between;
|
67 |
+
width: 80%;
|
68 |
+
padding: 10px;
|
69 |
}
|
70 |
|
71 |
.controls button {
|
72 |
+
font-size: 1.5rem;
|
73 |
+
padding: 10px 15px;
|
74 |
+
background-color: #333;
|
75 |
color: white;
|
76 |
border: none;
|
77 |
border-radius: 5px;
|
78 |
cursor: pointer;
|
79 |
+
transition: background-color 0.3s;
|
80 |
}
|
81 |
|
82 |
.controls button:hover {
|
83 |
+
background-color: #555;
|
|
|
84 |
}
|
85 |
|
86 |
+
/* Styling untuk skor dan nyawa */
|
87 |
+
.score-board, .lives {
|
88 |
+
position: absolute;
|
89 |
+
top: 10px;
|
90 |
+
font-size: 1.2rem;
|
91 |
+
color: white;
|
92 |
+
font-weight: bold;
|
93 |
+
}
|
94 |
+
|
95 |
+
.score-board {
|
96 |
+
left: 10px;
|
97 |
+
}
|
98 |
+
|
99 |
+
.lives {
|
100 |
+
right: 10px;
|
101 |
+
}
|
102 |
+
|
103 |
+
/* Game Over message */
|
104 |
.game-over-message {
|
105 |
+
position: absolute;
|
106 |
top: 50%;
|
107 |
left: 50%;
|
108 |
transform: translate(-50%, -50%);
|
|
|
111 |
text-align: center;
|
112 |
padding: 30px;
|
113 |
border-radius: 15px;
|
114 |
+
display: none; /* Hidden by default */
|
115 |
+
box-shadow: 0 0 30px rgba(0, 255, 255, 0.7);
|
|
|
116 |
}
|
117 |
|
118 |
.game-over-message h2 {
|
119 |
+
font-size: 2rem;
|
|
|
|
|
|
|
|
|
120 |
}
|
121 |
|
122 |
.game-over-message p {
|
123 |
+
font-size: 1.5rem;
|
|
|
124 |
}
|
125 |
|
126 |
.game-over-message button {
|
127 |
+
padding: 12px 25px;
|
128 |
background-color: #ff6600;
|
129 |
color: white;
|
130 |
+
font-size: 1.2rem;
|
|
|
|
|
131 |
border-radius: 10px;
|
132 |
cursor: pointer;
|
133 |
+
transition: background-color 0.2s ease;
|
134 |
}
|
135 |
|
136 |
.game-over-message button:hover {
|
137 |
background-color: #e64a19;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
}
|