Skip to content

Commit 360ac63

Browse files
committed
added help to barahkhadi page
1 parent 7675047 commit 360ac63

File tree

1 file changed

+27
-23
lines changed

1 file changed

+27
-23
lines changed

src/pages/barahkhadi/index.astro

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import "@/assets/styles/barahkhadi/index.css";
44
55
import { hindiConsonants } from "@/utils/common";
66
import { matras } from "@/utils/common";
7+
import Help from "@/components/Help.astro";
78
89
const consonants = [
910
hindiConsonants.slice(0, 5), // क, ख, ग, घ, ङ
@@ -16,30 +17,10 @@ const consonants = [
1617
];
1718
---
1819

19-
<script>
20-
document.querySelectorAll(".quick-view-btn").forEach((button) => {
21-
button.addEventListener("click", (e) => {
22-
// Close all other open popovers
23-
document.querySelectorAll('.consonant-card[data-active="true"]').forEach((card) => {
24-
if (card !== (e.currentTarget as HTMLElement).closest(".consonant-card")) {
25-
// Don't reset current card
26-
const btn = card.querySelector(".quick-view-btn") as HTMLElement;
27-
card.setAttribute("data-active", "false");
28-
btn.textContent = "🔍";
29-
}
30-
});
31-
32-
// Toggle current popover
33-
const card = (e.currentTarget as HTMLElement).closest(".consonant-card") as HTMLElement;
34-
const isActive = card.getAttribute("data-active") === "true";
35-
const newState = !isActive;
36-
card.setAttribute("data-active", String(newState));
37-
(e.currentTarget as HTMLElement).textContent = newState ? "✖️" : "🔍";
38-
});
39-
});
40-
</script>
41-
4220
<BaseLayout meta={{ title: "Barahkhadi" }}>
21+
<Fragment slot="header-left">
22+
<Help title="Barahkhadi" description="This page displays the Hindi consonants and their variations." />
23+
</Fragment>
4324
<div class="container__barahkhadi">
4425
<div class="consonants-rows">
4526
{
@@ -68,3 +49,26 @@ const consonants = [
6849
</div>
6950
</div>
7051
</BaseLayout>
52+
53+
<script>
54+
document.querySelectorAll(".quick-view-btn").forEach((button) => {
55+
button.addEventListener("click", (e) => {
56+
// Close all other open popovers
57+
document.querySelectorAll('.consonant-card[data-active="true"]').forEach((card) => {
58+
if (card !== (e.currentTarget as HTMLElement).closest(".consonant-card")) {
59+
// Don't reset current card
60+
const btn = card.querySelector(".quick-view-btn") as HTMLElement;
61+
card.setAttribute("data-active", "false");
62+
btn.textContent = "🔍";
63+
}
64+
});
65+
66+
// Toggle current popover
67+
const card = (e.currentTarget as HTMLElement).closest(".consonant-card") as HTMLElement;
68+
const isActive = card.getAttribute("data-active") === "true";
69+
const newState = !isActive;
70+
card.setAttribute("data-active", String(newState));
71+
(e.currentTarget as HTMLElement).textContent = newState ? "✖️" : "🔍";
72+
});
73+
});
74+
</script>

0 commit comments

Comments
 (0)