Skip to content

Commit 766d4c7

Browse files
Feature/rza-250175:Analytics Added with partytown integration (#172)
2 parents f544d92 + bc8ed5f commit 766d4c7

File tree

15 files changed

+447
-148
lines changed

15 files changed

+447
-148
lines changed

.vscode/dictionaries/project-words.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ datetime
2626
Deepavali
2727
dhaga
2828
Dhaivat
29+
Disha
2930
dogri
3031
DPDP
3132
Dussehra
@@ -59,6 +60,7 @@ LXXX
5960
Madhyam
6061
Magha
6162
maithili
63+
Majeure
6264
Margashirsha
6365
matra
6466
matras

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ Created Repo from template
3636
- Mobile view fixed for pages
3737
- FAQs updated
3838

39+
## [3.2.3] - 2025-09-07
40+
41+
- Added Google Analytics with partytown
42+
- Added Disha and Purana names in Glossary
43+
3944
### [Unreleased]
4045

4146
Here we write upgrading notes for brands. It's a team effort to make them as straightforward as possible.

astro.config.mjs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import mdx from "@astrojs/mdx";
2+
import partytown from "@astrojs/partytown";
23
import sitemap from "@astrojs/sitemap";
34
import { defineConfig } from "astro/config";
45

@@ -18,7 +19,16 @@ export default defineConfig({
1819
experimental: {
1920
svg: true
2021
},
21-
integrations: [sitemap(), mdx()],
22+
integrations: [
23+
partytown({
24+
// https://partytown.qwik.dev/google-tag-manager/#google-analytics-4-ga4
25+
config: {
26+
forward: ["dataLayer.push"]
27+
}
28+
}),
29+
sitemap(),
30+
mdx()
31+
],
2232
style: {
2333
global: true // Ensure global styles are applied
2434
},

package-lock.json

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@recursivezero/abcd",
3-
"version": "3.2.3",
3+
"version": "3.2.4",
44
"description": "A website for our kids trial phase of abcdkbd.com",
55
"homepage": "https://abcdkbd.com",
66
"displayName": "abcd",
@@ -112,6 +112,7 @@
112112
"@astrojs/check": "0.9.4",
113113
"@astrojs/mdx": "4.0.3",
114114
"@astrojs/node": "9.1.2",
115+
"@astrojs/partytown": "2.1.4",
115116
"@astrojs/sitemap": "3.4.1",
116117
"@fontsource/roboto": "5.1.0",
117118
"astro": "5.4.1",
@@ -135,5 +136,8 @@
135136
"prettier": "3.1.0",
136137
"prettier-plugin-astro": "0.14.1",
137138
"shx": "0.3.4"
139+
},
140+
"engines": {
141+
"node": "^20"
138142
}
139-
}
143+
}

src/assets/styles/letter-card.css

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,14 @@
2929
justify-content: center;
3030
align-items: center;
3131
height: 100%;
32-
font-size: clamp(3rem, 6vw, 4rem);
32+
font-size: clamp(3rem, 6vw, 3.25rem);
3333
font-weight: 800;
3434
margin: 0;
3535
line-height: 1.2;
3636
/* Adjusted line-height */
37-
background: linear-gradient(
38-
135deg,
39-
var(--character-gradient-start, var(--primary)) 0%,
40-
var(--character-gradient-end, var(--primary-light)) 100%
41-
);
37+
background: linear-gradient(135deg,
38+
var(--character-gradient-start, var(--primary)) 0%,
39+
var(--character-gradient-end, var(--primary-light)) 100%);
4240
-webkit-background-clip: text;
4341
background-clip: text;
4442
color: transparent;
@@ -194,11 +192,9 @@
194192
& .card__glow {
195193
position: absolute;
196194
inset: 0;
197-
background: radial-gradient(
198-
circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
199-
color-mix(in srgb, var(--primary) 10%, transparent) 0%,
200-
transparent 60%
201-
);
195+
background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
196+
color-mix(in srgb, var(--primary) 10%, transparent) 0%,
197+
transparent 60%);
202198
opacity: 0;
203199
transition: opacity 0.3s ease;
204200
pointer-events: none;
@@ -217,4 +213,4 @@
217213
font-size: 0.875rem;
218214
}
219215
}
220-
}
216+
}

src/assets/styles/nakshtra.css

Lines changed: 115 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,61 @@
44
padding-inline: 1rem;
55
}
66

