모바일 메뉴와 주요 화면 UX 개선 및 시각 검수
This commit is contained in:
parent
89b5093ec7
commit
e8b770e4d9
50 changed files with 3189 additions and 457 deletions
|
|
@ -2,7 +2,7 @@ import { useEffect, useLayoutEffect, useRef, type ReactNode } from "react";
|
|||
import { useLocation, useNavigate } from "react-router-dom";
|
||||
import { Topbar } from "./Topbar";
|
||||
import { Sidebar } from "./Sidebar";
|
||||
import { canAccessRole, designRoleOf, useAuth, type Role } from "../../lib/auth";
|
||||
import { canAccessRole, designRoleOf, roleHomePath, useAuth, type Role } from "../../lib/auth";
|
||||
|
||||
export interface AppShellProps {
|
||||
children: ReactNode;
|
||||
|
|
@ -84,14 +84,9 @@ export function AppShell({ children, className, contextLabel, hideNav, bleed, wi
|
|||
useEffect(() => {
|
||||
const handleGlobalKeyDown = (e: KeyboardEvent) => {
|
||||
if (e.repeat) return;
|
||||
const target = e.target instanceof HTMLElement ? e.target : null;
|
||||
const isInput = target?.closest("input, textarea, select, [contenteditable='true']");
|
||||
|
||||
const isAlt = e.altKey && !e.ctrlKey && !e.metaKey;
|
||||
const isCtrl = (e.ctrlKey || e.metaKey) && !e.altKey;
|
||||
|
||||
// Ctrl+W 또는 Escape: 활성 모달 닫기
|
||||
if ((isCtrl && e.key.toLowerCase() === "w") || e.key === "Escape") {
|
||||
// native dialog는 Escape와 포커스 복귀를 스스로 처리한다.
|
||||
if (e.key === "Escape" && !document.querySelector("dialog[open]")) {
|
||||
const openModalCloseBtn = document.querySelector<HTMLButtonElement>(
|
||||
"[role='dialog'] button:has(svg), [role='dialog'] .sx-panel-close-btn, .vg-dialog__close, [role='dialog'] button[aria-label*='닫기']"
|
||||
);
|
||||
|
|
@ -104,14 +99,14 @@ export function AppShell({ children, className, contextLabel, hideNav, bleed, wi
|
|||
|
||||
// Alt+H: 홈으로 이동
|
||||
if (isAlt && e.key.toLowerCase() === "h") {
|
||||
if (!shellRole) return;
|
||||
e.preventDefault();
|
||||
const homePath = user?.role === "admin" ? "/admin" : user?.role === "teacher" ? "/professor" : "/learn";
|
||||
navigate(homePath);
|
||||
navigate(roleHomePath(shellRole));
|
||||
return;
|
||||
}
|
||||
|
||||
// Alt+N 또는 Ctrl+N 또는 Ctrl+T (입력창 밖): 새 회기 시작 / 페르소나 선택
|
||||
if ((isAlt && e.key.toLowerCase() === "n") || (!isInput && isCtrl && (e.key.toLowerCase() === "n" || e.key.toLowerCase() === "t"))) {
|
||||
// Alt+N: 새 회기 시작 / 페르소나 선택
|
||||
if (isAlt && e.key.toLowerCase() === "n") {
|
||||
e.preventDefault();
|
||||
navigate("/learn");
|
||||
return;
|
||||
|
|
@ -149,7 +144,7 @@ export function AppShell({ children, className, contextLabel, hideNav, bleed, wi
|
|||
|
||||
window.addEventListener("keydown", handleGlobalKeyDown);
|
||||
return () => window.removeEventListener("keydown", handleGlobalKeyDown);
|
||||
}, [navigate, user]);
|
||||
}, [navigate, shellRole]);
|
||||
|
||||
return (
|
||||
<div
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { NavLink } from "react-router-dom";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { NavLink, useLocation } from "react-router-dom";
|
||||
import { Icon, type IconName } from "../ui/Icon";
|
||||
import type { Role } from "../../lib/auth";
|
||||
|
||||
|
|
@ -8,6 +9,8 @@ export interface NavItem {
|
|||
icon: IconName;
|
||||
/** NavLink end (정확 매칭) */
|
||||
end?: boolean;
|
||||
/** 데스크톱과 전체 메뉴에서 항목의 역할을 설명하는 그룹 */
|
||||
group?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -16,41 +19,48 @@ export interface NavItem {
|
|||
*/
|
||||
const NAV_BY_ROLE: Record<Role, NavItem[]> = {
|
||||
learner: [
|
||||
{ to: "/learn", label: "대시보드", icon: "home", end: true },
|
||||
{ to: "/learn/practice", label: "학습", icon: "session" },
|
||||
{ to: "/learn/history", label: "기록", icon: "review" },
|
||||
{ to: "/settings", label: "설정", icon: "settings" },
|
||||
{ to: "/learn", label: "학습자 홈", icon: "home", end: true, group: "학습" },
|
||||
{ to: "/learn/practice", label: "상담 연습", icon: "session", group: "학습" },
|
||||
{ to: "/learn/history", label: "학습 기록", icon: "review", group: "학습" },
|
||||
{ to: "/settings", label: "설정", icon: "settings", group: "설정" },
|
||||
],
|
||||
teacher: [
|
||||
{ to: "/teach", label: "콘솔", icon: "users", end: true },
|
||||
{ to: "/teach/analysis", label: "학생 분석", icon: "review" },
|
||||
{ to: "/teach/supervision", label: "감독·연구", icon: "shield" },
|
||||
{ to: "/teach/personas", label: "페르소나", icon: "review" },
|
||||
{ to: "/settings", label: "설정", icon: "settings" },
|
||||
{ to: "/teach", label: "교수자 홈", icon: "users", end: true, group: "교수" },
|
||||
{ to: "/teach/analysis", label: "학생 분석", icon: "review", group: "교수" },
|
||||
{ to: "/teach/supervision", label: "감독·연구", icon: "shield", group: "교수" },
|
||||
{ to: "/teach/personas", label: "내담자 설정", icon: "review", group: "교수" },
|
||||
{ to: "/settings", label: "설정", icon: "settings", group: "설정" },
|
||||
],
|
||||
admin: [
|
||||
{ to: "/admin", label: "운영 홈", icon: "shield", end: true },
|
||||
{ to: "/admin/ai", label: "AI 운영", icon: "session" },
|
||||
{ to: "/admin/continuous-improvement", label: "지속 개선", icon: "refresh" },
|
||||
{ to: "/admin/users", label: "사용자", icon: "users" },
|
||||
{ to: "/admin/access", label: "권한", icon: "settings" },
|
||||
{ to: "/admin/tickets", label: "티켓", icon: "review" },
|
||||
{ to: "/teach", label: "교수 콘솔", icon: "users", end: true },
|
||||
{ to: "/teach/analysis", label: "학생 분석", icon: "review" },
|
||||
{ to: "/teach/supervision", label: "감독·연구", icon: "shield" },
|
||||
{ to: "/teach/personas", label: "페르소나", icon: "review" },
|
||||
{ to: "/learn", label: "학습자 홈", icon: "home", end: true },
|
||||
{ to: "/learn/practice", label: "학습", icon: "session" },
|
||||
{ to: "/learn/history", label: "기록", icon: "review" },
|
||||
{ to: "/settings", label: "설정", icon: "settings" },
|
||||
{ to: "/admin", label: "운영 홈", icon: "shield", end: true, group: "운영" },
|
||||
{ to: "/admin/ai", label: "AI 운영", icon: "session", group: "운영" },
|
||||
{ to: "/admin/continuous-improvement", label: "지속 개선", icon: "refresh", group: "운영" },
|
||||
{ to: "/admin/users", label: "사용자 관리", icon: "users", group: "운영" },
|
||||
{ to: "/admin/access", label: "접근 관리", icon: "settings", group: "운영" },
|
||||
{ to: "/admin/tickets", label: "지원 요청", icon: "review", group: "운영" },
|
||||
{ to: "/teach", label: "교수자 홈", icon: "users", end: true, group: "교수" },
|
||||
{ to: "/teach/analysis", label: "학생 분석", icon: "review", group: "교수" },
|
||||
{ to: "/teach/supervision", label: "감독·연구", icon: "shield", group: "교수" },
|
||||
{ to: "/teach/personas", label: "내담자 설정", icon: "review", group: "교수" },
|
||||
{ to: "/learn", label: "학습자 홈", icon: "home", end: true, group: "학습" },
|
||||
{ to: "/learn/practice", label: "상담 연습", icon: "session", group: "학습" },
|
||||
{ to: "/learn/history", label: "학습 기록", icon: "review", group: "학습" },
|
||||
{ to: "/settings", label: "설정", icon: "settings", group: "설정" },
|
||||
],
|
||||
};
|
||||
|
||||
const MOBILE_PRIMARY_PATHS: Record<Role, string[]> = {
|
||||
learner: ["/learn", "/learn/practice", "/learn/history"],
|
||||
teacher: ["/teach", "/teach/analysis", "/teach/supervision"],
|
||||
admin: ["/admin", "/admin/ai", "/admin/users"],
|
||||
};
|
||||
|
||||
const ADMIN_ENTRY: NavItem = {
|
||||
to: "/admin",
|
||||
label: "운영 콘솔",
|
||||
label: "운영 홈",
|
||||
icon: "shield",
|
||||
end: true,
|
||||
group: "운영",
|
||||
};
|
||||
|
||||
export function navItemsFor(role: Role, showAdminEntry = false): NavItem[] {
|
||||
|
|
@ -63,32 +73,161 @@ export interface SidebarProps {
|
|||
role: Role;
|
||||
/** 기본 역할 화면에서도 관리자 권한 사용자가 운영 콘솔로 돌아갈 수 있게 한다. */
|
||||
showAdminEntry?: boolean;
|
||||
/** 상단 그룹 라벨 (기본 "메뉴") */
|
||||
/** 이전 호출부 호환용 기본 그룹 라벨 */
|
||||
groupLabel?: string;
|
||||
}
|
||||
|
||||
/** 좌측 네비 (240px). 활성 = accent-tint 알약. 강조바 금지. §6.3 */
|
||||
function isPathActive(pathname: string, item: NavItem): boolean {
|
||||
if (item.end) return pathname === item.to;
|
||||
return pathname === item.to || pathname.startsWith(`${item.to}/`);
|
||||
}
|
||||
|
||||
function groupsFor(items: NavItem[], fallbackLabel: string): Array<[string, NavItem[]]> {
|
||||
const groups = new Map<string, NavItem[]>();
|
||||
for (const item of items) {
|
||||
const group = item.group ?? fallbackLabel;
|
||||
groups.set(group, [...(groups.get(group) ?? []), item]);
|
||||
}
|
||||
return [...groups.entries()];
|
||||
}
|
||||
|
||||
/** 좌측 네비와 좁은 화면의 하단 내비. */
|
||||
export function Sidebar({ role, showAdminEntry = false, groupLabel = "메뉴" }: SidebarProps) {
|
||||
const items = navItemsFor(role, showAdminEntry);
|
||||
const groups = groupsFor(items, groupLabel);
|
||||
const location = useLocation();
|
||||
const dialogRef = useRef<HTMLDialogElement | null>(null);
|
||||
const menuButtonRef = useRef<HTMLButtonElement | null>(null);
|
||||
const closeButtonRef = useRef<HTMLButtonElement | null>(null);
|
||||
const [menuOpen, setMenuOpen] = useState(false);
|
||||
const primaryPaths = MOBILE_PRIMARY_PATHS[role];
|
||||
const isMoreActive = !items.some(
|
||||
(item) => primaryPaths.includes(item.to) && isPathActive(location.pathname, item),
|
||||
);
|
||||
|
||||
const closeMenu = () => {
|
||||
const dialog = dialogRef.current;
|
||||
if (dialog?.open) dialog.close();
|
||||
};
|
||||
|
||||
const openMenu = () => {
|
||||
const dialog = dialogRef.current;
|
||||
if (!dialog || dialog.open) return;
|
||||
dialog.showModal();
|
||||
setMenuOpen(true);
|
||||
window.requestAnimationFrame(() => closeButtonRef.current?.focus());
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
closeMenu();
|
||||
}, [location.pathname]);
|
||||
|
||||
useEffect(() => {
|
||||
const mobileViewport = window.matchMedia("(max-width: 720px)");
|
||||
const closeOutsideMobile = () => {
|
||||
if (!mobileViewport.matches && dialogRef.current?.open) dialogRef.current.close();
|
||||
};
|
||||
mobileViewport.addEventListener("change", closeOutsideMobile);
|
||||
return () => mobileViewport.removeEventListener("change", closeOutsideMobile);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<nav className="vg-nav" aria-label="주 메뉴">
|
||||
<span className="vg-nav__label">{groupLabel}</span>
|
||||
{items.map((item) => (
|
||||
<NavLink
|
||||
key={item.to}
|
||||
to={item.to}
|
||||
end={item.end}
|
||||
className={({ isActive }) =>
|
||||
"vg-nav__item" + (isActive ? " is-active" : "")
|
||||
}
|
||||
>
|
||||
<span className="vg-nav__ic">
|
||||
<Icon name={item.icon} size={18} strokeWidth={1.75} />
|
||||
</span>
|
||||
<span className="vg-nav__txt">{item.label}</span>
|
||||
</NavLink>
|
||||
{groups.map(([group, groupItems]) => (
|
||||
<section className="vg-nav__group" key={group} aria-label={`${group} 메뉴`}>
|
||||
<span className="vg-nav__label">{group}</span>
|
||||
{groupItems.map((item) => {
|
||||
const isPrimary = primaryPaths.includes(item.to);
|
||||
return (
|
||||
<NavLink
|
||||
key={item.to}
|
||||
to={item.to}
|
||||
end={item.end}
|
||||
onClick={closeMenu}
|
||||
className={({ isActive }) =>
|
||||
"vg-nav__item" +
|
||||
(isActive ? " is-active" : "") +
|
||||
(isPrimary ? " vg-nav__item--mobile-primary" : "")
|
||||
}
|
||||
>
|
||||
<span className="vg-nav__ic">
|
||||
<Icon name={item.icon} size={18} strokeWidth={1.75} />
|
||||
</span>
|
||||
<span className="vg-nav__txt">{item.label}</span>
|
||||
</NavLink>
|
||||
);
|
||||
})}
|
||||
</section>
|
||||
))}
|
||||
|
||||
<button
|
||||
ref={menuButtonRef}
|
||||
type="button"
|
||||
className={"vg-nav__more" + (isMoreActive ? " is-active" : "")}
|
||||
aria-label="전체 메뉴"
|
||||
aria-expanded={menuOpen}
|
||||
aria-controls="vg-all-menu-dialog"
|
||||
onClick={openMenu}
|
||||
>
|
||||
<span className="vg-nav__ic">
|
||||
<Icon name="menu" size={20} strokeWidth={1.75} />
|
||||
</span>
|
||||
<span className="vg-nav__txt">전체 메뉴</span>
|
||||
</button>
|
||||
|
||||
<dialog
|
||||
id="vg-all-menu-dialog"
|
||||
ref={dialogRef}
|
||||
className="vg-nav__dialog"
|
||||
aria-labelledby="vg-all-menu-title"
|
||||
onCancel={(event) => {
|
||||
event.preventDefault();
|
||||
closeMenu();
|
||||
}}
|
||||
onClose={() => {
|
||||
setMenuOpen(false);
|
||||
const trigger = menuButtonRef.current;
|
||||
if (trigger && window.getComputedStyle(trigger).display !== "none") trigger.focus();
|
||||
}}
|
||||
>
|
||||
<div className="vg-nav__dialog-head">
|
||||
<div>
|
||||
<p className="vg-nav__dialog-kicker">현재 역할에서 이동</p>
|
||||
<h2 id="vg-all-menu-title">전체 메뉴</h2>
|
||||
</div>
|
||||
<button
|
||||
ref={closeButtonRef}
|
||||
type="button"
|
||||
className="vg-nav__dialog-close"
|
||||
aria-label="전체 메뉴 닫기"
|
||||
onClick={closeMenu}
|
||||
>
|
||||
<Icon name="x" size={20} />
|
||||
</button>
|
||||
</div>
|
||||
<div className="vg-nav__dialog-body">
|
||||
{groups.map(([group, groupItems]) => (
|
||||
<section className="vg-nav__dialog-group" key={group} aria-label={`${group} 메뉴`}>
|
||||
<h3>{group}</h3>
|
||||
{groupItems.map((item) => (
|
||||
<NavLink
|
||||
key={item.to}
|
||||
to={item.to}
|
||||
end={item.end}
|
||||
onClick={closeMenu}
|
||||
className={({ isActive }) =>
|
||||
"vg-nav__dialog-item" + (isActive ? " is-active" : "")
|
||||
}
|
||||
>
|
||||
<Icon name={item.icon} size={18} strokeWidth={1.75} />
|
||||
<span>{item.label}</span>
|
||||
</NavLink>
|
||||
))}
|
||||
</section>
|
||||
))}
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
<span className="vg-nav__spacer" />
|
||||
|
||||
<div className="vg-nav__foot">
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { Link, useLocation, useNavigate } from "react-router-dom";
|
||||
import { type ChangeEvent } from "react";
|
||||
import { Icon } from "../ui/Icon";
|
||||
import { ResilientImage } from "../avatar/ResilientImage";
|
||||
import { accessibleRolesFor, canAccessRole, roleHomePath, roleLabel, useAuth, type Role } from "../../lib/auth";
|
||||
|
|
@ -27,6 +28,17 @@ function initials(name?: string | null): string {
|
|||
return trimmed.slice(0, 1);
|
||||
}
|
||||
|
||||
function mobileRoleLabel(role: Role): string {
|
||||
switch (role) {
|
||||
case "learner":
|
||||
return "학습자";
|
||||
case "teacher":
|
||||
return "교수자";
|
||||
case "admin":
|
||||
return "관리자";
|
||||
}
|
||||
}
|
||||
|
||||
export interface TopbarProps {
|
||||
/** 역할 컨텍스트 라벨 오버라이드 (없으면 user.role 라벨) */
|
||||
contextLabel?: string;
|
||||
|
|
@ -41,12 +53,22 @@ export function Topbar({ contextLabel }: TopbarProps) {
|
|||
|
||||
const label = contextLabel ?? (user ? roleLabel(user.role) : null);
|
||||
const switchRoles: Role[] = user ? accessibleRolesFor(user) : [];
|
||||
const availableSwitchRoles = switchRoles.filter((role) => user && canAccessRole(user, role));
|
||||
const activeRole =
|
||||
availableSwitchRoles.find((role) => {
|
||||
const home = roleHomePath(role);
|
||||
return location.pathname === home || location.pathname.startsWith(`${home}/`);
|
||||
}) ?? user?.role;
|
||||
|
||||
const onLogout = async () => {
|
||||
await logout();
|
||||
navigate("/login", { replace: true });
|
||||
};
|
||||
|
||||
const onRoleSelect = (event: ChangeEvent<HTMLSelectElement>) => {
|
||||
navigate(roleHomePath(event.target.value as Role));
|
||||
};
|
||||
|
||||
return (
|
||||
<header className="vg-topbar">
|
||||
<Link className="vg-topbar__brand" to={user ? "/" : "/login"}>
|
||||
|
|
@ -62,11 +84,10 @@ export function Topbar({ contextLabel }: TopbarProps) {
|
|||
<span className="vg-topbar__spacer" />
|
||||
|
||||
<div className="vg-topbar__actions">
|
||||
{user && switchRoles.length > 0 ? (
|
||||
{user && availableSwitchRoles.length > 0 ? (
|
||||
<>
|
||||
<div className="vg-topbar__switch" aria-label="공간 전환">
|
||||
{switchRoles
|
||||
.filter((role) => canAccessRole(user, role))
|
||||
.map((role) => {
|
||||
{availableSwitchRoles.map((role) => {
|
||||
const to = roleHomePath(role);
|
||||
const active = location.pathname === to || location.pathname.startsWith(`${to}/`);
|
||||
return (
|
||||
|
|
@ -86,6 +107,22 @@ export function Topbar({ contextLabel }: TopbarProps) {
|
|||
);
|
||||
})}
|
||||
</div>
|
||||
<label className="vg-topbar__switch-select-wrap">
|
||||
<span className="vg-topbar__switch-select-label">공간 선택</span>
|
||||
<select
|
||||
className="vg-topbar__switch-select"
|
||||
aria-label="공간 선택"
|
||||
value={activeRole}
|
||||
onChange={onRoleSelect}
|
||||
>
|
||||
{availableSwitchRoles.map((role) => (
|
||||
<option key={role} value={role}>
|
||||
{mobileRoleLabel(role)}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
</>
|
||||
) : null}
|
||||
|
||||
<button
|
||||
|
|
|
|||
|
|
@ -138,6 +138,32 @@
|
|||
color: var(--text-strong);
|
||||
text-decoration: none;
|
||||
}
|
||||
.vg-topbar__switch-select-wrap {
|
||||
display: none;
|
||||
}
|
||||
.vg-topbar__switch-select-label {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap;
|
||||
border: 0;
|
||||
}
|
||||
.vg-topbar__switch-select {
|
||||
min-width: 0;
|
||||
min-height: 44px;
|
||||
border: 1px solid var(--hair);
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--bg-surface-2);
|
||||
color: var(--text-strong);
|
||||
font: inherit;
|
||||
font-size: 13px;
|
||||
font-weight: 650;
|
||||
padding: 0 28px 0 10px;
|
||||
}
|
||||
|
||||
/* 톱바 아이콘 버튼 (테마/로그아웃) */
|
||||
.vg-iconbtn {
|
||||
|
|
@ -243,6 +269,11 @@
|
|||
gap: var(--sp-1);
|
||||
overflow-y: auto;
|
||||
}
|
||||
.vg-nav__group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--sp-1);
|
||||
}
|
||||
.vg-nav__label {
|
||||
font-family: var(--font-num);
|
||||
font-size: 11px;
|
||||
|
|
@ -291,6 +322,10 @@
|
|||
.vg-nav__item.is-active .vg-nav__ic {
|
||||
color: var(--accent);
|
||||
}
|
||||
.vg-nav__more,
|
||||
.vg-nav__dialog {
|
||||
display: none;
|
||||
}
|
||||
.vg-nav__spacer {
|
||||
flex: 1;
|
||||
}
|
||||
|
|
@ -353,6 +388,23 @@
|
|||
padding: 11px;
|
||||
}
|
||||
}
|
||||
@media (min-width: 721px) and (max-width: 1024px) {
|
||||
.vg-shell__body {
|
||||
--nav-cur: 168px;
|
||||
}
|
||||
.vg-nav {
|
||||
padding: var(--sp-4) var(--sp-2);
|
||||
}
|
||||
.vg-nav__label,
|
||||
.vg-nav__item span:not(.vg-nav__ic),
|
||||
.vg-nav__ethic {
|
||||
display: block;
|
||||
}
|
||||
.vg-nav__item {
|
||||
justify-content: flex-start;
|
||||
padding: 9px 10px;
|
||||
}
|
||||
}
|
||||
@media (max-width: 720px) {
|
||||
html {
|
||||
scroll-padding-top: calc(var(--topbar-h) + var(--sp-2));
|
||||
|
|
@ -360,6 +412,7 @@
|
|||
}
|
||||
.vg-shell {
|
||||
height: 100dvh;
|
||||
--bottom-bar-h: 68px;
|
||||
}
|
||||
.vg-shell__body {
|
||||
display: flex;
|
||||
|
|
@ -384,11 +437,10 @@
|
|||
border-right: 0;
|
||||
border-top: 1px solid var(--hair);
|
||||
border-bottom: 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
gap: 4px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
align-items: stretch;
|
||||
gap: 2px;
|
||||
background: var(--bg-surface);
|
||||
box-shadow: var(--shadow-island);
|
||||
overflow-x: auto;
|
||||
|
|
@ -401,22 +453,35 @@
|
|||
.vg-nav__foot {
|
||||
display: none;
|
||||
}
|
||||
.vg-nav__group {
|
||||
display: contents;
|
||||
}
|
||||
.vg-nav__item {
|
||||
flex: 1 1 0;
|
||||
display: none;
|
||||
}
|
||||
.vg-nav__item--mobile-primary,
|
||||
.vg-nav__more {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
max-width: 96px;
|
||||
height: 48px;
|
||||
min-height: 48px;
|
||||
height: 52px;
|
||||
min-height: 52px;
|
||||
padding: 3px 2px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
border-radius: var(--radius);
|
||||
border: 1px solid transparent;
|
||||
background: transparent;
|
||||
color: var(--text-body);
|
||||
font: inherit;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
transition: transform var(--dur-fast) var(--ease-spring), background var(--dur-fast) var(--ease-out);
|
||||
}
|
||||
.vg-nav__item:active {
|
||||
.vg-nav__item--mobile-primary:active,
|
||||
.vg-nav__more:active {
|
||||
transform: scale(0.93);
|
||||
}
|
||||
.vg-nav__item .vg-nav__ic {
|
||||
|
|
@ -429,16 +494,17 @@
|
|||
height: 20px;
|
||||
}
|
||||
.vg-nav__item .vg-nav__txt,
|
||||
.vg-nav__item span:not(.vg-nav__ic) {
|
||||
.vg-nav__more .vg-nav__txt {
|
||||
display: block;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
line-height: 1.1;
|
||||
letter-spacing: -0.01em;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: visible;
|
||||
text-overflow: clip;
|
||||
white-space: normal;
|
||||
word-break: keep-all;
|
||||
}
|
||||
.vg-topbar__role {
|
||||
display: none;
|
||||
|
|
@ -471,20 +537,20 @@
|
|||
gap: 4px;
|
||||
}
|
||||
.vg-topbar__switch {
|
||||
height: 38px;
|
||||
padding: 2px;
|
||||
display: none;
|
||||
}
|
||||
.vg-topbar__switch-link {
|
||||
min-height: 34px;
|
||||
padding: 0 8px;
|
||||
font-size: 11.5px;
|
||||
.vg-topbar__switch-select-wrap {
|
||||
display: block;
|
||||
}
|
||||
.vg-topbar__switch-link span {
|
||||
display: inline;
|
||||
.vg-topbar__switch-select {
|
||||
box-sizing: border-box;
|
||||
width: min(104px, calc(100vw - 224px));
|
||||
min-height: 44px;
|
||||
font-size: 16px;
|
||||
}
|
||||
.vg-iconbtn {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
}
|
||||
.vg-main {
|
||||
padding: var(--sp-4) var(--sp-4) calc(var(--bottom-bar-h) + env(safe-area-inset-bottom) + var(--sp-6));
|
||||
|
|
@ -495,14 +561,10 @@
|
|||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
/* 관리자처럼 세 역할을 모두 전환할 수 있는 계정도 테마·로그아웃 버튼을
|
||||
밀어내지 않게 한다. 링크 이름은 aria-label/title에 그대로 남는다. */
|
||||
.vg-topbar__switch-link {
|
||||
flex: 0 0 34px;
|
||||
padding: 0;
|
||||
}
|
||||
.vg-topbar__switch-link span {
|
||||
display: none;
|
||||
.vg-topbar {
|
||||
min-height: 56px;
|
||||
padding: 0 var(--sp-2);
|
||||
gap: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -758,3 +820,173 @@ body[data-role] .vg-shell--botanical .vg-nav__foot {
|
|||
padding: 3px 2px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
body[data-role] .vg-shell--botanical .vg-nav {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
align-items: stretch;
|
||||
justify-content: stretch;
|
||||
gap: 2px;
|
||||
overflow: visible;
|
||||
}
|
||||
body[data-role] .vg-shell--botanical .vg-nav__group {
|
||||
display: contents;
|
||||
}
|
||||
body[data-role] .vg-shell--botanical .vg-nav__item,
|
||||
body[data-role] .vg-shell--botanical .vg-nav__item.is-active {
|
||||
display: none;
|
||||
}
|
||||
body[data-role] .vg-shell--botanical .vg-nav__item--mobile-primary,
|
||||
body[data-role] .vg-shell--botanical .vg-nav__item--mobile-primary.is-active,
|
||||
body[data-role] .vg-shell--botanical .vg-nav__more {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
max-width: none;
|
||||
min-width: 0;
|
||||
height: 52px;
|
||||
min-height: 52px;
|
||||
padding: 3px 2px;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: var(--radius);
|
||||
background: transparent;
|
||||
color: var(--text-body);
|
||||
font: inherit;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
body[data-role] .vg-shell--botanical .vg-nav__item--mobile-primary.is-active,
|
||||
body[data-role] .vg-shell--botanical .vg-nav__more.is-active {
|
||||
background: linear-gradient(
|
||||
112deg,
|
||||
color-mix(in srgb, var(--bg-surface) 92%, var(--botanical-gold)),
|
||||
color-mix(in srgb, var(--bg-surface-2) 80%, transparent)
|
||||
);
|
||||
border-color: color-mix(in srgb, var(--botanical-gold) 34%, var(--border-subtle));
|
||||
box-shadow: inset 0 1px 0 color-mix(in srgb, var(--bg-surface) 84%, transparent);
|
||||
color: var(--text-strong);
|
||||
}
|
||||
body[data-role] .vg-shell--botanical .vg-nav__item--mobile-primary .vg-nav__txt,
|
||||
body[data-role] .vg-shell--botanical .vg-nav__more .vg-nav__txt {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
overflow: visible;
|
||||
text-overflow: clip;
|
||||
white-space: normal;
|
||||
word-break: keep-all;
|
||||
}
|
||||
|
||||
.vg-nav__dialog[open] {
|
||||
display: flex;
|
||||
position: fixed;
|
||||
inset: auto 0 0;
|
||||
z-index: 60;
|
||||
width: 100%;
|
||||
max-width: none;
|
||||
max-height: min(92dvh, 680px);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 1px solid var(--hair);
|
||||
border-bottom: 0;
|
||||
border-radius: var(--radius-xl) var(--radius-xl) 0 0;
|
||||
background: var(--bg-app);
|
||||
color: var(--text-strong);
|
||||
box-shadow: var(--shadow-float);
|
||||
overflow: hidden;
|
||||
flex-direction: column;
|
||||
}
|
||||
.vg-nav__dialog::backdrop {
|
||||
background: color-mix(in srgb, var(--text-strong) 28%, transparent);
|
||||
}
|
||||
.vg-nav__dialog-head {
|
||||
min-height: 72px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--sp-3);
|
||||
padding: var(--sp-3) var(--sp-4);
|
||||
border-bottom: 1px solid var(--hair);
|
||||
}
|
||||
.vg-nav__dialog-kicker {
|
||||
margin: 0 0 2px;
|
||||
color: var(--text-muted);
|
||||
font-size: 12px;
|
||||
line-height: 1.3;
|
||||
}
|
||||
.vg-nav__dialog h2,
|
||||
.vg-nav__dialog h3 {
|
||||
margin: 0;
|
||||
color: var(--text-strong);
|
||||
}
|
||||
.vg-nav__dialog h2 {
|
||||
font-size: 18px;
|
||||
line-height: 1.25;
|
||||
}
|
||||
.vg-nav__dialog h3 {
|
||||
color: var(--text-muted);
|
||||
font-size: 12px;
|
||||
font-weight: 650;
|
||||
}
|
||||
.vg-nav__dialog-close {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
flex: none;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 1px solid transparent;
|
||||
border-radius: var(--radius);
|
||||
background: transparent;
|
||||
color: var(--text-body);
|
||||
cursor: pointer;
|
||||
}
|
||||
.vg-nav__dialog-close:hover {
|
||||
background: var(--bg-surface-2);
|
||||
color: var(--text-strong);
|
||||
}
|
||||
.vg-nav__dialog-body {
|
||||
min-height: 0;
|
||||
overflow-y: auto;
|
||||
overscroll-behavior: contain;
|
||||
padding: var(--sp-3) var(--sp-4) calc(var(--sp-5) + env(safe-area-inset-bottom));
|
||||
}
|
||||
.vg-nav__dialog-group + .vg-nav__dialog-group {
|
||||
margin-top: var(--sp-4);
|
||||
}
|
||||
.vg-nav__dialog-group h3 {
|
||||
padding: 0 var(--sp-3) var(--sp-2);
|
||||
}
|
||||
.vg-nav__dialog-item {
|
||||
min-height: 48px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--sp-3);
|
||||
padding: 10px var(--sp-3);
|
||||
border-radius: var(--radius);
|
||||
color: var(--text-body);
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
text-decoration: none;
|
||||
}
|
||||
.vg-nav__dialog-item:hover,
|
||||
.vg-nav__dialog-item.is-active {
|
||||
background: var(--accent-tint);
|
||||
color: var(--accent-deep);
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 721px) and (max-width: 1024px) {
|
||||
body[data-role] .vg-shell--botanical .vg-shell__body:not(.vg-shell__body--bare) {
|
||||
--nav-cur: 168px;
|
||||
}
|
||||
body[data-role] .vg-shell--botanical .vg-nav__item,
|
||||
body[data-role] .vg-shell--botanical .vg-nav__item.is-active {
|
||||
justify-content: flex-start;
|
||||
padding: 9px 10px;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue