feat: 헤더 로고 옆 계절 칩(계절·지금 절기, 누르면 이번 주 절기), 처음 들어올 때 '날씨 불러오는 중…' 화면

This commit is contained in:
minaChoi committed 2026-10-12 16:49:53 +09:00
1 parent 66a73a4756
commit b91212b9e1
3 files changed
+74 -2

No files matched your search

+2
View File
@@ -96,6 +96,8 @@
| [ ] | **[결정 필요]** 스켈레톤 작업에서 바뀐 디자인 — 댓글 없음 안내가 글자 두 줄 → 상자(스켈레톤 3줄 크기) | 스켈레톤 작업 중 발견 | `frontend/src/b/Sheets.tsx` (`CommentsSheet`) |
| [x] | **[결정 필요]** 히어로 시안 A/B/C 중 선택 — 지금은 이전 히어로로 롤백 → 10/12 D4-2로 결정(해 안 점수 + 문장 두 줄은 서버 값 그대로 + 상태 한 줄 + 하루 흐름 칸, 높이는 지금 그대로 약 400px) | 히어로 다듬기 | `frontend/src/b/TodayPage.tsx`, `frontend/src/b/b.css` |
| [x] | **[결정 필요]** 히어로 D4-2 상태 한 줄 — ① 습도는 서버가 %만 줘서 단계 기준을 새로 정해야 함 ② 불쾌지수 '불쾌'처럼 판정 이름을 그대로 쓸지 ③ 미세먼지·자외선은 늘 보일지, 조심할 때만 보일지 → 10/12 결정: 습도 건조(30% 미만)·보통(60% 이하)·습함, 불쾌지수 단계 이름 그대로, 늘 4개(밤엔 자외선 빼기) | 히어로 D4-2 시안 | `backend/services/hero_stats.py`, `backend/services/feed_service.py`, `frontend/src/b/TodayPage.tsx` |
| [ ] | **[결정 필요]** 각 목록 '지금 아님' 문구 — 계절이 아니라 각 시간대(등산 7~12시·피크닉 11~16시)가 지났다는 뜻인데 '가을' 표시 옆에 있어 비활성처럼 읽힘. 그 각의 시간('오전에 좋아요' 등)으로 바꿀지 | 사용자 지적 | `frontend/src/b/GakPage.tsx`, `frontend/src/b/TodayPage.tsx` |
| [ ] | **[결정 필요]** 계절별 각 늘리기 — 지금 '가을' 표시는 `is_core` 4개(피크닉·등산·캠핑·별보기)에 글자로 박혀 있고 계절 전환이 없음. 계절마다 각 후보 목록을 만들어 검토받고, 계절 필드로 바꾸기 | 사용자 요청 | `backend/seed/index_definition.json`, `frontend/src/b/GakPage.tsx` |
| [x] | 댓글 좋아요 실패 시 알림 없음 (연결·서버 오류면 줄에 안내, 지워진 댓글이면 목록 새로고침) (화면은 되돌아감) | 댓글 대기 표시 작업 중 발견 | `frontend/src/b/Sheets.tsx` (`CommentRow`) |
| [x] | **[결정 필요]** 노을 탭 재정리에서 정한 것 — ① 노을 등급 '흐림' → '잿빛'(피드 노을 포스트 문구도 같이 바뀜) ② 히어로에 '가장 붉을 때' 시각 하나는 결론('몇 시에')으로 남기고 나머지 시각은 시간표 한 곳에만 ③ '나가 볼 만해요/애매해요/쉬어요' 기준 60·40점, 내일·모레는 10점 넘게 높을 때만 '더 나아요' ④ '쉬어요'면 명소 추천 안 함 ⑤ 블루아워 시각은 시민박명 끝(-6°), 골든아워는 해 고도 6° → 10/7 노을 탭 다시 기획으로 대체: 점수 대신 하늘 상황 5가지, 결론은 상황 기준 | 노을 탭 재정리 | `backend/services/calc/sky_score.py`, `backend/services/sky_service.py`, `frontend/src/b/SkyPage.tsx` |
| [x] | 노을 히어로 맨 윗줄("오늘 노을 · 구")이 보라 배경 위 흰 13px라 대비 약 3.9:1 (AA 4.5 미달) — 결론·근거·시각·점수는 어두운 상자 안으로 옮김, → 어두운 바탕을 깔아 6.7:1 | 노을 탭 재정리 중 발견 | `frontend/src/b/SkyPage.tsx` |
+56 -2
View File
@@ -1,5 +1,7 @@
import { useCallback, useEffect, useMemo, useState, type ReactNode } from 'react'
import { NavLink, Outlet, useLocation } from 'react-router'
import { useIsFetching, useQuery } from '@tanstack/react-query'
import { getSeasonWeekOptions } from '../api/client/@tanstack/react-query.gen'
import { cx } from '../lib/utils'
import { kindOfHour, kst, type TimeKind } from './lib'
import './b.css'
@@ -11,7 +13,7 @@ import { useSheet } from './sheetContext'
import { SheetProvider } from './Sheets'
import { SkyContext, useSky } from './skyContext'
import { PinIcon, TabIcon } from './svg'
import { Avatar, Skel } from './ui'
import { Avatar, Ic, Skel } from './ui'
const TABS = [
{ to: '/sky', key: 'sky', label: '노을', title: '노을' },
@@ -22,6 +24,26 @@ const TABS = [
{ to: '/season', key: 'season', label: '계절·상식', title: '계절·상식' },
] as const
// 달(1~12) → 계절 이름과 아이콘
const SEASONS: [string, string][] = [['겨울', 'snow'], ['봄', 'garden'], ['여름', 'sun'], ['가을', 'maple']]
const seasonOf = (month: number) => SEASONS[Math.floor((month % 12) / 3)]
/** 로고 옆 계절 칩: 계절 이름과 지금 절기. 누르면 이번 주 절기 창. 좁은 화면에선 절기를 뺀다 */
function SeasonChip() {
const { open } = useSheet()
const week = useQuery(getSeasonWeekOptions())
const [month] = useState(() => kst(new Date()).mo)
const [name, icon] = seasonOf(month)
const term = week.data?.term_now?.name
return (
<button type="button" onClick={() => open({ type: 'seasonWeek' })} aria-label={`지금 ${name}${term ? `, ${term}` : ''}. 이번 주 절기 보기`} className="flex shrink-0 cursor-pointer items-center gap-1 rounded-full bg-white/70 py-1 pr-2.5 pl-1.5 text-[13px] font-extrabold whitespace-nowrap shadow-[0_4px_10px_rgb(40_48_74/0.06)]">
<Ic name={icon} className="size-[18px]" />
{name}
{term && <span className="hidden font-bold opacity-70 min-[400px]:inline">· {term}</span>}
</button>
)
}
function TopBar() {
const { pathname } = useLocation()
const { region, locateStatus } = useRegion()
@@ -31,7 +53,8 @@ function TopBar() {
return (
<header className="sticky top-0 z-20 flex h-[calc(54px+env(safe-area-inset-top,0px))] items-center justify-between gap-2.5 px-4 pt-[env(safe-area-inset-top,0px)]">
{tab?.title ? <h1 className="font-jua text-[22px] font-normal">{tab.title}</h1> : <h1 className="font-jua text-[25px] font-normal text-(--orange)">날씨각</h1>}
{tab?.title ? <h1 className="shrink-0 font-jua text-[22px] font-normal">{tab.title}</h1> : <h1 className="shrink-0 font-jua text-[25px] font-normal text-(--orange)">날씨각</h1>}
<SeasonChip />
<button
type="button"
onClick={() => open({ type: 'region' })}
@@ -151,6 +174,36 @@ const NOTCH_BG: Record<TimeKind, string> = {
night: '#0e1433',
}
/** 처음 들어올 때만: 첫 데이터를 다 받을 때까지 하늘 위에 캐릭터와 '날씨 불러오는 중…'. 한 번 사라지면 다시 안 뜬다 */
function FirstLoad() {
const fetching = useIsFetching()
const { kind } = useSky()
const [started, setStarted] = useState(false)
const [done, setDone] = useState(false)
const [gone, setGone] = useState(false)
// 받기 시작했다가 받는 게 없어지면 끝 (렌더 중에 바로 맞춘다)
if (fetching > 0 && !started) setStarted(true)
if (fetching === 0 && started && !done) setDone(true)
// 느린 망에서도 10초 넘게 막지 않는다 (그 뒤는 화면 안 스켈레톤이 맡는다)
useEffect(() => {
const id = setTimeout(() => setDone(true), 10000)
return () => clearTimeout(id)
}, [])
if (gone) return null
return (
<div
role="status"
aria-live="polite"
onTransitionEnd={() => done && setGone(true)}
className={cx('fixed inset-0 z-50 flex flex-col items-center justify-center gap-3 transition-opacity duration-400', done && 'pointer-events-none opacity-0')}
style={{ backgroundColor: NOTCH_BG[kind] }}
>
<Ic name={kind === 'night' ? 'bear' : 'rabbit'} className="b-hop w-[88px]" />
<p className="m-0 font-jua text-[19px]">날씨 불러오는 중…</p>
</div>
)
}
function Shell() {
const { pathname } = useLocation()
const { kind } = useSky()
@@ -164,6 +217,7 @@ function Shell() {
return (
<div className="min-h-dvh text-(--ink)">
<SkyBg />
<FirstLoad />
{/* 위·아래 바: 띠는 화면 끝까지, 내용은 가운데 440px 안 */}
<div className="b-topbg fixed inset-x-0 top-0 z-[19] h-[calc(54px+env(safe-area-inset-top,0px))] backdrop-blur-md" aria-hidden="true" />
<div className="fixed inset-x-0 top-0 z-[19] h-[env(safe-area-inset-top,0px)] transition-colors duration-1400" style={{ backgroundColor: NOTCH_BG[kind] }} aria-hidden="true" />
+16
View File
@@ -129,7 +129,23 @@
}
}
/* 처음 불러오는 동안 캐릭터가 통통 뛴다 */
.b-hop {
animation: b-hop 0.9s cubic-bezier(0.3, 0, 0.4, 1) infinite;
transform-origin: 50% 100%;
}
@keyframes b-hop {
0%,
100% {
transform: translateY(0) scale(1.06, 0.94);
}
45% {
transform: translateY(-22px) scale(0.97, 1.03);
}
}
@media (prefers-reduced-motion: reduce) {
.b-hop,
.b-fall,
.b-heart-pop,
.b-like-bit,