세션 종료 UX 정리

This commit is contained in:
Yun Chan 2026-06-27 18:09:48 +09:00
parent f472883c31
commit 1007eaf7d9
15 changed files with 460 additions and 245 deletions

27
apps/web/src/lib/theme.ts Normal file
View file

@ -0,0 +1,27 @@
export type AppTheme = "light" | "dark";
export const THEME_KEY = "vignette.theme";
export function readInitialTheme(): AppTheme {
try {
const saved = localStorage.getItem(THEME_KEY);
if (saved === "light" || saved === "dark") return saved;
} catch {
/* localStorage 접근 불가 환경에서는 기본값 사용 */
}
// 이번 시각 검증은 어두운 훈련 화면을 기본 표면으로 삼는다. 사용자가 바꾸면 저장값을 우선한다.
return "dark";
}
export function applyTheme(theme: AppTheme) {
document.documentElement.setAttribute("data-theme", theme);
try {
localStorage.setItem(THEME_KEY, theme);
} catch {
/* 저장 실패는 렌더링을 막지 않는다. */
}
}
export function initTheme() {
applyTheme(readInitialTheme());
}