fix: 히어로를 이전 디자인으로 되돌림, 밤 테마 시트 색, 열흘 날씨 줄 끌어 넘기기, 글자 선택 막기
This commit is contained in:
1 parent
6cc0a4d7b6
commit
b61ed92c54
6 files changed
+180
-99
No files matched your search
@@ -76,7 +76,9 @@
|
||||
| [ ] | 행사 수집이 사용자 한 명당 주변 시도 2~4곳으로 늘어 TourAPI·문화정보 API 호출이 시도 수만큼 늘어남(시도별 하루 1회 캐시) — 운영 배포 때 일일 호출 한도 확인 | 행사 거리 기준 작업 중 발견 | `backend/services/week_service.py` (`_ensure_events`), `backend/docs/load-estimate.md` |
|
||||
| [ ] | 다른 문서의 포스트 종류 목록·행사 시도 기준 설명 갱신 (`PostType` 12 미세먼지, 30km 행사) — `docs/포스트타입별_내용.html`만 고침 | 문서 점검 | `backend/docs/`, `docs/화면별_데이터출처.html`, `docs/데이터흐름.html`, `docs/콘텐츠설계서.md` |
|
||||
| [ ] | **[결정 필요]** 스켈레톤 작업에서 바뀐 디자인 — 댓글 없음 안내가 글자 두 줄 → 상자(스켈레톤 3줄 크기) | 스켈레톤 작업 중 발견 | `frontend/src/b/Sheets.tsx` (`CommentsSheet`) |
|
||||
| [ ] | **[결정 필요]** 히어로 다듬기에서 정한 것 — ① 큰 시계 → 날짜 줄 작은 시각, 기온이 가장 큰 글자 ② 구름·별·별똥별·토끼/곰·1위 아이콘 뺌, 점수 해(밤엔 달)만 남김 ③ 1위 각은 '오늘의 각 · 오늘은 ○○각! · 근거 보기' 한 줄(아이콘·점수는 아래 '오늘의 각' 줄에만) ④ 불쾌지수는 6~9월에만, 그 밖엔 '오늘 최저·최고'(3시간 칸 기준) ⑤ 비 문구 '비 안 와요'/'비, 우산 챙겨요' ⑥ 실패 시 문구 없이 '?'만(안내는 바로 아래 각 줄 상자 한 곳) ⑦ 저녁 히어로 배경을 깊은 보라로(흰 글자 AA) | 히어로 다듬기 | `frontend/src/b/TodayPage.tsx`, `frontend/src/b/b.css` |
|
||||
| [ ] | **[결정 필요]** 히어로 시안 A/B/C 중 선택 — 지금은 이전 히어로로 롤백 | 히어로 다듬기 | `frontend/src/b/TodayPage.tsx`, `frontend/src/b/b.css` |
|
||||
| [ ] | 댓글 좋아요 실패 시 알림 없음 (화면은 되돌아감) | 댓글 대기 표시 작업 중 발견 | `frontend/src/b/Sheets.tsx` (`CommentRow`) |
|
||||
| [ ] | **[결정 필요]** 노을 탭 재정리에서 정한 것 — ① 노을 등급 '흐림' → '잿빛'(피드 노을 포스트 문구도 같이 바뀜) ② 히어로에 '가장 붉을 때' 시각 하나는 결론('몇 시에')으로 남기고 나머지 시각은 시간표 한 곳에만 ③ '나가 볼 만해요/애매해요/쉬어요' 기준 60·40점, 내일·모레는 10점 넘게 높을 때만 '더 나아요' ④ '쉬어요'면 명소 추천 안 함 ⑤ 블루아워 시각은 시민박명 끝(-6°), 골든아워는 해 고도 6° | 노을 탭 재정리 | `backend/services/calc/sky_score.py`, `backend/services/sky_service.py`, `frontend/src/b/SkyPage.tsx` |
|
||||
| [ ] | 노을 히어로 맨 윗줄("오늘 노을 · 구")이 보라 배경 위 흰 13px라 대비 약 3.9:1 (AA 4.5 미달) — 결론·근거·시각·점수는 어두운 상자 안으로 옮김 | 노을 탭 재정리 중 발견 | `frontend/src/b/SkyPage.tsx` |
|
||||
| [ ] | 오늘 화면 불러오기 실패 → 다시 불러온 뒤 글 목록 첫 블록이 14px 내려감 (y881→895) | 히어로 롤백 측정 중 발견 | `frontend/src/b/TodayPage.tsx` |
|
||||
| [ ] | 낮 히어로 해 안 흰 글씨 "오늘 날씨 점수"가 주황 위라 대비 부족 | 히어로 롤백 중 발견 | `frontend/src/b/b.css` |
|
||||
@@ -51,6 +51,7 @@ const TITLES = { article: '읽을거리', seasonWeek: '이번 주 특집', share
|
||||
/** 아래에서 올라오는 창: 네이티브 <dialog>라 ESC·포커스 가두기·포커스 되돌리기가 기본으로 된다 */
|
||||
function SheetHost({ state, onClose }: { state: SheetState; onClose: () => void }) {
|
||||
const ref = useRef<HTMLDialogElement>(null)
|
||||
const { kind } = useSky()
|
||||
const [gakTitle, setGakTitle] = useState('')
|
||||
const [articleTitle, setArticleTitle] = useState('')
|
||||
|
||||
@@ -79,6 +80,7 @@ function SheetHost({ state, onClose }: { state: SheetState; onClose: () => void
|
||||
<dialog
|
||||
ref={ref}
|
||||
aria-label={title}
|
||||
data-t={kind}
|
||||
onClose={onClose}
|
||||
onClick={(e) => {
|
||||
if (e.target === e.currentTarget) onClose()
|
||||
@@ -88,7 +90,7 @@ function SheetHost({ state, onClose }: { state: SheetState; onClose: () => void
|
||||
{state && (
|
||||
<div className="b-sheet flex max-h-[86dvh] flex-col rounded-t-[22px] bg-white">
|
||||
<div className="relative border-b border-(--line) px-4 pt-2 pb-2.5 text-center">
|
||||
<div className="mx-auto mb-2.5 h-1 w-10 rounded-full bg-[#d5dce7]" aria-hidden="true" />
|
||||
<div className="mx-auto mb-2.5 h-1 w-10 rounded-full bg-(--line)" aria-hidden="true" />
|
||||
<h3 className="m-0 text-[15px] font-extrabold">{title}</h3>
|
||||
<button type="button" onClick={onClose} aria-label="닫기" className="absolute right-3 bottom-2 grid size-[30px] cursor-pointer place-items-center text-xl text-(--ink2)">
|
||||
×
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useQuery } from '@tanstack/react-query'
|
||||
import { getFeedOptions, getWeatherTodayOptions } from '../api/client/@tanstack/react-query.gen'
|
||||
import type { BandArticle, BandEvent, Hero as HeroData, ResWeatherToday, TopIndex } from '../api/client/types.gen'
|
||||
import { cx } from '../lib/utils'
|
||||
import { cardBg, kindOfHour, kst, type Load, loadOf, MEDALS, type TimeKind, WEEKDAYS } from './lib'
|
||||
import { cardBg, fall, kindOfHour, kst, type Load, loadOf, MEDALS, type TimeKind, WEEKDAYS } from './lib'
|
||||
import { PostCard, PostCardSkel } from './Post'
|
||||
import { useRegion } from './regionContext'
|
||||
import { useSheet } from './sheetContext'
|
||||
@@ -15,7 +15,7 @@ import { deg, skyText, slotAt } from './weatherText'
|
||||
type Mode = 'now' | TimeKind
|
||||
|
||||
const MODES: [Mode, string][] = [
|
||||
['now', '지금'],
|
||||
['now', '지금 시간'],
|
||||
['morning', '아침'],
|
||||
['day', '낮'],
|
||||
['sunset', '저녁'],
|
||||
@@ -30,8 +30,14 @@ const PREVIEW: Record<TimeKind, { label: string; clock: string; hour: number }>
|
||||
night: { label: '밤', clock: '22:10', hour: 22 },
|
||||
}
|
||||
|
||||
// 불쾌지수는 6~9월에만 뜻이 있고, 그 밖엔 늘 '쾌적'이라 하루 최저·최고(일교차)를 보여 준다
|
||||
const isMuggySeason = (month: number) => month >= 6 && month <= 9
|
||||
const STARS = Array.from({ length: 26 }, (_, i) => ({ left: `${(i * 37) % 100}%`, top: `${(i * 53) % 60}%`, opacity: 0.4 + ((i * 7) % 6) / 10 }))
|
||||
// 별똥별 셋: 위치·길이·주기를 엇갈려 하나씩 떨어지게
|
||||
const SHOOTS = [
|
||||
{ top: '6%', left: '80%', '--len': '90px', '--dur': '7s', '--dl': '1.5s' },
|
||||
{ top: '20%', left: '52%', '--len': '70px', '--dur': '9s', '--dl': '4s' },
|
||||
{ top: '34%', left: '94%', '--len': '80px', '--dur': '11s', '--dl': '6.5s' },
|
||||
]
|
||||
const ORB_POS = { left: '66%', top: '6px', d: '.5s', f: '4.4s' }
|
||||
|
||||
function useNow(ms = 20000) {
|
||||
const [now, setNow] = useState(() => new Date())
|
||||
@@ -60,6 +66,8 @@ function heroVal(load: Load, v: ReactNode, skel: string) {
|
||||
)
|
||||
}
|
||||
|
||||
const failed = (load: Load) => load === 'error' || load === 'retrying'
|
||||
|
||||
type HeroProps = { hero?: HeroData | null; today?: ResWeatherToday; feedLoad: Load; todayLoad: Load }
|
||||
|
||||
function Hero({ hero, today, feedLoad, todayLoad }: HeroProps) {
|
||||
@@ -79,82 +87,102 @@ function Hero({ hero, today, feedLoad, todayLoad }: HeroProps) {
|
||||
const temp = mode === 'now' && hero ? hero.temp_c : slot?.temp_c
|
||||
const feels = mode === 'now' && hero ? hero.feels_c : slot?.feels_c
|
||||
const top1 = hero?.top1
|
||||
const who = kind === 'night' ? 'bear' : 'rabbit'
|
||||
const tempLoad = mode === 'now' ? feedLoad : todayLoad
|
||||
const temps = slots.flatMap((s) => (s.temp_c == null ? [] : [s.temp_c]))
|
||||
const muggy = isMuggySeason(t.mo)
|
||||
const feelsLine = temp != null ? `체감 ${deg(feels)}${slot ? ` · ${skyText(slot)}` : ''}` : tempLoad === 'loading' ? null : '체감 ?°'
|
||||
// 1위 각 이름·점수는 바로 아래 '오늘의 각' 줄에 있으니 히어로는 결론 한 줄만
|
||||
const gakLine = hero?.bubble ?? (hero ? '오늘은 쉬어 가요' : null)
|
||||
const feelsLine = temp != null ? `체감 ${deg(feels)}${slot ? ` · ${skyText(slot)}` : ''}` : failed(tempLoad) ? '날씨를 못 불러왔어요' : tempLoad === 'ready' ? '체감 ?°' : null
|
||||
const bubble = hero ? (hero.bubble ?? '오늘은 쉬어 가요') : failed(feedLoad) ? '앗, 날씨를 못 불러왔어요' : null
|
||||
|
||||
// 글자 크기는 64(기온)·40(점수)·16(값)·13(라벨) 네 단계. 모든 값은 한 줄이라 로딩·완료·실패 높이가 같다
|
||||
// 아래 값은 모두 로딩·완료·실패 사이 높이가 같다: 글자 자리 스켈레톤, 비 칸은 두 줄 높이로 고정
|
||||
return (
|
||||
<div className="b-hero mx-3 mt-1 rounded-[28px] px-4 pt-3.5 pb-4" data-t={kind}>
|
||||
<div className="b-seg flex rounded-full p-[3px]" role="group" aria-label="시간대 배경 미리보기">
|
||||
<div className="b-hero relative mx-3 mt-1 overflow-hidden rounded-[32px] px-[18px] pt-4 pb-[18px]" data-t={kind}>
|
||||
<div className="b-stars pointer-events-none absolute inset-0" aria-hidden="true">
|
||||
{STARS.map((s, i) => (
|
||||
<i key={i} className="absolute size-[3px] rounded-full shadow-[0_0_6px_#fff]" style={s} />
|
||||
))}
|
||||
{SHOOTS.map((s, i) => (
|
||||
<span key={i} className="b-shoot" style={s} />
|
||||
))}
|
||||
</div>
|
||||
<div className="relative z-[3] flex flex-wrap gap-1.5" role="group" aria-label="시간대 배경 미리보기">
|
||||
{MODES.map(([m, l]) => (
|
||||
<button key={m} type="button" aria-pressed={mode === m} onClick={() => setMode(m)} className="flex-1 cursor-pointer rounded-full py-1 text-[13px] font-bold">
|
||||
<button key={m} type="button" aria-pressed={mode === m} onClick={() => setMode(m)} className={cx('cursor-pointer rounded-full px-2.5 py-[5px] text-xs font-bold', mode === m ? 'bg-(--ink) text-white' : 'bg-white/55 text-(--ink)')}>
|
||||
{l}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<div className="mt-4 flex items-center justify-between gap-3 px-1">
|
||||
<div className="min-w-0">
|
||||
<p className="text-[13px] font-bold">
|
||||
{t.mo}월 {t.d}일 {WEEKDAYS[t.wd]}요일 · {mode === 'now' ? `${String(t.h).padStart(2, '0')}:${String(t.mi).padStart(2, '0')}` : `${PREVIEW[mode].label} ${PREVIEW[mode].clock} 예보`}
|
||||
<div className="relative z-[3] mt-3 flex items-end justify-between">
|
||||
<div>
|
||||
<p className="mb-1 text-[13.5px] font-bold opacity-85">
|
||||
{t.mo}월 {t.d}일 {WEEKDAYS[t.wd]}요일 · {mode === 'now' ? '지금' : `${PREVIEW[mode].label} 미리보기`}
|
||||
</p>
|
||||
<b className="block font-bagel text-[64px] leading-[1.1] font-normal">{heroVal(tempLoad, temp != null ? deg(temp) : null, 'w-[112px]')}</b>
|
||||
<p className="truncate font-jua text-base">{feelsLine ?? <Skel className="w-[112px]" />}</p>
|
||||
<div className="font-bagel text-[60px] leading-none">{mode === 'now' ? `${String(t.h).padStart(2, '0')}:${String(t.mi).padStart(2, '0')}` : PREVIEW[mode].clock}</div>
|
||||
</div>
|
||||
<div className="b-sun b-bob grid size-[112px] shrink-0 place-items-center rounded-full text-center">
|
||||
<span>
|
||||
<b className="block font-bagel text-[40px] leading-[1.1] font-normal">{heroVal(feedLoad, hero?.weather_score, 'w-[52px]')}</b>
|
||||
<small className="block text-[13px] font-bold">날씨 점수</small>
|
||||
</span>
|
||||
<div className="text-right">
|
||||
<b className="block font-bagel text-[42px] leading-none font-normal">{heroVal(tempLoad, temp != null ? deg(temp) : null, 'w-[72px]')}</b>
|
||||
<span className="block text-[12.5px] font-bold opacity-85">{feelsLine ?? <Skel className="w-[118px]" />}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="b-stat mt-4 grid grid-cols-2 rounded-[20px]">
|
||||
<HeroStat icon="umbrella" label="앞으로 2시간">
|
||||
{heroVal(feedLoad, hero?.will_rain_2h == null ? null : hero.will_rain_2h ? '비, 우산 챙겨요' : '비 안 와요', 'w-[72px]')}
|
||||
<div className="relative z-[3] mt-3 grid grid-cols-2 gap-2.5">
|
||||
<HeroStat icon="thermo" label="불쾌지수">
|
||||
{heroVal(feedLoad, hero?.discomfort != null ? `${hero.discomfort} · ${hero.discomfort_label ?? ''}` : null, 'w-16')}
|
||||
</HeroStat>
|
||||
<HeroStat icon="thermo" label={muggy ? '불쾌지수' : '오늘 최저·최고'} className="border-l border-current/10">
|
||||
{muggy
|
||||
? heroVal(feedLoad, hero?.discomfort != null ? `${hero.discomfort} · ${hero.discomfort_label ?? ''}` : null, 'w-[72px]')
|
||||
: heroVal(todayLoad, temps.length ? `${deg(Math.min(...temps))} ~ ${deg(Math.max(...temps))}` : null, 'w-[72px]')}
|
||||
<HeroStat icon="umbrella" label="지금 비">
|
||||
{heroVal(feedLoad, hero?.will_rain_2h == null ? null : hero.will_rain_2h ? '2시간 안에 와요' : '2시간 동안 안 와요', 'w-16')}
|
||||
</HeroStat>
|
||||
</div>
|
||||
<div className="relative mt-5 h-[286px]">
|
||||
<span className="b-cloud b-fall top-6 left-[6%] h-[30px] w-[84px]" style={fall('.1s', '6s')} aria-hidden="true" />
|
||||
<div className="b-sun b-fall absolute top-10 left-1/2 -ml-[82px] grid aspect-square w-[164px] place-items-center rounded-full text-center" style={fall('0s', '5.6s', '8px')}>
|
||||
<span>
|
||||
<b className="block font-bagel text-[56px] leading-[0.9] font-normal">{heroVal(feedLoad, hero?.weather_score, 'w-[84px]')}</b>
|
||||
<small className="mt-0.5 block font-jua text-[14.5px]">{failed(feedLoad) ? '점수를 못 불러왔어요' : '오늘 날씨 점수'}</small>
|
||||
</span>
|
||||
</div>
|
||||
<span className="b-cloud b-fall top-[188px] left-[54%] h-10 w-[118px]" style={fall('.25s', '6.4s')} aria-hidden="true" />
|
||||
{top1 ? (
|
||||
<button type="button" onClick={() => open({ type: 'gak', indexId: top1.index_id })} aria-label={`오늘의 1위 ${top1.name} ${top1.score}점, 계산 근거 보기`} className="col-span-2 flex cursor-pointer items-center gap-2 border-t border-current/10 px-3.5 py-2.5 text-left">
|
||||
<HeroGak line={gakLine} load={feedLoad} />
|
||||
<span className="shrink-0 text-[13px] font-bold opacity-75" aria-hidden="true">
|
||||
근거 보기 ›
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => open({ type: 'gak', indexId: top1.index_id })}
|
||||
aria-label={`1위 ${top1.name} ${top1.score}점, 계산 근거 보기`}
|
||||
className="b-fall absolute z-[2] flex w-24 cursor-pointer flex-col items-center"
|
||||
style={{ left: ORB_POS.left, top: ORB_POS.top, ...fall(ORB_POS.d, ORB_POS.f) }}
|
||||
>
|
||||
<span className="relative w-[78px]">
|
||||
<Ic name={top1.icon} className="w-full drop-shadow-[0_10px_12px_rgb(40_48_74/0.16)]" />
|
||||
<Ic name={MEDALS[0]} className="absolute -top-2 -left-3.5 w-[30px]" />
|
||||
</span>
|
||||
<span className="b-orb-label font-jua text-sm whitespace-nowrap">
|
||||
1위 {top1.name} <em className="font-bagel text-(--orange) not-italic">{top1.score}</em>
|
||||
</span>
|
||||
</button>
|
||||
) : (
|
||||
<div className="col-span-2 flex items-center gap-2 border-t border-current/10 px-3.5 py-2.5">
|
||||
<HeroGak line={gakLine} load={feedLoad} />
|
||||
</div>
|
||||
feedLoad === 'loading' && (
|
||||
<span className="absolute z-[2] flex w-24 flex-col items-center gap-1" style={{ left: ORB_POS.left, top: ORB_POS.top }} aria-hidden="true">
|
||||
<Skel shape className="size-[78px] rounded-full" />
|
||||
<span className="font-jua text-sm">
|
||||
<Skel className="w-[72px]" />
|
||||
</span>
|
||||
</span>
|
||||
)
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function HeroStat({ icon, label, className, children }: { icon: string; label: string; className?: string; children: ReactNode }) {
|
||||
return (
|
||||
<div className={cx('flex min-w-0 items-center gap-2.5 px-3.5 py-2.5', className)}>
|
||||
<Ic name={icon} className="w-7 shrink-0" />
|
||||
<div className="min-w-0">
|
||||
<small className="block text-[13px] font-bold opacity-75">{label}</small>
|
||||
<b className="block truncate font-jua text-base font-normal">{children}</b>
|
||||
<div className="relative z-[3] flex items-end gap-2">
|
||||
<Ic name={who} alt={who === 'rabbit' ? '토끼' : '곰'} className="w-[50px] drop-shadow-[0_8px_10px_rgb(40_48_74/0.15)]" />
|
||||
<span className="mb-3 rounded-[20px_20px_20px_6px] bg-white px-3.5 py-[9px] font-jua text-base text-(--ink) shadow-[0_8px_16px_rgb(40_48_74/0.1)]">{bubble ?? <Skel className="w-[120px]" />}</span>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function HeroGak({ line, load }: { line: string | null; load: Load }) {
|
||||
function HeroStat({ icon, label, children }: { icon: string; label: string; children: ReactNode }) {
|
||||
return (
|
||||
<span className="min-w-0 flex-1">
|
||||
<small className="block text-[13px] font-bold opacity-75">오늘의 각</small>
|
||||
<b className="block truncate font-jua text-base font-normal">{heroVal(load, line, 'w-[128px]')}</b>
|
||||
</span>
|
||||
<div className="b-stat flex min-h-[90px] items-center gap-2.5 rounded-[20px] px-3 py-[9px]">
|
||||
<Ic name={icon} className="w-9 shrink-0" />
|
||||
<div className="min-w-0">
|
||||
<small className="block text-xs font-bold opacity-80">{label}</small>
|
||||
<b className="block font-jua text-lg font-normal">{children}</b>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { useState } from 'react'
|
||||
import { useState, type ReactNode } from 'react'
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import { getWeekOptions, getWeekRankingOptions, listEventsOptions, listPlacesOptions } from '../api/client/@tanstack/react-query.gen'
|
||||
import { cx } from '../lib/utils'
|
||||
import { cardBg, dateRange, loadOf, shortDay, sidoOf } from './lib'
|
||||
import { useRegion } from './regionContext'
|
||||
import { useSheet } from './sheetContext'
|
||||
import { Chips, Ic, Rail, Sec, Skel, SkelRail, StateBox, Thumb } from './ui'
|
||||
import { Arrows, Chips, Ic, Rail, Sec, Skel, SkelRail, StateBox, Thumb } from './ui'
|
||||
import { useCarousel } from './carousel'
|
||||
|
||||
const TEN = Array.from({ length: 10 }, (_, i) => i)
|
||||
const THREE = [0, 1, 2]
|
||||
@@ -173,7 +174,7 @@ export function WeekPage() {
|
||||
<section aria-label="주말·행사" aria-busy={weekLoad === 'loading'}>
|
||||
<Sec title="열흘 날씨" sub="날짜를 누르면 그날 추천이 바뀌어요" />
|
||||
{days.length ? (
|
||||
<div className={cx('flex snap-x gap-1 overflow-x-auto px-3 pt-3 transition-opacity [scrollbar-width:none]', week.isPlaceholderData && 'opacity-60')} role="group" aria-label="날짜 고르기">
|
||||
<DayStrip dim={week.isPlaceholderData}>
|
||||
{days.map((d) => {
|
||||
const on = d.day === sel?.day
|
||||
const weekend = d.weekday === '토' || d.weekday === '일' || !!d.holiday
|
||||
@@ -192,7 +193,7 @@ export function WeekPage() {
|
||||
</button>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</DayStrip>
|
||||
) : weekLoad === 'loading' ? (
|
||||
<>
|
||||
<DaysSkel />
|
||||
@@ -334,3 +335,18 @@ export function WeekPage() {
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
const DAY_STRIP = { align: 'start', dragFree: true, containScroll: 'trimSnaps' } as const
|
||||
|
||||
/** 열흘 날짜 줄: 손가락·마우스로 끌어 넘기고, PC 에선 화살표도 */
|
||||
function DayStrip({ children, dim }: { children: ReactNode; dim: boolean }) {
|
||||
const { ref, api, prev, next } = useCarousel(DAY_STRIP)
|
||||
return (
|
||||
<div className="relative" role="group" aria-label="날짜 고르기">
|
||||
<div ref={ref} className="overflow-hidden">
|
||||
<div className={cx('flex gap-1 px-3 pt-3 transition-opacity *:shrink-0', dim && 'opacity-60')}>{children}</div>
|
||||
</div>
|
||||
<Arrows api={api} prev={prev} next={next} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
+64
-39
@@ -142,80 +142,105 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* 히어로 시간대 배경 (글자 대비 AA: 저녁은 위쪽을 깊은 보라로) */
|
||||
/* 히어로 시간대 배경 (저녁은 흰 글자 대비 AA 4.5:1 이상이 되게 깊은 보라로) */
|
||||
.b-hero {
|
||||
transition: background 0.6s;
|
||||
}
|
||||
.b-hero[data-t='morning'] {
|
||||
background: linear-gradient(180deg, #ffd9b8, #ffe9d4 45%, #dff0ff);
|
||||
background: linear-gradient(180deg, #ffd9b8, #ffe9d4 40%, #dff0ff);
|
||||
}
|
||||
.b-hero[data-t='day'] {
|
||||
background: linear-gradient(180deg, #9fd3ff, #cfe9ff 55%, #f1f8ff);
|
||||
}
|
||||
.b-hero[data-t='sunset'] {
|
||||
background: linear-gradient(180deg, #5d4fc4, #8b56b8 50%, #e27a8f);
|
||||
background: linear-gradient(180deg, #4c42b0, #6a48b0 45%, #9a4a88);
|
||||
color: #fff;
|
||||
}
|
||||
.b-hero[data-t='night'] {
|
||||
background: linear-gradient(180deg, #141b3d, #27306a 60%, #3d3f86);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* 시간대 미리보기: 한 줄 트랙, 고른 칸만 흰 알약 */
|
||||
.b-seg {
|
||||
background: rgb(255 255 255 / 0.45);
|
||||
.b-hero .b-stars {
|
||||
opacity: 0;
|
||||
transition: opacity 0.6s;
|
||||
}
|
||||
.b-hero:is([data-t='sunset'], [data-t='night']) .b-seg {
|
||||
background: rgb(0 0 0 / 0.2);
|
||||
.b-hero[data-t='night'] .b-stars {
|
||||
opacity: 1;
|
||||
}
|
||||
.b-seg [aria-pressed='true'] {
|
||||
.b-stars i {
|
||||
background: #fff;
|
||||
color: #28304a;
|
||||
box-shadow: 0 1px 4px rgb(40 48 74 / 0.16);
|
||||
}
|
||||
|
||||
/* 비·기온·오늘의 각 카드: 저녁도 밝은 카드라 진한 글자 */
|
||||
.b-stat {
|
||||
background: rgb(255 255 255 / 0.72);
|
||||
color: #28304a;
|
||||
box-shadow: inset 0 -4px 0 rgb(217 229 244 / 0.9);
|
||||
color: var(--ink);
|
||||
box-shadow: inset 0 -5px 0 rgb(217 229 244 / 0.9);
|
||||
}
|
||||
.b-hero[data-t='night'] .b-stat,
|
||||
.b-hero[data-t='sunset'] .b-stat {
|
||||
background: rgb(255 255 255 / 0.18);
|
||||
color: #fff;
|
||||
box-shadow: inset 0 -5px 0 rgb(255 255 255 / 0.12);
|
||||
}
|
||||
.b-hero[data-t='sunset'] .b-stat {
|
||||
background: rgb(255 255 255 / 0.88);
|
||||
box-shadow: inset 0 -4px 0 rgb(255 255 255 / 0.4);
|
||||
background: rgb(30 16 80 / 0.2);
|
||||
}
|
||||
.b-hero[data-t='night'] .b-stat {
|
||||
background: rgb(255 255 255 / 0.12);
|
||||
color: #fff;
|
||||
box-shadow: inset 0 -4px 0 rgb(255 255 255 / 0.08);
|
||||
.b-orb-label {
|
||||
text-shadow: 0 2px 0 rgb(255 255 255 / 0.7);
|
||||
}
|
||||
.b-hero[data-t='night'] .b-orb-label,
|
||||
.b-hero[data-t='sunset'] .b-orb-label {
|
||||
text-shadow: 0 2px 0 rgb(0 0 0 / 0.2);
|
||||
}
|
||||
|
||||
/* 히어로에서 유일하게 강조하는 장식: 점수를 담은 해(밤엔 달) */
|
||||
.b-sun {
|
||||
background: radial-gradient(circle at 34% 30%, #fff5cf, #ffc86e 34%, #ff9a58 72%, #f07a45);
|
||||
background: radial-gradient(circle at 34% 30%, #fff5cf, #ffc86e 30%, #ff8e4e 68%, #ee6436);
|
||||
box-shadow:
|
||||
inset -12px -16px 28px rgb(170 50 20 / 0.28),
|
||||
inset 10px 12px 20px rgb(255 255 255 / 0.55),
|
||||
0 16px 36px rgb(240 106 58 / 0.3);
|
||||
color: #28304a;
|
||||
inset -18px -24px 40px rgb(170 50 20 / 0.34),
|
||||
inset 16px 18px 28px rgb(255 255 255 / 0.55),
|
||||
0 30px 56px rgb(240 106 58 / 0.32);
|
||||
color: #fff;
|
||||
}
|
||||
.b-hero[data-t='night'] .b-sun {
|
||||
background: radial-gradient(circle at 34% 30%, #fff, #e7e3ff 35%, #b9b0f2 72%, #8f86d9);
|
||||
color: #2b2a5c;
|
||||
box-shadow:
|
||||
inset -12px -16px 28px rgb(60 50 140 / 0.26),
|
||||
inset 10px 12px 20px rgb(255 255 255 / 0.6),
|
||||
0 0 44px rgb(190 180 255 / 0.4);
|
||||
inset -18px -24px 40px rgb(60 50 140 / 0.3),
|
||||
inset 16px 18px 28px rgb(255 255 255 / 0.6),
|
||||
0 0 60px rgb(190 180 255 / 0.45);
|
||||
}
|
||||
.b-bob {
|
||||
--amp: 4px;
|
||||
--tilt: 0deg;
|
||||
animation: b-float 6s ease-in-out infinite;
|
||||
|
||||
.b-cloud {
|
||||
position: absolute;
|
||||
border-radius: 999px;
|
||||
background: #fff;
|
||||
box-shadow:
|
||||
inset 0 -12px 18px rgb(160 190 230 / 0.45),
|
||||
0 16px 28px rgb(40 70 120 / 0.13);
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.b-bob {
|
||||
animation: none;
|
||||
}
|
||||
.b-cloud::before,
|
||||
.b-cloud::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
border-radius: 999px;
|
||||
background: #fff;
|
||||
box-shadow: inset 0 -10px 16px rgb(160 190 230 / 0.35);
|
||||
}
|
||||
.b-cloud::before {
|
||||
left: 16%;
|
||||
top: -58%;
|
||||
width: 46%;
|
||||
aspect-ratio: 1;
|
||||
}
|
||||
.b-cloud::after {
|
||||
left: 50%;
|
||||
top: -36%;
|
||||
width: 36%;
|
||||
aspect-ratio: 1;
|
||||
}
|
||||
.b-hero[data-t='night'] .b-cloud,
|
||||
.b-hero[data-t='night'] .b-cloud::before,
|
||||
.b-hero[data-t='night'] .b-cloud::after {
|
||||
background: #c9cdf0;
|
||||
}
|
||||
|
||||
/* 이야기 고리 */
|
||||
|
||||
@@ -19,6 +19,14 @@
|
||||
}
|
||||
body {
|
||||
@apply bg-page font-sans text-ink antialiased;
|
||||
/* 앱처럼: 끌어도 글자가 선택되지 않게. 입력칸은 아래에서 다시 허용 */
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-webkit-touch-callout: none;
|
||||
}
|
||||
:is(input, textarea, [contenteditable='true']) {
|
||||
user-select: text;
|
||||
-webkit-user-select: text;
|
||||
}
|
||||
:focus-visible {
|
||||
outline: 3px solid var(--color-rain);
|
||||
|
||||
Reference in new issue
Block a user