feat: 각 탭·스토리·각 상세에 지금 구간 점수와 아침·낮·저녁·밤 칸, 히어로 '지금 날씨 점수'

This commit is contained in:
minaChoi committed 2026-10-08 17:09:12 +09:00
1 parent d6525f592c
commit 5a5f585bda
10 files changed
+152 -26

No files matched your search

+7 -3
View File
@@ -124,12 +124,16 @@ export function GakPage() {
<div className={cx('grid grid-cols-3 gap-2 p-3 transition-opacity', q.isPlaceholderData && 'opacity-60')}>
{items.map((g) => {
return (
<button key={g.index_id} type="button" onClick={() => open({ type: 'gak', indexId: g.index_id })} aria-label={`${g.rank}위 ${g.name} ${g.score}점`} className="relative flex cursor-pointer flex-col items-center rounded-[22px] bg-white px-1.5 pt-3 pb-2.5 shadow-[inset_0_-5px_0_var(--shade)]">
<span className="absolute top-[7px] left-[9px] font-jua text-[13px] text-(--ink3)">{g.rank}</span>
<button key={g.index_id} type="button" onClick={() => open({ type: 'gak', indexId: g.index_id })} aria-label={g.active ? `${g.rank}위 ${g.name} ${g.score}점` : `${g.name}, 지금 시간대 아님`} className={cx('relative flex cursor-pointer flex-col items-center rounded-[22px] bg-white px-1.5 pt-3 pb-2.5 shadow-[inset_0_-5px_0_var(--shade)]', !g.active && 'opacity-55')}>
{g.active && <span className="absolute top-[7px] left-[9px] font-jua text-[13px] text-(--ink3)">{g.rank}</span>}
{g.is_core && <span className="absolute top-2 right-2 text-[10.5px] font-extrabold text-[#1f9d62]">가을</span>}
<Ic name={g.icon} className="w-[50px]" />
<b className="mt-1 font-jua text-[15px] font-normal">{g.name}</b>
<em className={cx('font-bagel text-[22px] leading-[1.1] not-italic', g.score < 50 ? 'text-(--ink3)' : 'text-(--orange)')}>{g.score}</em>
{g.active ? (
<em className={cx('font-bagel text-[22px] leading-[1.1] not-italic', g.score < 50 ? 'text-(--ink3)' : 'text-(--orange)')}>{g.score}</em>
) : (
<small className="py-1 text-[12px] leading-[1.1] font-extrabold text-(--ink3)">지금 아님</small>
)}
</button>
)
})}
+21 -1
View File
@@ -157,6 +157,8 @@ function Swap({ labels, at }: { labels: readonly ReactNode[]; at: number }) {
/* ---------- 시트 스켈레톤: 완료 화면과 같은 틀·같은 줄 높이 ---------- */
const N3 = [0, 1, 2]
const N4 = [0, 1, 2, 3]
const SLOT_KEYS = ['morning', 'day', 'evening', 'night'] as const
const SLOT_NAMES = { morning: '아침', day: '낮', evening: '저녁', night: '밤' } as const
const N6 = [0, 1, 2, 3, 4, 5]
const N14 = Array.from({ length: 14 }, (_, i) => i)
@@ -348,8 +350,9 @@ function GakSheet({ indexId, onTitle }: { indexId: number; onTitle: (t: string)
<h4 className="m-0 font-jua text-[22px] font-normal">{g.name}</h4>
{d.description && <p className="mt-0.5 text-[13.5px] font-semibold text-(--ink2)">{d.description}</p>}
</div>
<b className="ml-auto font-bagel text-[42px] font-normal text-(--orange)">{g.score}</b>
<b className={cx('ml-auto font-bagel text-[42px] font-normal', g.active ? 'text-(--orange)' : 'text-(--ink3)')}>{g.score}</b>
</div>
{!g.active && <p className="mt-2 text-[13px] font-bold text-(--ink2)">지금 시간대엔 해당 없어요. 점수는 오늘 가장 좋은 시간대 기준이에요.</p>}
{now && (
<p className="mt-3 rounded-2xl bg-[#fff4ec] px-3.5 py-2.5 text-[14.5px] font-bold">
<b className="mr-1.5 font-jua font-normal text-(--orange)">{now.low}~{now.high}점</b>
@@ -357,6 +360,23 @@ function GakSheet({ indexId, onTitle }: { indexId: number; onTitle: (t: string)
</p>
)}
{factors.length > 2 && <Radar name={g.name} factors={factors} />}
{g.slots && g.slots.length > 0 && (
<div className="mt-2.5 grid grid-cols-4 gap-1.5" aria-label="오늘 시간대별 점수">
{SLOT_KEYS.map((k) => {
const s = g.slots?.find((x) => x.slot === k)
const cur = g.active && g.slot === k
return (
<div key={k} className={cx('rounded-2xl px-1 py-2 text-center', cur ? 'bg-[#fff4ec]' : 'bg-[#f3f6fb]')}>
<small className="block text-xs font-extrabold text-(--ink2)">
{SLOT_NAMES[k]}
{cur && ' · 지금'}
</small>
<b className={cx('block font-bagel text-xl font-normal', s ? 'text-(--orange)' : 'text-(--ink3)')}>{s ? s.score : '–'}</b>
</div>
)
})}
</div>
)}
{g.trend && g.trend.length > 0 && (
<div className="mt-2.5 grid grid-cols-4 gap-1.5">
{g.trend.map((t) => (
+9 -5
View File
@@ -125,7 +125,7 @@ function Hero({ hero, today, feedLoad, todayLoad }: HeroProps) {
</svg>
)}
<span className={cx('relative', moon && '[text-shadow:0_0_6px_#fff,0_0_12px_#fff]')}>
<small className="block font-jua text-[13px]">{failed(feedLoad) ? '점수를 못 불러왔어요' : '오늘 날씨 점수'}</small>
<small className="block font-jua text-[13px]">{failed(feedLoad) ? '점수를 못 불러왔어요' : '지금 날씨 점수'}</small>
<b className="block font-bagel text-[74px] leading-[0.95] font-normal">{heroVal(feedLoad, hero?.weather_score, 'w-[120px]')}</b>
</span>
</div>
@@ -185,15 +185,19 @@ function Stories({ items }: { items: TopIndex[] }) {
return (
<Rail label="오늘의 각 순위">
{items.map((g, i) => (
<button key={g.index_id} type="button" onClick={() => open({ type: 'gak', indexId: g.index_id })} aria-label={`${g.rank}위 ${g.name} ${g.score}점`} className="flex w-[72px] cursor-pointer flex-col items-center gap-1">
<span className={cx('relative size-[68px] rounded-full p-[3px]', g.score < 50 ? 'bg-[#d6deea]' : 'b-ring')}>
<button key={g.index_id} type="button" onClick={() => open({ type: 'gak', indexId: g.index_id })} aria-label={g.active ? `${g.rank}위 ${g.name} ${g.score}점` : `${g.name}, 지금 시간대 아님`} className={cx('flex w-[72px] cursor-pointer flex-col items-center gap-1', !g.active && 'opacity-55')}>
<span className={cx('relative size-[68px] rounded-full p-[3px]', !g.active || g.score < 50 ? 'bg-[#d6deea]' : 'b-ring')}>
<i className="grid size-full place-items-center rounded-full border-[3px] border-(--page) bg-(--page)">
<Ic name={g.icon} className="w-[42px]" />
</i>
{i < 3 && <Ic name={MEDALS[i]} className="absolute -right-1 -bottom-1 w-[25px]" />}
{i < 3 && g.active && <Ic name={MEDALS[i]} className="absolute -right-1 -bottom-1 w-[25px]" />}
</span>
<b className="font-jua text-[13px] font-normal whitespace-nowrap">{g.name}</b>
<em className="font-bagel text-[12.5px] leading-none text-(--orange) not-italic">{g.score}</em>
{g.active ? (
<em className="font-bagel text-[12.5px] leading-none text-(--orange) not-italic">{g.score}</em>
) : (
<small className="text-[11px] leading-none font-extrabold text-(--ink3)">지금 아님</small>
)}
</button>
))}
</Rail>