Skip to content
This repository was archived by the owner on Jun 19, 2026. It is now read-only.

Commit a81d049

Browse files
feat: fix lint and precommit issue, small fixes (#14)
1 parent 78dd85f commit a81d049

5 files changed

Lines changed: 35 additions & 37 deletions

File tree

.husky/pre-commit

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#!/usr/bin/env sh
12
npx lint-staged

TODO.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
- grab actually astronomical news
88
- add a "learn" page, and a course for whoever is subscribed
99
- fine tune compatibility between two charts
10-
- improve the gaussian chart
1110
- tarot mapping to charts
1211
- add news and subscription
1312
- add login with web3
13+
- add alerting for important event by personal chart (for subscribed users)
14+
- add a tiny $2-4 subscription
15+

app/page.tsx

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ export default function Home() {
231231

232232
<div className="mt-6 flex flex-wrap items-center justify-center gap-3 md:gap-4 font-bold">
233233
<div className="flex items-center gap-1.5">
234-
<Button variant="ghost" className="!py-2 !px-3 text-xl leading-none font-bold" onClick={() => adjust('day', -1)} title={copy.today.prevDay} aria-label={copy.today.prevDay}><span className="text-foreground"></span><span className="text-sm text-muted-foreground ml-0.5">day</span></Button>
235-
<Button variant="ghost" className="!py-2 !px-3 text-xl leading-none font-bold" onClick={() => adjust('month', -1)} title={copy.today.prevMonth} aria-label={copy.today.prevMonth}><span className="text-foreground"></span><span className="text-sm text-muted-foreground ml-0.5">month</span></Button>
236234
<Button variant="ghost" className="!py-2 !px-3 text-xl leading-none font-bold" onClick={() => adjust('year', -1)} title={copy.today.prevYear} aria-label={copy.today.prevYear}><span className="text-foreground"></span><span className="text-sm text-muted-foreground ml-0.5">year</span></Button>
235+
<Button variant="ghost" className="!py-2 !px-3 text-xl leading-none font-bold" onClick={() => adjust('month', -1)} title={copy.today.prevMonth} aria-label={copy.today.prevMonth}><span className="text-foreground"></span><span className="text-sm text-muted-foreground ml-0.5">month</span></Button>
236+
<Button variant="ghost" className="!py-2 !px-3 text-xl leading-none font-bold" onClick={() => adjust('day', -1)} title={copy.today.prevDay} aria-label={copy.today.prevDay}><span className="text-foreground"></span><span className="text-sm text-muted-foreground ml-0.5">day</span></Button>
237237
</div>
238238
<span className="min-w-[160px] text-base text-foreground font-bold tabular-nums">
239239
{formatChartDate(chartMoment, location)}
@@ -273,18 +273,15 @@ export default function Home() {
273273
<p className="text-muted-foreground text-center py-12">loading…</p>
274274
)}
275275

276-
<a
277-
href="#influences"
278-
onClick={(e) => {
279-
e.preventDefault();
280-
document.getElementById('influences')?.scrollIntoView({ behavior: 'smooth' });
281-
}}
282-
className="mt-8 pt-10 flex flex-col items-center gap-1 text-violet-400 hover:text-violet-300 transition-colors"
283-
aria-label="Scroll to major planetary influences this week"
284-
>
285-
<span className="text-base font-bold">{copy.influence.arrowLabel}</span>
286-
<span className="text-xl leading-none opacity-80" aria-hidden></span>
287-
</a>
276+
<div className="mt-12 pt-8 flex items-center justify-center gap-2" aria-hidden>
277+
<span className="h-px flex-1 max-w-20 bg-gradient-to-r from-transparent via-violet-400/30 to-violet-400/60 rounded-full" />
278+
<span className="flex items-center gap-0.5 text-violet-400/90 text-sm drop-shadow-[0_0_8px_rgba(139,92,246,0.4)]" aria-hidden>
279+
<span className="opacity-70"></span>
280+
<span className="text-base"></span>
281+
<span className="opacity-70"></span>
282+
</span>
283+
<span className="h-px flex-1 max-w-20 bg-gradient-to-l from-transparent via-violet-400/30 to-violet-400/60 rounded-full" />
284+
</div>
288285

289286
<section id="influences" className="w-full mt-20 scroll-mt-24">
290287
<ConjunctionPlot defaultStart={influenceRange.start} defaultEnd={influenceRange.end} />

components/chart/ConjunctionPlot.tsx

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,19 @@ const MIN_PLOT_HEIGHT = 280;
1616
/** Min horizontal pixels per x-axis date label so they never overlap */
1717
const MIN_PX_PER_X_LABEL = 72;
1818

19+
const PAIR_COLORS = [
20+
'#a78bfa', // violet
21+
'#f472b6', // pink
22+
'#34d399', // emerald
23+
'#fbbf24', // amber
24+
'#60a5fa', // blue
25+
'#f97316', // orange
26+
'#22d3ee', // cyan
27+
'#c084fc', // purple
28+
'#4ade80', // green
29+
'#fb923c', // orange-2
30+
];
31+
1932
function pairKey(p1: string, p2: string): string {
2033
return [p1, p2].sort().join('–');
2134
}
@@ -192,14 +205,12 @@ export function ConjunctionPlot({ defaultStart, defaultEnd, hideDateControls = f
192205

193206
const ORB_DEG = 10;
194207

195-
const { pairs, pairIndex, seriesByPair } = useMemo(() => {
208+
const { pairs, seriesByPair } = useMemo(() => {
196209
const set = new Set<string>();
197210
for (const e of events) {
198211
set.add(pairKey(e.planet1, e.planet2));
199212
}
200213
const pairs = Array.from(set).sort();
201-
const pairIndex = new Map<string, number>();
202-
pairs.forEach((p, i) => pairIndex.set(p, i));
203214
const seriesByPair = new Map<string, { date: Date; separationDeg: number }[]>();
204215
for (const e of events) {
205216
const key = pairKey(e.planet1, e.planet2);
@@ -209,7 +220,7 @@ export function ConjunctionPlot({ defaultStart, defaultEnd, hideDateControls = f
209220
for (const arr of seriesByPair.values()) {
210221
arr.sort((a, b) => a.date.getTime() - b.date.getTime());
211222
}
212-
return { pairs, pairIndex, seriesByPair };
223+
return { pairs, seriesByPair };
213224
}, [events]);
214225

215226
// Add an interpolated point at exact conjunction (sep=0) so the curve peaks at the right time
@@ -425,21 +436,9 @@ export function ConjunctionPlot({ defaultStart, defaultEnd, hideDateControls = f
425436
}
426437
while (out.length > maxTicks) out.pop();
427438
return { xTicks: out };
428-
}, [startDate, endDate, innerWidth]);
439+
}, [startDate, endDate, innerWidth, marginLeft]);
429440

430441
const clipId = useId();
431-
const PAIR_COLORS = [
432-
'#a78bfa', // violet
433-
'#f472b6', // pink
434-
'#34d399', // emerald
435-
'#fbbf24', // amber
436-
'#60a5fa', // blue
437-
'#f97316', // orange
438-
'#22d3ee', // cyan
439-
'#c084fc', // purple
440-
'#4ade80', // green
441-
'#fb923c', // orange-2
442-
];
443442

444443
function smoothPathThrough(points: { x: number; y: number }[]): string {
445444
if (points.length === 0) return '';
@@ -572,9 +571,9 @@ export function ConjunctionPlot({ defaultStart, defaultEnd, hideDateControls = f
572571
<div className="flex flex-wrap items-center justify-center gap-1.5 md:gap-2 font-bold">
573572
<span className="text-sm font-bold text-violet-400 mr-1 uppercase tracking-wide">From</span>
574573
<div className="flex items-center gap-1.5">
575-
<Button variant="ghost" className="!py-2 !px-3 text-xl leading-none font-bold" onClick={() => adjustStart('day', -1)} title={copy.today.prevDay} aria-label={copy.today.prevDay}><span className="text-foreground"></span><span className="text-sm text-muted-foreground ml-0.5">day</span></Button>
576-
<Button variant="ghost" className="!py-2 !px-3 text-xl leading-none font-bold" onClick={() => adjustStart('month', -1)} title={copy.today.prevMonth} aria-label={copy.today.prevMonth}><span className="text-foreground"></span><span className="text-sm text-muted-foreground ml-0.5">month</span></Button>
577574
<Button variant="ghost" className="!py-2 !px-3 text-xl leading-none font-bold" onClick={() => adjustStart('year', -1)} title={copy.today.prevYear} aria-label={copy.today.prevYear}><span className="text-foreground"></span><span className="text-sm text-muted-foreground ml-0.5">year</span></Button>
575+
<Button variant="ghost" className="!py-2 !px-3 text-xl leading-none font-bold" onClick={() => adjustStart('month', -1)} title={copy.today.prevMonth} aria-label={copy.today.prevMonth}><span className="text-foreground"></span><span className="text-sm text-muted-foreground ml-0.5">month</span></Button>
576+
<Button variant="ghost" className="!py-2 !px-3 text-xl leading-none font-bold" onClick={() => adjustStart('day', -1)} title={copy.today.prevDay} aria-label={copy.today.prevDay}><span className="text-foreground"></span><span className="text-sm text-muted-foreground ml-0.5">day</span></Button>
578577
</div>
579578
<span className="min-w-[140px] text-lg text-foreground font-bold tabular-nums text-center">
580579
{formatChartDate(startDate)}
@@ -591,9 +590,9 @@ export function ConjunctionPlot({ defaultStart, defaultEnd, hideDateControls = f
591590
<div className="flex flex-wrap items-center justify-center gap-1.5 md:gap-2 font-bold">
592591
<span className="text-sm font-bold text-violet-400 mr-1 uppercase tracking-wide">To</span>
593592
<div className="flex items-center gap-1.5">
594-
<Button variant="ghost" className="!py-2 !px-3 text-xl leading-none font-bold" onClick={() => adjustEnd('day', -1)} title={copy.today.prevDay} aria-label={copy.today.prevDay} disabled={arrowDisabled.toDayBack}><span className="text-foreground"></span><span className="text-sm text-muted-foreground ml-0.5">day</span></Button>
595-
<Button variant="ghost" className="!py-2 !px-3 text-xl leading-none font-bold" onClick={() => adjustEnd('month', -1)} title={copy.today.prevMonth} aria-label={copy.today.prevMonth} disabled={arrowDisabled.toMonthBack}><span className="text-foreground"></span><span className="text-sm text-muted-foreground ml-0.5">month</span></Button>
596593
<Button variant="ghost" className="!py-2 !px-3 text-xl leading-none font-bold" onClick={() => adjustEnd('year', -1)} title={copy.today.prevYear} aria-label={copy.today.prevYear} disabled={arrowDisabled.toYearBack}><span className="text-foreground"></span><span className="text-sm text-muted-foreground ml-0.5">year</span></Button>
594+
<Button variant="ghost" className="!py-2 !px-3 text-xl leading-none font-bold" onClick={() => adjustEnd('month', -1)} title={copy.today.prevMonth} aria-label={copy.today.prevMonth} disabled={arrowDisabled.toMonthBack}><span className="text-foreground"></span><span className="text-sm text-muted-foreground ml-0.5">month</span></Button>
595+
<Button variant="ghost" className="!py-2 !px-3 text-xl leading-none font-bold" onClick={() => adjustEnd('day', -1)} title={copy.today.prevDay} aria-label={copy.today.prevDay} disabled={arrowDisabled.toDayBack}><span className="text-foreground"></span><span className="text-sm text-muted-foreground ml-0.5">day</span></Button>
597596
</div>
598597
<span className="min-w-[140px] text-lg text-foreground font-bold tabular-nums text-center">
599598
{formatChartDate(endDate)}

lib/copy.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export const copy = {
2525

2626
influence: {
2727
title: 'influences',
28-
arrowLabel: 'major planetary influences this week',
2928
subtitle: 'planetary conjunctions this month — when two planets are within 10°.',
3029
viewBands: 'bands',
3130
viewLines: 'gaussian',

0 commit comments

Comments
 (0)