Compare commits
4
Commits
66a73a4756
...
43e1925d70
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43e1925d70 | ||
|
|
9a82cfbedc | ||
|
|
1324898a71 | ||
|
|
b91212b9e1 |
No files matched your search
@@ -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` |
|
||||
|
||||
@@ -96,6 +96,11 @@
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 앱이 뜨기 전 첫 화면: 정적 소개 글이 잠깐 보이지 않게 덮는다. 앱이 뜨면 지운다 -->
|
||||
<div id="boot" role="status" style="position:fixed;inset:0;z-index:60;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:#d6ebff;color:#28304a;font:19px Jua,sans-serif">
|
||||
<img src="/icons/rabbit.png" alt="" width="88" height="88" />
|
||||
<p style="margin:0">날씨 불러오는 중…</p>
|
||||
</div>
|
||||
<div id="root">
|
||||
<main>
|
||||
<h1>날씨각</h1>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
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 { kindOfHour, kst, seasonOf, type TimeKind } from './lib'
|
||||
import './b.css'
|
||||
import { AuthProvider } from './auth'
|
||||
import { RegionProvider } from './region'
|
||||
@@ -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,22 @@ const TABS = [
|
||||
{ to: '/season', key: 'season', label: '계절·상식', title: '계절·상식' },
|
||||
] as const
|
||||
|
||||
/** 로고 옆 계절 칩: 계절 이름과 지금 절기. 누르면 이번 주 절기 창. 좁은 화면에선 절기를 뺀다 */
|
||||
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 +49,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 +170,38 @@ 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)
|
||||
// 앱이 떴으니 index.html 의 첫 화면은 걷는다 (이 덮개가 이어받는다)
|
||||
useEffect(() => document.getElementById('boot')?.remove(), [])
|
||||
// 느린 망에서도 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 backdrop-blur-[6px] transition-opacity duration-400', done && 'pointer-events-none opacity-0')}
|
||||
style={{ backgroundColor: `color-mix(in srgb, ${NOTCH_BG[kind]} 72%, transparent)` }}
|
||||
>
|
||||
<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 +215,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" />
|
||||
|
||||
@@ -112,8 +112,14 @@ function Hero({ hero, today, ranked, feedLoad, todayLoad }: HeroProps) {
|
||||
useEffect(() => setServerKind(hero?.sky_mode ?? null), [hero?.sky_mode, setServerKind])
|
||||
const slots = today?.slots ?? []
|
||||
// 그 시각 칸, 비어 있으면(지난 새벽 칸 등) 그 뒤 첫 예보 칸
|
||||
// 지금은 가장 가까운 3시간 칸(17시면 18시 칸). 시간대는 그 시각 칸, 비어 있으면(지난 새벽 칸 등) 그 뒤 첫 예보 칸
|
||||
const slotOf = (k: TimeKind | 'now') => {
|
||||
const h = k === 'now' ? t.h : PREVIEW[k].hour
|
||||
if (k === 'now') {
|
||||
const known = slots.filter((x) => x.temp_c != null)
|
||||
const at = t.h + t.mi / 60
|
||||
return known.length ? known.reduce((a, b) => (Math.abs(kst(b.at).h - at) < Math.abs(kst(a.at).h - at) ? b : a)) : undefined
|
||||
}
|
||||
const h = PREVIEW[k].hour
|
||||
const s = slots.length ? slotAt(slots, h) : undefined
|
||||
return s?.temp_c != null ? s : (slots.find((x) => kst(x.at).h > h && x.temp_c != null) ?? s)
|
||||
}
|
||||
@@ -191,9 +197,9 @@ function Hero({ hero, today, ranked, feedLoad, todayLoad }: HeroProps) {
|
||||
</div>
|
||||
<div className="b-strip relative z-[3] mt-2.5 grid grid-cols-4 gap-1 rounded-[18px] p-[3px]" role="tablist" aria-label="하루 흐름, 누르면 그 시간대 하늘로">
|
||||
{KINDS.map((k) => {
|
||||
const s = slotOf(k)
|
||||
const on = k === kind
|
||||
const isNow = k === nowKind
|
||||
const s = slotOf(isNow ? 'now' : k)
|
||||
const on = k === kind
|
||||
return (
|
||||
<button key={k} type="button" role="tab" aria-selected={on} onClick={() => setPreview(isNow ? null : k)} className={cx('flex cursor-pointer flex-col items-center rounded-[14px] py-1.5', on && 'b-strip-on')}>
|
||||
<span className={cx('text-[13px] font-bold', on ? 'text-(--orange-deep)' : 'opacity-75')}>{isNow ? '지금' : PREVIEW[k].label}</span>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -43,6 +43,10 @@ export const fall = (d: string, f = '4.8s', amp?: string) => ({ '--d': d, '--f':
|
||||
|
||||
export const WEEKDAYS = ['일', '월', '화', '수', '목', '금', '토'] as const
|
||||
|
||||
// 달(1~12) → 계절 이름과 아이콘. 봄 3–5 · 여름 6–8 · 가을 9–11 · 겨울 12–2 (서버 각 제철 기준과 같다)
|
||||
const SEASONS: [string, string][] = [['겨울', 'snow'], ['봄', 'garden'], ['여름', 'sun'], ['가을', 'maple']]
|
||||
export const seasonOf = (month: number) => SEASONS[Math.floor((month % 12) / 3)]
|
||||
|
||||
const KST = new Intl.DateTimeFormat('en-US', { timeZone: 'Asia/Seoul', year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', hourCycle: 'h23', weekday: 'short' })
|
||||
const WD_EN = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
|
||||
|
||||
|
||||
Reference in new issue
Block a user