fix: 노치 영역을 시간대 배경색 띠로 덮고 theme-color를 시간대에 맞춰 갱신

This commit is contained in:
minaChoi committed 2026-10-08 09:17:31 +09:00
1 parent 471353212a
commit d5dc8e0727
3 files changed
+15 -2

No files matched your search

+13
View File
@@ -143,17 +143,30 @@ function SkyProvider({ children }: { children: ReactNode }) {
)
}
// 노치 띠·상태바 색: 하늘 맨 위 색에 .b-topbg 를 겹친 색
const NOTCH_BG: Record<TimeKind, string> = {
morning: '#ffe6cf',
day: '#d6ebff',
sunset: '#ffd8c2',
night: '#0e1433',
}
function Shell() {
const { pathname } = useLocation()
const { kind } = useSky()
useEffect(() => {
window.scrollTo({ top: 0 })
}, [pathname])
useEffect(() => {
document.querySelector('meta[name="theme-color"]')?.setAttribute('content', NOTCH_BG[kind])
}, [kind])
return (
<div className="min-h-dvh text-(--ink)">
<SkyBg />
{/* 위·아래 바: 띠는 화면 끝까지, 내용은 가운데 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" />
<div className="relative mx-auto min-h-dvh max-w-[440px] overflow-x-clip pb-[calc(70px+env(safe-area-inset-bottom,0px))]">
<TopBar />
<main className="relative z-[1]">