7+
.legend__list {
8+
display: flex;
9+
align-items: center;
10+
flex-wrap: wrap;
11+
12+
div {
13+
flex: 1;
14+
text-align: right;
15+
font-style: italic;
16+
}
17+
18+
.legend {
19+
font-size: large;
20+
color: rgb(44, 45, 42);
21+
margin-inline-end: 4px;
22+
23+
&::before {
24+
content: attr(data-icon);
25+
font-size: 1.75rem;
26+
}
27+
}
28+
29+
dl {
30+
display: flex;
31+
margin: 3px 4px;
32+
align-items: center;
33+
padding-inline: 1rem;
34+
border: 3px dotted #b2c3d9;
35+
}
36+
37+
dd {
38+
margin: 0;
39+
padding: 0.3rem 0.6rem;
40+
border-radius: 0.5rem;
41+
font-size: 1.25rem;
42+
}
43+
}
44+
745
.card__list {
846
display: grid;
947
grid-template-columns: repeat(auto-fill, minmax(20%, 1fr));
1048
gap: 1rem;
11-
margin: 1rem;
12-
}
49+
margin-block: 1rem;
50+
1351

14-
@container nakshtra (width <=700px) {
15-
.card__list {
16-
grid-template-columns: repeat(2, 1fr);
52+
@container nakshtra (width <=700px) {
53+
.card__list {
54+
grid-template-columns: repeat(2, 1fr);
55+
}
1756
}
18-
}
1957

20-
@container nakshtra (width <=468px) {
21-
.card__list {
22-
grid-template-columns: 1fr;
58+
@container nakshtra (width <=468px) {
59+
.card__list {
60+
grid-template-columns: 1fr;
61+
}
2362
}
2463
}
2564

@@ -31,4 +70,71 @@
3170
background-color: rgba(var(--card-bg), 0.5);
3271
border-left: 4px solid var(--primary-color);
3372
opacity: 0.8;
73+
}
74+
75+
76+
77+
78+
/* Nakshtra card */
79+
.card {
80+
border-radius: 8px;
81+
padding: 1rem;
82+
text-align: center;
83+
cursor: pointer;
84+
transition:
85+
transform 0.2s,
86+
box-shadow 0.2s;
87+
box-shadow: 0 2px 5px var(--primary-color);
88+
aspect-ratio: 1/1;
89+
display: flex;
90+
flex-direction: column;
91+
justify-content: start;
92+
position: relative;
93+
}
94+
95+
.card:hover {
96+
transform: translateY(-5px);
97+
box-shadow: 0 25px 75px var(--primary-color);
98+
}
99+
100+
.nakshatra-card {
101+
aspect-ratio: auto;
102+
cursor: default;
103+
padding: 1.5rem;
104+
display: flex;
105+
flex-direction: column;
106+
align-items: center;
107+
108+
img {
109+
width: 100%;
110+
aspect-ratio: 1;
111+
}
112+
113+
h3 {
114+
font-size: 2rem;
115+
color: #df9f9f;
116+
margin: 0;
117+
}
118+
119+
.nakshatra-details {
120+
padding: 0;
121+
margin: 0;
122+
font-size: 0.95rem;
123+
width: 100%;
124+
text-align: left;
125+
126+
p {
127+
padding: 0.5rem 1rem;
128+
margin: 0;
129+
font-size: 1.5rem;
130+
131+
&:nth-child(even) {
132+
border-block: 1px dashed light-dark(#78818d, #123456);
133+
}
134+
135+
& span {
136+
padding-inline: 0.5rem;
137+
}
138+
}
139+
}
34140
}

src/assets/styles/tile.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,10 @@
6161
display: none;
6262
}
6363
}
64+
65+
[data-category="scripture"] .page__grid {
66+
.character {
67+
margin-top: 8px;
68+
font-size: clamp(1rem, 4vw, 2rem);
69+
}
70+
}

src/components/Analytics.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ const gtagScript = `
88
`;
99
---
1010

11-
<script async src={`https://www.googletagmanager.com/gtag/js?id=${GA_ID}`} is:inline></script>
12-
<script define:vars={{ gtagScript }} is:inline>
11+
<script async type="text/partytown" src={`https://www.googletagmanager.com/gtag/js?id=${GA_ID}`} is:inline></script>
12+
<script type="text/partytown" define:vars={{ gtagScript }} is:inline>
1313
{
1414
gtagScript;
1515
}

src/components/District.astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ import "@/assets/styles/map/district.css";
108108
});
109109
texts.forEach((text) => {
110110
text.style.display = "block";
111+
text.style.stroke = "#5417dcb0";
111112
text.style.fill = getComputedStyle(document.documentElement).getPropertyValue("--text");
112113
});
113114
break;
@@ -238,6 +239,7 @@ import "@/assets/styles/map/district.css";
238239

239240
const mouseX = e.clientX;
240241
const mouseY = e.clientY;
242+
tooltip.style.color = "green";
241243

242244
tooltip.style.left = `${mouseX - 250}px`;
243245
tooltip.style.top = `${mouseY - 120}px`;

0 commit comments

Comments
 (0)