feat: 계절 각 — 각마다 제철 달(months), 제철 각에 지금 계절 표시·철 지난 각은 순위 밖 맨 끝, 새 각 12개(꽃구경·이불빨래·빙수·실내건조·한강밤바람·단풍·억새·군고구마·해돋이·눈사람·붕어빵·귤까먹기), 해 뜰 무렵 시간대·일출 점수·눈 조건

This commit is contained in:
minaChoi committed 2026-10-12 17:20:00 +09:00
1 parent 43e1925d70
commit 5c05824ce0
14 files changed
+1130 -66

No files matched your search

+8 -7
View File
@@ -3,21 +3,22 @@ import { useQuery } from '@tanstack/react-query'
import { listArticlesOptions, listIndicesOptions } from '../api/client/@tanstack/react-query.gen'
import { ArticleCategory, IndexCategory } from '../api/client/types.gen'
import { cx } from '../lib/utils'
import { loadOf, MEDALS } from './lib'
import { kst, loadOf, MEDALS, seasonOf } from './lib'
import { useRegion } from './regionContext'
import { useSheet } from './sheetContext'
import { Chips, Ic, Sec, Skel, StateBox } from './ui'
type Cat = 'all' | 'out' | 'food' | 'home' | 'life' | 'core'
const CATS = [
// 마지막 칩은 지금 계절의 제철 각 (예: 가을 각)
const CATS: readonly (readonly [Cat, string])[] = [
['all', '전체'],
['out', '밖에서 놀기'],
['food', '먹고 마시기'],
['home', '집안일'],
['life', '생활 고민'],
['core', '가을 각'],
] as const
['core', `${seasonOf(kst(new Date()).mo)[0]} 각`],
]
const CAT_PARAM: Partial<Record<Cat, IndexCategory>> = { out: IndexCategory.OUTSIDE, food: IndexCategory.FOOD, home: IndexCategory.HOME, life: IndexCategory.LIFE }
@@ -124,15 +125,15 @@ 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.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')}>
<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}, ${g.in_season === false ? '제철 아님' : '지금 시간대 아님'}`} 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>}
{g.season && <span className="absolute top-2 right-2 text-[10.5px] font-extrabold text-[#1f9d62]">{g.season}</span>}
<Ic name={g.icon} className="w-[50px]" />
<b className="mt-1 font-jua text-[15px] font-normal">{g.name}</b>
{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>
<small className="py-1 text-[12px] leading-[1.1] font-extrabold text-(--ink3)">{g.in_season === false ? '제철 아님' : '지금 아님'}</small>
)}
</button>
)