fix: 노치 영역을 시간대 배경색 띠로 덮고 theme-color를 시간대에 맞춰 갱신
This commit is contained in:
1 parent
471353212a
commit
d5dc8e0727
3 files changed
+15
-2
No files matched your search
+1
-1
@@ -5,7 +5,7 @@
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no, viewport-fit=cover" />
|
||||
<meta name="theme-color" content="#cde7ff" />
|
||||
<meta name="theme-color" content="#d6ebff" />
|
||||
<meta name="description" content="오늘 날씨를 지수로. 노을, 야장각, 주말 계획까지 날씨각에서 확인하세요." />
|
||||
<title>날씨각</title>
|
||||
<meta property="og:type" content="website" />
|
||||
|
||||
@@ -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]">
|
||||
|
||||
Reference in new issue
Block a user