@@ -4,6 +4,7 @@ import "@/assets/styles/barahkhadi/index.css";
44
55import { hindiConsonants } from " @/utils/common" ;
66import { matras } from " @/utils/common" ;
7+ import Help from " @/components/Help.astro" ;
78
89const 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