Skip to content

Commit fdad1ef

Browse files
committed
added multiple states in capital astro and header logo minimize
1 parent 2013132 commit fdad1ef

File tree

4 files changed

+34
-9
lines changed

4 files changed

+34
-9
lines changed

src/assets/styles/capital.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
.location-grid {
157157
display: grid;
158158
gap: 1.5rem;
159-
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
159+
grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
160160
align-items: start;
161161
}
162162

@@ -369,7 +369,7 @@
369369
/* Responsive Design */
370370
@media (max-width: 768px) {
371371
.location-grid {
372-
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
372+
grid-template-columns: repeat(auto-fill, minmax(30%, 1fr));
373373
}
374374

375375
.section-header {
@@ -413,4 +413,4 @@
413413
.search-container {
414414
max-width: 100%;
415415
}
416-
}
416+
}

src/components/Capital.astro

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,14 @@ function getColorClass(index: number) {
5858
>
5959
<details>
6060
<summary title={state.name}>{state.name}</summary>
61-
<p title={state.capital}>{state.capital}</p>
61+
<p title={state.capital}>
62+
{state.capital}
63+
{state.multiple && (
64+
<span style={{ color: "grey" }} aria-label="capital in winter">
65+
| ❄️ {state.multiple.winter}
66+
</span>
67+
)}
68+
</p>
6269
</details>
6370
</article>
6471
))
@@ -82,7 +89,14 @@ function getColorClass(index: number) {
8289
>
8390
<details>
8491
<summary title={ut.name}>{ut.name}</summary>
85-
<p title={ut.capital}>{ut.capital}</p>
92+
<p title={ut.capital}>
93+
{ut.capital}
94+
{ut.multiple && (
95+
<span style={{ color: "grey" }} aria-label="capital in winter">
96+
| ❄️ {ut.multiple.winter}
97+
</span>
98+
)}
99+
</p>
86100
</details>
87101
</article>
88102
))

src/layouts/common/Header.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import "@/assets/styles/header.css";
33
import { APP_NAME } from "@/utils/constants";
44
import { Picture } from "astro:assets";
5-
import logoImage from "/public/assets/images/512x512.png";
5+
import logoImage from "/public/assets/images/48x48.png";
66
---
77

88
<header class="header">

src/utils/location.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export interface Location {
22
name: string;
33
capital: string;
44
isState: boolean;
5+
multiple?: { summer: string; winter: string };
56
}
67

78
export const locations: Location[] = [
@@ -14,12 +15,17 @@ export const locations: Location[] = [
1415
{ name: "Goa", capital: "Panaji", isState: true },
1516
{ name: "Gujarat", capital: "Gandhinagar", isState: true },
1617
{ name: "Haryana", capital: "Chandigarh", isState: true },
17-
{ name: "Himachal Pradesh", capital: "Shimla", isState: true },
18+
{ name: "Himachal Pradesh", capital: "Shimla", isState: true, multiple: { summer: "Shimla", winter: "Dharmshala" } },
1819
{ name: "Jharkhand", capital: "Ranchi", isState: true },
1920
{ name: "Karnataka", capital: "Bengaluru", isState: true },
2021
{ name: "Kerala", capital: "Thiruvananthapuram", isState: true },
2122
{ name: "Madhya Pradesh", capital: "Bhopal", isState: true },
22-
{ name: "Maharashtra", capital: "Mumbai", isState: true },
23+
{
24+
name: "Maharashtra",
25+
capital: "Mumbai",
26+
isState: true,
27+
multiple: { summer: "Mumbai", winter: "Nagpur" }
28+
},
2329
{ name: "Manipur", capital: "Imphal", isState: true },
2430
{ name: "Meghalaya", capital: "Shillong", isState: true },
2531
{ name: "Mizoram", capital: "Aizawl", isState: true },
@@ -39,7 +45,12 @@ export const locations: Location[] = [
3945
{ name: "Andaman and Nicobar Islands", capital: "Port Blair", isState: false },
4046
{ name: "Chandigarh", capital: "Chandigarh", isState: false },
4147
{ name: "Dadra and Nagar Haveli and Daman and Diu", capital: "Daman", isState: false },
42-
{ name: "Jammu & Kashmir", capital: "Srinagar", isState: false },
48+
{
49+
name: "Jammu and Kashmir",
50+
capital: "Srinagar",
51+
isState: false,
52+
multiple: { summer: "Srinagar", winter: "Jammu" }
53+
},
4354
{ name: "Ladakh", capital: "Leh", isState: false },
4455
{ name: "Lakshadweep", capital: "Kavaratti", isState: false },
4556
{ name: "Delhi", capital: "New Delhi", isState: false },

0 commit comments

Comments
 (0)