GarGerry commited on
Commit
f5f4767
·
verified ·
1 Parent(s): 48a6b47

Update style.css

Browse files
Files changed (1) hide show
  1. style.css +64 -79
style.css CHANGED
@@ -1,102 +1,108 @@
1
- /* Styling untuk body dan kontainer utama */
2
- body {
3
  margin: 0;
4
  padding: 0;
5
- overflow: hidden;
6
- background-color: #0d0d0d;
 
 
 
 
7
  display: flex;
8
  justify-content: center;
9
  align-items: center;
10
  height: 100vh;
11
- font-family: 'Roboto', sans-serif;
12
  }
13
 
14
- /* Game Container */
15
  .game-container {
16
- width: 80%;
17
- height: 80%;
18
  position: relative;
19
  background: linear-gradient(45deg, #00b3b3, #cc00cc);
20
- border-radius: 15px;
21
- box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.5);
 
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: 0;
32
  left: 50%;
33
  transform: translateX(-50%);
34
- box-shadow: 0px 0px 10px rgba(255, 204, 0, 0.6);
35
- transition: transform 0.2s ease;
 
 
 
 
 
 
36
  }
37
 
38
- /* Styling platform */
39
  .platform {
40
  position: absolute;
41
- bottom: 10px;
42
- width: 100px;
43
- height: 20px;
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
- .score-board {
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: center;
77
- gap: 20px;
78
- width: 100%;
79
  }
80
 
81
  .controls button {
82
- padding: 10px 20px;
83
- font-size: 1.5em;
84
- background-color: rgba(0, 0, 0, 0.7);
85
  color: white;
86
  border: none;
87
  border-radius: 5px;
88
  cursor: pointer;
89
- transition: background-color 0.2s ease, transform 0.1s ease;
90
  }
91
 
92
  .controls button:hover {
93
- background-color: rgba(0, 0, 0, 0.9);
94
- transform: scale(1.1);
95
  }
96
 
97
- /* Styling untuk pesan Game Over */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  .game-over-message {
99
- position: fixed;
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; /* Sembunyikan Game Over saat permainan berlangsung */
109
- width: 60%;
110
- box-shadow: 0px 0px 30px rgba(0, 255, 255, 0.7);
111
  }
112
 
113
  .game-over-message h2 {
114
- font-size: 2.5em;
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.5em;
123
- margin-bottom: 20px;
124
  }
125
 
126
  .game-over-message button {
 
127
  background-color: #ff6600;
128
  color: white;
129
- border: none;
130
- padding: 12px 25px;
131
- font-size: 1.6em;
132
  border-radius: 10px;
133
  cursor: pointer;
134
- transition: background-color 0.3s ease, transform 0.1s ease;
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
  }