feat: 사주 금전·일은 이번 주에 정할 날로, 올해 운에 잘 맞는 달, 레벨업 창에서 열린 칸으로 바로 가기

- 금전·일: 오늘 카드를 되풀이하지 않고 이번 주 중 결제·계약할 날, 돈 빌려주기 피할 날, 보고·면접 잡을 날
- 올해 운: 잘 맞는 달 3개, 11월부터는 다음 해 미리 보기
- 레벨업 창 '…보러 가기' → /saju#칸, 내 레벨 창의 각 모으는 일 줄을 누르면 그 화면으로
- 궁합 결과에 상대 생일과 다른 사람 보기
This commit is contained in:
minaChoi committed 2026-10-28 16:06:01 +09:00
1 parent e4834fd24e
commit cb013fcc9a
7 files changed
+121 -28

No files matched your search

+27 -12
View File
@@ -136,6 +136,11 @@ function Reading({ birth, onEdit }: { birth: Birth; onEdit: () => void }) {
const { open } = useSheet()
const r = q.data
useEffect(() => {
if (!r?.today || !window.location.hash) return
document.getElementById(window.location.hash.slice(1))?.scrollIntoView({ behavior: 'smooth', block: 'start' })
}, [r])
useEffect(() => {
if (!r?.today) return
markSeen()
@@ -186,15 +191,18 @@ function Reading({ birth, onEdit }: { birth: Birth; onEdit: () => void }) {
{r.week && <Week r={r} />}
{r.money && (
<Panel icon="money_bag" title="금전운 · 일운">
<p className="m-0 text-[14px] font-semibold">💰 {r.money}</p>
<p className="m-0 mt-1.5 text-[14px] font-semibold">💼 {r.work}</p>
<Panel id="saju_money" icon="money_bag" title="금전운 · 일운">
{[...r.money.map((l) => ['💰', l]), ...(r.work ?? []).map((l) => ['💼', l])].map(([icon, l]) => (
<p key={l} className="m-0 mt-1 text-[14px] font-semibold first:mt-0">
{icon} {l}
</p>
))}
</Panel>
)}
{r.love && <Love r={r} birth={birth} />}
{lock('saju_match')?.unlocked && <Match birth={birth} />}
{r.month && <Period icon="spiral_calendar" p={r.month} />}
{r.year && <Period icon="sunrise" p={r.year} />}
{r.month && <Period id="saju_month" icon="spiral_calendar" p={r.month} />}
{r.year && <Period id="saju_year" icon="sunrise" p={r.year} />}
<Locked locks={(r.locks ?? []).filter((l) => !l.unlocked)} />
<div className="mx-4 flex items-center justify-between">
@@ -264,9 +272,9 @@ function Char({ c, ko, el }: { c: string; ko: string; el: string }) {
)
}
function Panel({ icon, title, right, children }: { icon: string; title: string; right?: ReactNode; children: ReactNode }) {
function Panel({ id, icon, title, right, children }: { id?: string; icon: string; title: string; right?: ReactNode; children: ReactNode }) {
return (
<section className="mx-4 rounded-[22px] bg-white px-4 py-3.5 shadow-[inset_0_-4px_0_var(--shade)]">
<section id={id} className="mx-4 scroll-mt-20 rounded-[22px] bg-white px-4 py-3.5 shadow-[inset_0_-4px_0_var(--shade)]">
<div className="mb-2 flex items-center gap-2">
<Ic name={icon} className="size-7" />
<h3 className="m-0 font-jua text-[17px] font-normal">{title}</h3>
@@ -317,7 +325,7 @@ function Locked({ locks }: { locks: SajuLock[] }) {
function Week({ r }: { r: ResSaju }) {
return (
<Panel icon="spiral_calendar" title="이번 주 흐름">
<Panel id="saju_week" icon="spiral_calendar" title="이번 주 흐름">
<ol className="m-0 flex list-none flex-col gap-1 p-0">
{r.week!.map((d) => (
<li key={d.day} className={cx('flex items-center gap-2 rounded-xl px-2 py-1.5 text-[13px] font-bold', d.best && 'bg-[#fff6ef]')}>
@@ -340,7 +348,7 @@ function Love({ r, birth }: { r: ResSaju; birth: Birth }) {
const love = r.love!
const pick = (g: 'M' | 'F' | null) => setBirth({ ...birth, gender: g })
return (
<Panel icon="red_heart" title="이번 주 연애운">
<Panel id="saju_love" icon="red_heart" title="이번 주 연애운">
{love.good ? (
<div className="rounded-xl bg-[#fff0f3] px-3 py-2.5">
<p className="m-0 text-xs font-extrabold text-[#d6457a]">연애 기운 좋은 날</p>
@@ -373,13 +381,14 @@ function Love({ r, birth }: { r: ResSaju; birth: Birth }) {
)
}
function Period({ icon, p }: { icon: string; p: NonNullable<ResSaju['month']> }) {
function Period({ id, icon, p }: { id: string; icon: string; p: NonNullable<ResSaju['month']> }) {
return (
<Panel icon={icon} title={p.label}>
<Panel id={id} icon={icon} title={p.label}>
<p className="m-0 font-jua text-[17px]">
{p.title} <span className="text-[13px] text-(--ink3)">({p.pillar} · {p.ten_god})</span>
</p>
<p className="m-0 mt-0.5 text-[13.5px] font-semibold">{p.body}</p>
{(p.months?.length ?? 0) > 0 && <p className="m-0 mt-1.5 text-[13.5px] font-bold">잘 맞는 달: {p.months!.map((m) => `${m}월`).join(' · ')}</p>}
{(p.notes?.length ?? 0) > 0 && <p className="m-0 mt-1 text-xs font-semibold text-(--ink3)">{p.notes!.join(' · ')}</p>}
</Panel>
)
@@ -401,9 +410,15 @@ function Match({ birth }: { birth: Birth }) {
run.mutate({ body: { region_code: region.code, me: toBody(birth), friend: { birth_date: `${yy}-${String(mm).padStart(2, '0')}-${String(dd).padStart(2, '0')}`, longitude: 126.98 } } })
}
return (
<Panel icon="two_hearts" title="궁합">
<Panel id="saju_match" icon="two_hearts" title="궁합">
{res ? (
<>
<p className="m-0 mb-1 flex items-center justify-between text-xs font-bold text-(--ink3)">
상대 {y}.{m}.{d}생
<button type="button" onClick={() => run.reset()} className="cursor-pointer font-extrabold text-(--orange)">
다른 사람 보기
</button>
</p>
<p className="m-0 font-jua text-[19px]">
{res.title} <span className="font-bagel text-[17px] text-(--orange)">{res.score}</span>
</p>