-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle.css
More file actions
356 lines (304 loc) · 8.89 KB
/
Copy pathstyle.css
File metadata and controls
356 lines (304 loc) · 8.89 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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
/* ── CSS Variables (Design Tokens) ──────────────────────────── */
:root {
/* Background — Part 2 will swap this dynamically */
--bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
/* Cards */
--card-bg: rgba(255, 255, 255, 0.08);
--card-border: rgba(255, 255, 255, 0.12);
--card-radius: 16px;
/* Typography */
--font: "Inter", sans-serif;
--text-primary: #ffffff;
--text-secondary: rgba(255, 255, 255, 0.65);
--text-muted: rgba(255, 255, 255, 0.4);
/* Accent — WECS pink */
--accent: #e91e8c;
--accent-light: rgba(233, 30, 140, 0.15);
/* Spacing scale */
--space-sm: 8px;
--space-md: 16px;
--space-lg: 24px;
--space-xl: 40px;
/* Transitions */
--transition: 0.25s ease;
}
/* ── Reset & Base ────────────────────────────────────────────── */
*, *::before, *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: var(--font);
background: var(--bg-gradient);
/* min-height ensures the gradient covers the full viewport
even when there's not much content */
min-height: 100vh;
color: var(--text-primary);
/* Part 2 hook: background-attachment fixed makes gradient
stay in place when dynamic backgrounds are added */
background-attachment: fixed;
}
/* ── Layout ──────────────────────────────────────────────────── */
.app-container {
max-width: 720px;
margin: 0 auto;
padding: var(--space-xl) var(--space-md);
display: flex;
flex-direction: column;
gap: var(--space-lg);
}
/* ── Header ──────────────────────────────────────────────────── */
.app-header {
text-align: center;
}
.app-title {
font-size: 2rem;
font-weight: 700;
letter-spacing: -0.5px;
}
.app-subtitle {
font-size: 0.85rem;
color: var(--text-muted);
margin-top: 4px;
}
/* ── Search ──────────────────────────────────────────────────── */
.search-section {
display: flex;
flex-direction: column;
gap: var(--space-sm);
}
.search-bar {
display: flex;
gap: var(--space-sm);
}
.search-input {
flex: 1;
padding: 14px var(--space-md);
border-radius: 12px;
border: 1px solid var(--card-border);
background: var(--card-bg);
color: var(--text-primary);
font-family: var(--font);
font-size: 1rem;
outline: none;
transition: border-color var(--transition);
}
.search-input::placeholder {
color: var(--text-muted);
}
.search-input:focus {
border-color: var(--accent);
}
.search-btn {
padding: 14px var(--space-lg);
border-radius: 12px;
border: none;
background: var(--accent);
color: #fff;
font-family: var(--font);
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: opacity var(--transition), transform var(--transition);
}
.search-btn:hover {
opacity: 0.88;
transform: translateY(-1px);
}
.search-btn:active {
transform: translateY(0);
}
/* ── Error message ───────────────────────────────────────────── */
.error-msg {
color: #ff6b6b;
font-size: 0.9rem;
padding: var(--space-sm) var(--space-md);
background: rgba(255, 107, 107, 0.1);
border-radius: 8px;
border: 1px solid rgba(255, 107, 107, 0.3);
}
/* ── Loading spinner ─────────────────────────────────────────── */
.loading {
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-md);
color: var(--text-secondary);
padding: var(--space-xl) 0;
}
.spinner {
width: 40px;
height: 40px;
border: 3px solid var(--card-border);
border-top-color: var(--accent);
border-radius: 50%;
animation: spin 0.8s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
/* ── Utility: hidden ─────────────────────────────────────────── */
/* We toggle this class from JavaScript to show/hide sections */
.hidden {
display: none !important;
}
/* ── Cards ───────────────────────────────────────────────────── */
.card {
background: var(--card-bg);
border: 1px solid var(--card-border);
border-radius: var(--card-radius);
padding: var(--space-lg);
/* Glassmorphism effect — subtle blur on card background */
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
}
.card-title {
font-size: 0.8rem;
font-weight: 600;
letter-spacing: 1px;
text-transform: uppercase;
color: var(--text-muted);
margin-bottom: var(--space-md);
}
/* ── Current weather card ────────────────────────────────────── */
.current-top {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: var(--space-md);
}
.city-name {
font-size: 1.6rem;
font-weight: 700;
}
.city-country {
font-size: 0.9rem;
color: var(--text-secondary);
margin-top: 2px;
}
.weather-icon {
width: 72px;
height: 72px;
}
.current-main {
display: flex;
align-items: baseline;
gap: var(--space-md);
margin-bottom: var(--space-lg);
}
.current-temp {
font-size: 3.5rem;
font-weight: 300;
letter-spacing: -2px;
line-height: 1;
}
.current-desc {
font-size: 1.1rem;
color: var(--text-secondary);
text-transform: capitalize;
}
/* ── Detail grid ─────────────────────────────────────────────── */
.detail-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: var(--space-sm);
}
.detail-item {
background: var(--accent-light);
border-radius: 10px;
padding: var(--space-sm) var(--space-md);
display: flex;
flex-direction: column;
gap: 2px;
}
.detail-label {
font-size: 0.72rem;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 0.5px;
}
.detail-value {
font-size: 0.95rem;
font-weight: 500;
}
/* ── AQI card ────────────────────────────────────────────────── */
.aqi-display {
display: flex;
align-items: center;
gap: var(--space-md);
}
.aqi-label {
font-size: 1.2rem;
font-weight: 700;
padding: 6px 16px;
border-radius: 20px;
/* color set dynamically by JS using the hex from our API */
background: rgba(255,255,255,0.1);
white-space: nowrap;
}
.aqi-advice {
font-size: 0.9rem;
color: var(--text-secondary);
}
/* ── Forecast strip ──────────────────────────────────────────── */
.forecast-strip {
display: grid;
/* auto-fit: creates as many columns as fit, minimum 80px each */
grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
gap: var(--space-sm);
}
.forecast-day {
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
padding: var(--space-sm);
border-radius: 10px;
background: var(--accent-light);
text-align: center;
}
.forecast-day-name {
font-size: 0.75rem;
font-weight: 600;
color: var(--text-secondary);
text-transform: uppercase;
letter-spacing: 0.5px;
}
.forecast-icon {
width: 40px;
height: 40px;
}
.forecast-high {
font-size: 0.95rem;
font-weight: 600;
}
.forecast-low {
font-size: 0.8rem;
color: var(--text-muted);
}
/* ── Footer ──────────────────────────────────────────────────── */
.app-footer {
text-align: center;
font-size: 0.8rem;
color: var(--text-muted);
}
.app-footer a {
color: var(--accent);
text-decoration: none;
}
.app-footer a:hover {
text-decoration: underline;
}
/* ── Responsive — phones ─────────────────────────────────────── */
@media (max-width: 480px) {
.current-temp {
font-size: 2.8rem;
}
.detail-grid {
grid-template-columns: repeat(2, 1fr);
}
.search-btn {
padding: 14px var(--space-md);
}
}