mirror of
https://github.com/headporter81/ss-front-react.git
synced 2026-12-06 07:41:11 +09:00
feat : BBS 화면을 PC통신(DOS 텍스트 모드) 스타일 전체화면으로 개편
SpecialSource Frontend (React) CD / deploy (push) Successful in 14s
SpecialSource Frontend (React) CD / deploy (push) Successful in 14s
- 상태줄 / 이중선 창 / 명령줄 / 기능키(F1~F5) 레이아웃, PC·모바일 반응형 - 메인에 새 글 창 추가, 게시판을 번호·글쓴이·날짜·조회·제목 표로 변경 - 팔레트 버튼을 F4 색상 순환으로 대체 (PaletteSwitch 삭제) - 나눔고딕코딩 글꼴 적용 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
97321b8bef
commit
d0aced1026
10 files changed
+290
-186
No files matched your search
@@ -6,7 +6,6 @@ import { execute, initialState } from "../lib/command";
|
||||
import type { Nav, Palette } from "../types";
|
||||
import LoginForm from "./LoginForm";
|
||||
import MainMenu from "./MainMenu";
|
||||
import PaletteSwitch from "./PaletteSwitch";
|
||||
import PostDetail from "./PostDetail";
|
||||
import PostList from "./PostList";
|
||||
import styles from "./bbs.module.css";
|
||||
@@ -17,12 +16,19 @@ const DEFAULT_PALETTE: Palette = "blue";
|
||||
const subscribe = (onChange: () => void) => {
|
||||
const handler = () => {
|
||||
document.documentElement.dataset.palette = readPalette(); // 색은 CSS가 <html> 속성으로 적용
|
||||
onChange(); // 버튼 활성 표시는 React가 갱신
|
||||
onChange(); // F4가 다음 색을 고를 수 있게 React state도 갱신
|
||||
};
|
||||
window.addEventListener("storage", handler);
|
||||
return () => window.removeEventListener("storage", handler);
|
||||
};
|
||||
|
||||
// 상태줄 시계: 1초마다 다시 읽음 (서버 렌더링 땐 자리표시 문자열)
|
||||
const subscribeClock = (onChange: () => void) => {
|
||||
const t = setInterval(onChange, 1000);
|
||||
return () => clearInterval(t);
|
||||
};
|
||||
const readClock = () => new Date().toTimeString().slice(0, 8);
|
||||
|
||||
const readPalette = (): Palette => {
|
||||
try {
|
||||
const saved = localStorage.getItem(PALETTE_KEY);
|
||||
@@ -35,6 +41,7 @@ const readPalette = (): Palette => {
|
||||
export default function BbsTerminal() {
|
||||
const [state, dispatch] = useReducer(execute, initialState);
|
||||
const palette = useSyncExternalStore(subscribe, readPalette, () => DEFAULT_PALETTE);
|
||||
const clock = useSyncExternalStore(subscribeClock, readClock, () => "--:--:--");
|
||||
const [input, setInput] = useState("");
|
||||
const inputRef = useRef<HTMLInputElement>(null);
|
||||
const mounted = useRef(false);
|
||||
@@ -58,13 +65,28 @@ export default function BbsTerminal() {
|
||||
return () => removeEventListener("popstate", onPop);
|
||||
}, []);
|
||||
|
||||
const changePalette = (p: Palette) => {
|
||||
// F4: 블루 → 그린 → 앰버 순서로 돌아가며 변경
|
||||
const cyclePalette = () => {
|
||||
const next = PALETTES[(PALETTES.findIndex((p) => p.key === palette) + 1) % PALETTES.length].key;
|
||||
try {
|
||||
localStorage.setItem(PALETTE_KEY, p);
|
||||
localStorage.setItem(PALETTE_KEY, next);
|
||||
} catch {}
|
||||
window.dispatchEvent(new StorageEvent("storage")); // 같은 탭은 storage 이벤트가 안 오므로 직접 알림
|
||||
};
|
||||
|
||||
// 하단 기능키 (PC는 키보드 F1~F5도 동작)
|
||||
const fkeys = [
|
||||
{ key: "F1", label: "메인", run: () => dispatch({ screen: "main" }) },
|
||||
{ key: "F2", label: "게시판", run: () => dispatch({ screen: "list", list: "board" }) },
|
||||
{ key: "F3", label: "이전", run: () => history.back(), disabled: state.screen === "main" },
|
||||
{ key: "F4", label: "색상", run: cyclePalette },
|
||||
{
|
||||
key: "F5",
|
||||
label: state.user ? "로그아웃" : "로그인",
|
||||
run: () => dispatch(state.user ? { user: null } : { screen: "login" }),
|
||||
},
|
||||
];
|
||||
|
||||
// 클릭 = 명령어 대리 입력: 입력창에 채운 뒤 엔터와 같은 경로로 실행
|
||||
const submitFromClick = (cmd: string) => {
|
||||
setInput(cmd);
|
||||
@@ -77,44 +99,72 @@ export default function BbsTerminal() {
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={styles.shell}>
|
||||
<PaletteSwitch value={palette} onChange={changePalette} />
|
||||
<div
|
||||
className={styles.frame}
|
||||
onKeyDown={(e) => {
|
||||
const f = fkeys.find((k) => k.key === e.key);
|
||||
if (!f || f.disabled) return;
|
||||
e.preventDefault(); // F5 새로고침 등 브라우저 기본 동작 막기
|
||||
f.run();
|
||||
}}
|
||||
>
|
||||
<div className={styles.status}>
|
||||
<span>SPECIALSOURCE-BBS</span>
|
||||
{/*<span className={styles.opt}></span>*/}
|
||||
<span>{state.user ? `${state.user} 접속중` : "손님 (비로그인)"}</span>
|
||||
<span className={styles.opt}>{clock}</span>
|
||||
</div>
|
||||
|
||||
<div className={styles.frame}>
|
||||
<div className={styles.titlebar}>
|
||||
<span>SPECIALSOURCE-BBS</span>
|
||||
<span>{state.user ? `ONLINE: 7 · ${state.user} 접속중` : "ONLINE: 6 · 비로그인"}</span>
|
||||
</div>
|
||||
|
||||
<div className={styles.screen}>
|
||||
<div className={styles.screen}>
|
||||
<div className={styles.grid}>
|
||||
{state.screen === "main" && (
|
||||
<MainMenu readIds={state.readIds} loggedIn={!!state.user} onSelect={submitFromClick} />
|
||||
<MainMenu
|
||||
readIds={state.readIds}
|
||||
loggedIn={!!state.user}
|
||||
onSelect={submitFromClick}
|
||||
onOpenPost={(id) => {
|
||||
// 메인에서 숫자는 메뉴 번호라서, 게시판으로 옮긴 뒤 글 번호를 실행
|
||||
dispatch({ screen: "list", list: "board" });
|
||||
dispatch(String(id));
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{state.screen === "login" && <LoginForm onSuccess={(user) => dispatch({ screen: "main", user })} />}
|
||||
{state.screen === "list" && <PostList kind={state.list} readIds={state.readIds} onSelect={submitFromClick} />}
|
||||
{state.screen === "post" && state.postId !== null && <PostDetail postId={state.postId} />}
|
||||
{state.error && <div className={`${styles.sub} ${styles.error}`}>{state.error}</div>}
|
||||
</div>
|
||||
|
||||
<div className={styles.cmdline}>
|
||||
<span className={styles.prompt}>></span>
|
||||
<input
|
||||
ref={inputRef}
|
||||
type="text"
|
||||
value={input}
|
||||
onChange={(e) => setInput(e.target.value)}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key !== "Enter" || e.nativeEvent.isComposing) return;
|
||||
dispatch(input);
|
||||
setInput("");
|
||||
}}
|
||||
placeholder="번호 또는 메뉴명을 입력하세요"
|
||||
aria-label="BBS 명령어 입력"
|
||||
autoComplete="off"
|
||||
autoFocus
|
||||
/>
|
||||
{state.error && <div className={`${styles.full} ${styles.error}`}>{state.error}</div>}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={styles.cmdline}>
|
||||
<label htmlFor="bbs-cmd" className={styles.prompt}>
|
||||
선택 >
|
||||
</label>
|
||||
<input
|
||||
id="bbs-cmd"
|
||||
ref={inputRef}
|
||||
type="text"
|
||||
value={input}
|
||||
onChange={(e) => setInput(e.target.value)}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key !== "Enter" || e.nativeEvent.isComposing) return;
|
||||
dispatch(input);
|
||||
setInput("");
|
||||
}}
|
||||
placeholder="번호 또는 메뉴명 (M 메인 · L 목록)"
|
||||
autoComplete="off"
|
||||
autoFocus
|
||||
/>
|
||||
</div>
|
||||
|
||||
<nav className={styles.fkeys} aria-label="기능키">
|
||||
{fkeys.map((f) => (
|
||||
<button key={f.key} type="button" onClick={f.run} disabled={f.disabled}>
|
||||
<span>{f.key}</span>
|
||||
{f.label}
|
||||
</button>
|
||||
))}
|
||||
</nav>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -32,9 +32,9 @@ export default function LoginForm({ onSuccess }: { onSuccess: (user: string) =>
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={styles.title}>[7] 로그인</div>
|
||||
<div className={styles.sub}>아이디와 비밀번호를 입력하세요.</div>
|
||||
<section className={`${styles.win} ${styles.full}`}>
|
||||
<span className={styles.cap}>═ [7] 로그인 ═</span>
|
||||
<div className={styles.dim}>아이디와 비밀번호를 입력하세요.</div>
|
||||
<hr className={styles.rule} />
|
||||
<form className={styles.loginForm} onSubmit={submit}>
|
||||
<label>
|
||||
@@ -49,11 +49,10 @@ export default function LoginForm({ onSuccess }: { onSuccess: (user: string) =>
|
||||
{busy ? "접속중..." : "로그인"}
|
||||
</button>
|
||||
</form>
|
||||
{error && <div className={`${styles.sub} ${styles.error}`}>※ {error}</div>}
|
||||
<hr className={styles.rule} />
|
||||
{error && <div className={styles.error}>※ {error}</div>}
|
||||
<div className={styles.footer}>
|
||||
<b>M</b>=메인메뉴
|
||||
</div>
|
||||
</>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -1,35 +1,68 @@
|
||||
import { MENU } from "../constants";
|
||||
import { POSTS } from "../mocks/posts";
|
||||
import { PostTable } from "./PostList";
|
||||
import styles from "./bbs.module.css";
|
||||
|
||||
interface Props {
|
||||
readIds: number[];
|
||||
loggedIn: boolean;
|
||||
onSelect: (cmd: string) => void;
|
||||
onOpenPost: (id: number) => void;
|
||||
}
|
||||
|
||||
export default function MainMenu({ readIds, loggedIn, onSelect }: Props) {
|
||||
const unread = POSTS.length - readIds.length;
|
||||
// 영문 ASCII만 사용: ╔═╗ 같은 박스 문자는 한글 글꼴에서 폭이 달라져 줄이 어긋남
|
||||
// String.raw: 백슬래시(\)를 이스케이프 문자로 해석하지 않고 그대로 둠
|
||||
const LOGO = '';
|
||||
|
||||
// String.raw` ___ ___ ___ ___ ___ _ _
|
||||
// / __|| _ \| __| / __||_ _| /_\ | |
|
||||
// \__ \| _/| _| | (__ | | / _ \ | |__
|
||||
// |___/|_| |___| \___||___|/_/ \_\|____|
|
||||
// ___ ___ _ _ ___ ___ ___
|
||||
// / __| / _ \ | | | || _ \ / __|| __|
|
||||
// \__ \| (_) || |_| || /| (__ | _|
|
||||
// |___/ \___/ \___/ |_|_\ \___||___|`;
|
||||
|
||||
export default function MainMenu({ readIds, loggedIn, onSelect, onOpenPost }: Props) {
|
||||
const unread = POSTS.filter((p) => !readIds.includes(p.id));
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={styles.title}>SPECIALSOURCE.SYSTEM 메인 메뉴</div>
|
||||
<div className={styles.sub}>번호나 메뉴명을 입력하거나, 줄을 클릭하세요.</div>
|
||||
<hr className={styles.rule} />
|
||||
{MENU.map((m) => (
|
||||
<div key={m.num} className={styles.row} onClick={() => onSelect(String(m.num))}>
|
||||
<span className={styles.num}>{m.num}.</span>
|
||||
<span>{m.key === "login" && loggedIn ? "로그아웃" : m.label}</span>
|
||||
<span className={styles.dim}>{m.key === "login" && loggedIn ? "LOGOUT" : m.en}</span>
|
||||
{m.key === "login" && <span className={styles.dim}>(L)</span>}
|
||||
{m.key === "board" && <span className={styles.accent}>(안읽음 {unread})</span>}
|
||||
{m.key === "viewed" && <span className={styles.accent}>({readIds.length}건)</span>}
|
||||
<section className={`${styles.win} ${styles.full}`}>
|
||||
<span className={styles.cap}>═ 접속을 환영합니다 ═</span>
|
||||
<pre className={styles.logo}>{LOGO}</pre>
|
||||
<div className={styles.dim}>SPECIALSOURCE 전자게시판 · 번호나 메뉴명을 입력하거나 줄을 클릭하세요</div>
|
||||
</section>
|
||||
|
||||
<section className={styles.win}>
|
||||
<span className={styles.cap}>═ 메인 메뉴 ═</span>
|
||||
<ul className={styles.menu}>
|
||||
{MENU.map((m) => {
|
||||
const logout = m.key === "login" && loggedIn;
|
||||
return (
|
||||
<li key={m.num} onClick={() => onSelect(String(m.num))}>
|
||||
<span className={styles.num}>{m.num}.</span>
|
||||
<span>{logout ? "로그아웃" : m.label}</span>
|
||||
{m.key === "board" && <span className={styles.accent}>[새글 {unread.length}]</span>}
|
||||
{m.key === "viewed" && <span className={styles.accent}>[{readIds.length}건]</span>}
|
||||
<span className={`${styles.dim} ${styles.en}`}>{logout ? "LOGOUT" : m.en}</span>
|
||||
</li>
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section className={styles.win}>
|
||||
<span className={styles.cap}>═ 새 글 ═</span>
|
||||
{unread.length === 0 ? (
|
||||
<div className={styles.dim}>새 글을 모두 읽었습니다.</div>
|
||||
) : (
|
||||
<PostTable posts={unread.slice(0, 5)} onSelect={onOpenPost} />
|
||||
)}
|
||||
<div className={styles.footer}>
|
||||
줄을 누르면 바로 읽기 · <b>2</b>=게시판 전체
|
||||
</div>
|
||||
))}
|
||||
<hr className={styles.rule} />
|
||||
<div className={styles.footer}>
|
||||
예) <b>2</b> 또는 <b>board</b> 입력 → 자유게시판 이동
|
||||
</div>
|
||||
</section>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
import { PALETTES } from "../constants";
|
||||
import type { Palette } from "../types";
|
||||
import styles from "./bbs.module.css";
|
||||
|
||||
interface Props {
|
||||
value: Palette;
|
||||
onChange: (p: Palette) => void;
|
||||
}
|
||||
|
||||
export default function PaletteSwitch({ value, onChange }: Props) {
|
||||
return (
|
||||
<div className={styles.paletteSwitch}>
|
||||
{PALETTES.map((p) => (
|
||||
<button
|
||||
key={p.key}
|
||||
type="button"
|
||||
className={`${styles.paletteBtn} ${value === p.key ? styles.active : ""}`}
|
||||
aria-pressed={value === p.key}
|
||||
onClick={() => onChange(p.key)}
|
||||
>
|
||||
{p.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -6,17 +6,20 @@ export default function PostDetail({ postId }: { postId: number }) {
|
||||
if (!post) return null;
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={styles.title}>{post.title}</div>
|
||||
<div className={styles.sub}>
|
||||
글쓴이 {post.author} · 조회 {post.views} · {post.date}
|
||||
<section className={`${styles.win} ${styles.full}`}>
|
||||
<span className={styles.cap}>═ 자유게시판 #{post.id} ═</span>
|
||||
<div className={styles.postHead}>
|
||||
<span>제목 :</span> {post.title}
|
||||
</div>
|
||||
<div className={styles.postHead}>
|
||||
<span>글쓴이:</span> {post.author} <span>날짜:</span> {post.date} <span>조회:</span> {post.views}
|
||||
</div>
|
||||
<hr className={styles.rule} />
|
||||
<div className={styles.body}>{post.body}</div>
|
||||
<hr className={styles.rule} />
|
||||
<div className={styles.footer}>
|
||||
<b>L</b>=목록으로 · <b>M</b>=메인메뉴
|
||||
<b>L</b>=목록 · <b>M</b>=메인
|
||||
</div>
|
||||
</>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { POSTS } from "../mocks/posts";
|
||||
import type { ListKind } from "../types";
|
||||
import type { ListKind, Post } from "../types";
|
||||
import styles from "./bbs.module.css";
|
||||
|
||||
interface Props {
|
||||
@@ -8,31 +8,51 @@ interface Props {
|
||||
onSelect: (cmd: string) => void;
|
||||
}
|
||||
|
||||
/** 번호 / 글쓴이 / 날짜 / 조회 / 제목 표 (메인의 "새 글" 창에서도 사용) */
|
||||
export function PostTable({ posts, dim, onSelect }: { posts: Post[]; dim?: boolean; onSelect: (id: number) => void }) {
|
||||
return (
|
||||
<table className={styles.tbl}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th className={styles.idx}>번호</th>
|
||||
<th className={styles.wide}>글쓴이</th>
|
||||
<th>날짜</th>
|
||||
<th className={`${styles.idx} ${styles.wide}`}>조회</th>
|
||||
<th>제목</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{posts.map((p) => (
|
||||
<tr key={p.id} onClick={() => onSelect(p.id)}>
|
||||
<td className={styles.idx}>{p.id}</td>
|
||||
<td className={styles.wide}>{p.author}</td>
|
||||
<td>{p.date}</td>
|
||||
<td className={`${styles.idx} ${styles.wide}`}>{p.views}</td>
|
||||
<td className={`${styles.title} ${dim ? styles.dim : ""}`}>{p.title}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
);
|
||||
}
|
||||
|
||||
export default function PostList({ kind, readIds, onSelect }: Props) {
|
||||
const viewed = kind === "viewed";
|
||||
const posts = POSTS.filter((p) => readIds.includes(p.id) === viewed);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={styles.title}>
|
||||
[{viewed ? 3 : 2}] {viewed ? "내가 읽은 글" : "자유게시판"}
|
||||
</div>
|
||||
<div className={styles.sub}>글 번호를 입력하면 읽습니다 · 총 {posts.length}건</div>
|
||||
<hr className={styles.rule} />
|
||||
{posts.length === 0 && <div className={styles.sub}>표시할 글이 없습니다.</div>}
|
||||
{posts.map((p) => (
|
||||
<div key={p.id} className={`${styles.row} ${styles.postRow}`} onClick={() => onSelect(String(p.id))}>
|
||||
<span className={styles.postIdx}>{p.id}</span>
|
||||
<span className={`${styles.postTitle} ${viewed ? styles.dim : ""}`}>{p.title}</span>
|
||||
<span className={styles.postMeta}>
|
||||
{p.author} · 조회 {p.views} · {p.date}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
<hr className={styles.rule} />
|
||||
<section className={`${styles.win} ${styles.full}`}>
|
||||
<span className={styles.cap}>
|
||||
═ [{viewed ? 3 : 2}] {viewed ? "내가 읽은 글" : "자유게시판"} ({posts.length}건) ═
|
||||
</span>
|
||||
{posts.length === 0 ? (
|
||||
<div className={styles.dim}>표시할 글이 없습니다.</div>
|
||||
) : (
|
||||
<PostTable posts={posts} dim={viewed} onSelect={(id) => onSelect(String(id))} />
|
||||
)}
|
||||
<div className={styles.footer}>
|
||||
<b>번호</b>=글읽기 · <b>M</b>=메인 · <b>L</b>=이 목록 새로고침
|
||||
<b>번호</b>=글읽기 · <b>M</b>=메인 · <b>L</b>=새로고침
|
||||
</div>
|
||||
</>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -1,100 +1,132 @@
|
||||
/* --- BBS 팔레트 (시대별 PC통신 느낌) --- */
|
||||
/* PC통신(DOS 텍스트 모드) 화면 — 상태줄 / 본문 / 명령줄 / 기능키 줄이 화면을 꽉 채움 */
|
||||
/* <html data-palette>는 layout.tsx 인라인 스크립트가 첫 페인트 전에 설정 → 깜빡임 없음 */
|
||||
.frame, :global(html[data-palette="blue"]) .frame {
|
||||
--bbs-bg: #000033; --bbs-fg: #d9d9f5; --bbs-accent: #55ffff;
|
||||
--bbs-highlight: #ffff55; --bbs-dim: #7d7dc4; --bbs-border: #ffffff; --bbs-glow: rgba(85, 255, 255, 0.35);
|
||||
--bbs-bg: #0000a8; --bbs-fg: #c0c0c0; --bbs-hi: #ffffff; --bbs-accent: #55ffff;
|
||||
--bbs-highlight: #ffff55; --bbs-dim: #8080d0; --bbs-bar: #00a8a8; --bbs-bar-fg: #000000; --bbs-sel: #a8a8a8;
|
||||
}
|
||||
:global(html[data-palette="green"]) .frame {
|
||||
--bbs-bg: #000d00; --bbs-fg: #cdf7cd; --bbs-accent: #4dff4d;
|
||||
--bbs-highlight: #ffff55; --bbs-dim: #3f8f3f; --bbs-border: #4dff4d; --bbs-glow: rgba(77, 255, 77, 0.35);
|
||||
--bbs-bg: #001400; --bbs-fg: #33ff66; --bbs-hi: #b8ffc8; --bbs-accent: #66ff99;
|
||||
--bbs-highlight: #ccff66; --bbs-dim: #1f8f3f; --bbs-bar: #33ff66; --bbs-bar-fg: #000000; --bbs-sel: #1f8f3f;
|
||||
}
|
||||
:global(html[data-palette="amber"]) .frame {
|
||||
--bbs-bg: #190f00; --bbs-fg: #ffe3ba; --bbs-accent: #ffb347;
|
||||
--bbs-highlight: #ffffff; --bbs-dim: #a06a2c; --bbs-border: #ffb347; --bbs-glow: rgba(255, 179, 71, 0.35);
|
||||
--bbs-bg: #140a00; --bbs-fg: #ffb000; --bbs-hi: #ffe0a0; --bbs-accent: #ffcc55;
|
||||
--bbs-highlight: #ffffff; --bbs-dim: #a06a00; --bbs-bar: #ffb000; --bbs-bar-fg: #000000; --bbs-sel: #a06a00;
|
||||
}
|
||||
|
||||
.shell { width: 100%; max-width: 760px; display: flex; flex-direction: column; align-items: center; }
|
||||
|
||||
.paletteSwitch { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
|
||||
.paletteBtn {
|
||||
background: none; border: 1px solid #333; color: #8fae93; font-size: 11px;
|
||||
padding: 6px 12px; cursor: pointer; letter-spacing: 0.02em;
|
||||
}
|
||||
.paletteBtn:hover, .active { border-color: #eafff0; color: #eafff0; }
|
||||
|
||||
.frame {
|
||||
width: 100%; background: var(--bbs-bg); color: var(--bbs-fg);
|
||||
border: 3px double var(--bbs-border);
|
||||
box-shadow: 0 0 24px var(--bbs-glow), 0 20px 60px rgba(0, 0, 0, 0.6);
|
||||
height: 100dvh; /* dvh: 모바일 주소창이 나타나거나 사라져도 화면에 딱 맞음 */
|
||||
display: grid; grid-template-rows: auto 1fr auto auto;
|
||||
background: var(--bbs-bg); color: var(--bbs-fg);
|
||||
font-size: clamp(14px, 1.15vw + 4px, 20px); line-height: 1.55;
|
||||
position: relative; overflow: hidden;
|
||||
}
|
||||
/* CRT 스캔라인 */
|
||||
/* CRT 스캔라인 + 가장자리 어둡게 */
|
||||
.frame::after {
|
||||
content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
|
||||
background: linear-gradient(rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.12) 50%);
|
||||
background-size: 100% 3px; mix-blend-mode: overlay; opacity: 0.5;
|
||||
background:
|
||||
repeating-linear-gradient(rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, 0.18) 2px 3px),
|
||||
radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.45) 100%);
|
||||
}
|
||||
.frame :focus-visible { outline: 2px solid var(--bbs-accent); outline-offset: 2px; }
|
||||
.frame :focus-visible { outline: 2px solid var(--bbs-highlight); outline-offset: -2px; }
|
||||
|
||||
.titlebar {
|
||||
display: flex; justify-content: space-between; align-items: center; gap: 8px;
|
||||
padding: 8px 16px; border-bottom: 1px solid var(--bbs-border);
|
||||
font-size: 12.5px; font-weight: 700; color: var(--bbs-accent); letter-spacing: 0.03em;
|
||||
/* 상단 상태줄 (반전색) */
|
||||
.status {
|
||||
display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 2ch;
|
||||
padding: 0 16px; background: var(--bbs-bar); color: var(--bbs-bar-fg); font-weight: 700; white-space: nowrap;
|
||||
}
|
||||
.screen { padding: 18px 20px; min-height: 360px; font-size: 13.5px; line-height: 1.9; }
|
||||
|
||||
.row { display: flex; gap: 10px; cursor: pointer; padding: 1px 4px; margin: 0 -4px; }
|
||||
.row:hover { background: rgba(255, 255, 255, 0.08); }
|
||||
.num { color: var(--bbs-highlight); font-weight: 700; width: 1.4em; flex-shrink: 0; text-align: right; }
|
||||
/* 본문: 이중선 창들을 배치하는 격자 */
|
||||
.screen { overflow-y: auto; min-height: 0; padding: 1.4em 16px; }
|
||||
.grid {
|
||||
display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1.6em 2ch;
|
||||
max-width: 120ch; margin: 0 auto;
|
||||
}
|
||||
.win { border: 4px double var(--bbs-hi); padding: 1.1em 1.5ch 0.8em; position: relative; min-width: 0; }
|
||||
.full { grid-column: 1 / -1; }
|
||||
/* 창 제목: 위쪽 테두리 위에 얹기 */
|
||||
.cap {
|
||||
position: absolute; top: -0.85em; left: 2ch; padding: 0 1ch;
|
||||
background: var(--bbs-bg); color: var(--bbs-highlight); font-weight: 700; white-space: nowrap;
|
||||
}
|
||||
|
||||
.logo { margin: 0; font: inherit; font-size: 0.9em; font-weight: 700; line-height: 1.15; color: var(--bbs-accent); overflow: hidden; }
|
||||
.num { color: var(--bbs-highlight); font-weight: 700; }
|
||||
.dim { color: var(--bbs-dim); }
|
||||
.accent { color: var(--bbs-accent); }
|
||||
|
||||
.title { color: var(--bbs-accent); font-weight: 700; margin-bottom: 4px; }
|
||||
.sub { color: var(--bbs-dim); font-size: 12px; margin-bottom: 10px; }
|
||||
.error { color: #ff6b6b; }
|
||||
.rule { border: none; border-top: 1px solid var(--bbs-dim); opacity: 0.5; margin: 8px 0 12px; }
|
||||
.rule { border: none; border-top: 1px dashed var(--bbs-dim); margin: 0.6em 0; }
|
||||
.footer { color: var(--bbs-dim); margin-top: 0.6em; }
|
||||
.footer b { color: var(--bbs-highlight); }
|
||||
|
||||
.postRow { font-size: 13px; }
|
||||
.postIdx { color: var(--bbs-highlight); width: 1.6em; flex-shrink: 0; text-align: right; }
|
||||
.postTitle { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.postMeta { color: var(--bbs-dim); font-size: 11.5px; flex-shrink: 0; white-space: nowrap; }
|
||||
/* 메인 메뉴: 마우스를 올리면 반전 막대 */
|
||||
.menu { list-style: none; margin: 0; padding: 0; }
|
||||
.menu li { display: flex; gap: 1ch; padding: 0 0.5ch; cursor: pointer; }
|
||||
.menu li .en { margin-left: auto; }
|
||||
.menu li:hover, .menu li:hover * { background: var(--bbs-sel); color: var(--bbs-bar-fg); }
|
||||
|
||||
.body { white-space: pre-wrap; margin-bottom: 14px; }
|
||||
/* 게시판 표 */
|
||||
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
|
||||
.tbl th {
|
||||
color: var(--bbs-accent); text-align: left; font-weight: 700; white-space: nowrap;
|
||||
border-bottom: 1px dashed var(--bbs-dim); padding: 0 1ch 0.2em 0;
|
||||
}
|
||||
.tbl td { padding: 0 1ch 0 0; white-space: nowrap; }
|
||||
.tbl .idx { color: var(--bbs-highlight); text-align: right; }
|
||||
.tbl .title { width: 100%; white-space: normal; color: var(--bbs-hi); }
|
||||
.tbl .title.dim { color: var(--bbs-dim); }
|
||||
.tbl tbody tr { cursor: pointer; }
|
||||
.tbl tbody tr:hover td { background: var(--bbs-sel); color: var(--bbs-bar-fg); }
|
||||
|
||||
.loginForm { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
|
||||
.loginForm label { display: flex; gap: 10px; align-items: center; }
|
||||
/* 글 읽기 */
|
||||
.postHead span { color: var(--bbs-accent); }
|
||||
.body { white-space: pre-wrap; color: var(--bbs-hi); }
|
||||
|
||||
/* 로그인 */
|
||||
.loginForm { display: flex; flex-direction: column; gap: 0.5em; }
|
||||
.loginForm label { display: flex; gap: 1ch; align-items: center; }
|
||||
.loginForm input {
|
||||
flex: 1; max-width: 260px; background: none; border: none; border-bottom: 1px solid var(--bbs-dim);
|
||||
color: var(--bbs-fg); font: inherit; outline: none; caret-color: var(--bbs-highlight);
|
||||
flex: 1; max-width: 30ch; background: none; border: none; border-bottom: 1px solid var(--bbs-dim);
|
||||
color: var(--bbs-hi); font: inherit; outline: none; caret-color: var(--bbs-highlight);
|
||||
}
|
||||
.loginForm input:focus { border-bottom-color: var(--bbs-accent); }
|
||||
.loginForm button {
|
||||
align-self: flex-start; background: none; border: 1px solid var(--bbs-accent); color: var(--bbs-accent);
|
||||
font: inherit; padding: 0 12px; cursor: pointer;
|
||||
font: inherit; padding: 0 1.5ch; cursor: pointer;
|
||||
}
|
||||
.loginForm button:disabled { opacity: 0.5; cursor: wait; }
|
||||
|
||||
.footer { color: var(--bbs-dim); font-size: 11.5px; }
|
||||
.footer b { color: var(--bbs-highlight); }
|
||||
|
||||
.cmdline {
|
||||
display: flex; align-items: center; gap: 8px; padding: 10px 16px;
|
||||
border-top: 1px solid var(--bbs-border); background: rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
.prompt { color: var(--bbs-highlight); font-size: 13px; font-weight: 700; flex-shrink: 0; }
|
||||
/* 명령줄 */
|
||||
.cmdline { display: flex; align-items: center; gap: 1ch; padding: 0.3em 16px; border-top: 1px solid var(--bbs-dim); }
|
||||
.prompt { color: var(--bbs-highlight); font-weight: 700; white-space: nowrap; }
|
||||
.cmdline input {
|
||||
flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--bbs-fg);
|
||||
font-size: 13.5px; caret-color: var(--bbs-highlight);
|
||||
flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--bbs-hi); font: inherit;
|
||||
caret-color: var(--bbs-hi); caret-shape: block; /* 블록 커서 (지원 브라우저만, 나머지는 일반 커서) */
|
||||
}
|
||||
.cmdline input::placeholder { color: var(--bbs-dim); }
|
||||
|
||||
@media (max-width: 560px) {
|
||||
.postMeta { display: none; }
|
||||
.screen { padding: 14px; }
|
||||
.titlebar { padding: 8px 12px; font-size: 11.5px; }
|
||||
/* 하단 기능키 줄 */
|
||||
.fkeys { display: flex; padding-bottom: env(safe-area-inset-bottom, 0px); }
|
||||
.fkeys button {
|
||||
flex: 1; min-width: 0; display: flex; justify-content: center; gap: 0.4ch; padding: 0.15em 0;
|
||||
background: none; border: none; color: var(--bbs-hi); font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap;
|
||||
}
|
||||
/* iOS는 16px 미만 input에 포커스하면 화면을 확대함 */
|
||||
.fkeys button span { background: var(--bbs-bar); color: var(--bbs-bar-fg); padding: 0 0.4ch; }
|
||||
.fkeys button:hover span { background: var(--bbs-hi); }
|
||||
.fkeys button:disabled { opacity: 0.4; cursor: default; }
|
||||
|
||||
/* ── 모바일 ── */
|
||||
@media (max-width: 720px) {
|
||||
.frame { font-size: 15px; }
|
||||
.grid { grid-template-columns: minmax(0, 1fr); }
|
||||
.opt { display: none; }
|
||||
.logo { font-size: 3.4vw; }
|
||||
.tbl .wide { display: none; } /* 글쓴이·조회 숨김 */
|
||||
.tbl .title { max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.fkeys button { flex-direction: column; align-items: center; gap: 0; padding: 0.4em 0; font-size: 13px; border-top: 1px solid var(--bbs-dim); }
|
||||
}
|
||||
/* 손가락 터치 영역 확보 + iOS는 16px 미만 input에 포커스하면 화면을 확대함 */
|
||||
@media (pointer: coarse) {
|
||||
.cmdline input { font-size: 16px; }
|
||||
.row { padding: 4px; } /* 손가락 터치 영역 확보 */
|
||||
.menu li { padding: 0.35em 0.5ch; }
|
||||
.tbl td { padding-block: 0.3em; }
|
||||
.cmdline input, .loginForm input { font-size: 16px; }
|
||||
}
|
||||
Reference in new issue
Block a user