-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle.css
More file actions
251 lines (219 loc) · 5.66 KB
/
style.css
File metadata and controls
251 lines (219 loc) · 5.66 KB
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
body, html {
height: 100%;
margin: 0;
font-family: Arial, sans-serif;
color: #333;
text-align: center;
padding: 20px;
}
.background-blur {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: url("https://images.pexels.com/photos/2642612/pexels-photo-2642612.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1");
background-repeat: no-repeat;
background-size: cover;
filter: blur(5px);
z-index: -1; /* Pastikan background berada di belakang konten */
}
.weather-app {
max-width: 600px;
margin: 0 auto;
margin-top: 20px;
padding: 20px;
background-color: #ffffff;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
z-index: 1;
position: relative; /* Tetapkan posisi relatif untuk memastikan berada di atas background */
transition: background-color 0.5s ease, color 0.5s ease;
}
.input-group {
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 20px;
margin-top: 20px;
}
input[type="text"] {
padding: 10px;
font-size: 1em;
border: 1px solid #ccc;
border-radius: 4px 0 0 4px;
width: 50%;
box-sizing: border-box;
}
button {
padding: 10px 20px;
font-size: 1em;
border: none;
border-radius: 0 4px 4px 0;
background-color: #007BFF;
color: #fff;
cursor: pointer;
transition: background-color 0.3s ease;
box-sizing: border-box;
}
button:hover {
background-color: #0056b3;
}
#weatherResult {
margin-top: 20px;
}
/* Switch Toggle Style */
.switch {
position: absolute;
top: 10px;
right: 10px;
width: 60px;
height: 34px;
z-index: 2; /* Memastikan toggle berada di atas konten lain */
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
transition: .4s;
border-radius: 34px;
}
.slider:before {
position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px;
background-color: #000; /* Warna hitam untuk lingkaran */
transition: .4s;
border-radius: 50%;
}
input:checked + .slider {
background-color: #2196F3;
}
input:checked + .slider:before {
transform: translateX(26px);
}
/* Theme Styles */
.weather-app.light-mode {
background-color: #ffffff;
color: #000000;
}
.weather-app.dark-mode {
background-color: #333333;
color: #ffffff;
}
@media (max-width: 600px) {
.weather-app {
padding: 15px;
}
input[type="text"], button {
width: 100%;
margin-bottom: 10px;
border-radius: 4px;
}
.switch {
top: 18px;
right: 15px;
width: 40px; /* Sesuaikan ukuran switch */
height: 22px; /* Sesuaikan tinggi switch */
}
.switch .slider:before {
width: 18px; /* Sesuaikan ukuran bola */
height: 18px; /* Sesuaikan ukuran bola */
top: 2px; /* Posisikan bola di tengah */
left: 2px; /* Sesuaikan posisi kiri */
transform: translateX(0); /* Reset transformasi */
}
input:checked + .slider:before {
transform: translateX(18px); /* Sesuaikan dengan lebar switch */
}
}
.spinner {
width: 50px;
height: 50px;
border: 5px solid rgba(0, 0, 0, 0.1);
border-radius: 50%;
border-top: 5px solid #3498db;
animation: spin 1s linear infinite;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 9999; /* Pastikan spinner di atas elemen lain */
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* Kontainer untuk kartu ramalan cuaca */
.forecast-container {
display: flex; /* Menggunakan flexbox untuk tata letak horizontal */
flex-wrap: nowrap; /* Menjaga kartu tetap berada dalam satu baris */
overflow-x: auto; /* Menambahkan scroll horizontal jika diperlukan */
margin-top: 20px;
padding: 10px 0; /* Menambahkan padding atas dan bawah */
}
/* Kartu ramalan cuaca */
.forecast-item {
flex: 0 0 auto; /* Mengatur ukuran kartu agar tidak berubah */
width: 180px; /* Menetapkan lebar tetap */
margin: 10px; /* Jarak antara kartu */
padding: 15px;
background-color: #f9f9f9;
border-radius: 12px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
text-align: center;
transition: transform 0.3s, box-shadow 0.3s;
}
/* Efek saat hover */
.forecast-item:hover {
transform: scale(1.05);
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}
/* Gambar cuaca */
.forecast-item img {
width: 60px;
height: 60px;
margin-bottom: 10px;
}
/* Judul ramalan cuaca */
.forecast-item h3 {
margin: 10px 0;
font-size: 1.2em;
color: #333;
}
/* Deskripsi ramalan cuaca */
.forecast-item p {
margin: 5px 0;
font-size: 0.9em;
color: #555;
}
/* Tema gelap */
.weather-app.dark-mode .forecast-item {
background-color: #444;
color: #ddd;
}
/* Judul ramalan cuaca dalam tema gelap */
.weather-app.dark-mode .forecast-item h3 {
color: #fff; /* Ubah warna h3 menjadi putih saat dark mode */
}
/* Deskripsi ramalan cuaca dalam tema gelap */
.weather-app.dark-mode .forecast-item p {
color: #ccc;
}
/* Pastikan h2 juga berubah warna saat dark mode */
.weather-app.dark-mode #geoWeather h2,
.weather-app.dark-mode #cityWeather h2 {
color: #fff; /* Ubah warna h2 menjadi putih saat dark mode */
}