- 핵심 규칙 6: 완료의 정의는 게이트 통과. 사용자를 QA로 쓰지 않는다 - 5단계 기계 검사 4번째: design-gate 실행 의무화 - references/audit-gate.md: 사고-검사 매핑, SEO/meta 체크리스트, OS/브라우저 특성, 하니스 규칙 - tools/design-gate.mjs: 범용 게이트(메타/SEO·대비·수축·리듬·트랙·스케일×폭 + 옵션 L0/L3/L4, checks 깊은 병합) - 리듬·트랙 불변식: 숫자 라벨 등폭·빈 셀 트랙 균일·등간격 — 시간표 자동배치 결함 재현 픽스처 검출, 앱 15뷰 통과(오탐 0) feat(site): 관리 앱 2종 프로덕션 콘솔(v6→v18) - 가온 학적부 9뷰·두레 수강신청 6뷰: shadcn 문법, Pretendard/Noto Serif/IBM Plex 폰트 전략, 볼드 금지(400/500/600), WCAG AA 대비 전면 교정, 한글 keep-all 조판 - LMS 필수 요소(알림 센터·공지·진도·평가 유형·출결 사유·학점 경고), 12명 기준 데이터 정합, SEO 구조(h1 유일·OG/twitter·og.png) - 시간표 자동배치 결함 수리(명시적 격자 좌표) - QA 게이트: L0 stylelint/html-validate · L1 단위 30 · L2 감사 61+불변식 · L3 시각회귀 30화면 · L4 WebKit · L5 키보드 탐색 — npm run verify 실패 시 배포 금지 체인
This commit is contained in:
parent
78ddc8b61a
commit
72337b7ee0
226 changed files with 18212 additions and 380 deletions
132
apps/site/tools/capture-shots.mjs
Normal file
132
apps/site/tools/capture-shots.mjs
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
import { execFileSync } from "node:child_process";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const rootDir = path.resolve(__dirname, "..");
|
||||
const chromePath = "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe";
|
||||
const shotsDir = path.join(rootDir, "src", "assets", "shots");
|
||||
|
||||
if (!fs.existsSync(shotsDir)) {
|
||||
fs.mkdirSync(shotsDir, { recursive: true });
|
||||
}
|
||||
|
||||
const targets = [
|
||||
{
|
||||
url: path.join(rootDir, "public", "work", "thursday-flowers", "index.html"),
|
||||
out: path.join(shotsDir, "work-thursday-flowers.png"),
|
||||
altUrl: path.join(rootDir, "public", "work", "thursday-flowers", "index.html"),
|
||||
altOut: path.join(shotsDir, "work-thursday-flowers-2.png"),
|
||||
},
|
||||
{
|
||||
url: path.join(rootDir, "public", "work", "muwol-coffee", "index.html"),
|
||||
out: path.join(shotsDir, "work-muwol-coffee.png"),
|
||||
altUrl: path.join(rootDir, "public", "work", "muwol-coffee", "index.html"),
|
||||
altOut: path.join(shotsDir, "work-muwol-coffee-2.png"),
|
||||
},
|
||||
{
|
||||
url: path.join(rootDir, "public", "work", "pulsegate", "index.html"),
|
||||
out: path.join(shotsDir, "work-pulsegate.png"),
|
||||
altUrl: path.join(rootDir, "public", "work", "pulsegate", "index.html"),
|
||||
altOut: path.join(shotsDir, "work-pulsegate-2.png"),
|
||||
},
|
||||
{
|
||||
url: path.join(rootDir, "public", "work", "form-architecture", "index.html"),
|
||||
out: path.join(shotsDir, "work-form-architecture.png"),
|
||||
altUrl: path.join(rootDir, "public", "work", "form-architecture", "index.html"),
|
||||
altOut: path.join(shotsDir, "work-form-architecture-2.png"),
|
||||
},
|
||||
{
|
||||
url: path.join(rootDir, "public", "work", "overtone-sound", "index.html"),
|
||||
out: path.join(shotsDir, "work-overtone-sound.png"),
|
||||
altUrl: path.join(rootDir, "public", "work", "overtone-sound", "index.html"),
|
||||
altOut: path.join(shotsDir, "work-overtone-sound-2.png"),
|
||||
},
|
||||
{
|
||||
url: path.join(rootDir, "public", "work", "font-foundry", "index.html"),
|
||||
out: path.join(shotsDir, "work-font-foundry.png"),
|
||||
altUrl: path.join(rootDir, "public", "work", "font-foundry", "index.html"),
|
||||
altOut: path.join(shotsDir, "work-font-foundry-2.png"),
|
||||
},
|
||||
{
|
||||
url: path.join(rootDir, "public", "work", "lumina-optics", "index.html"),
|
||||
out: path.join(shotsDir, "work-lumina-optics.png"),
|
||||
altUrl: path.join(rootDir, "public", "work", "lumina-optics", "index.html"),
|
||||
altOut: path.join(shotsDir, "work-lumina-optics-2.png"),
|
||||
webgl: true, // three.js 캔버스 — swiftshader 필요
|
||||
},
|
||||
{
|
||||
url: path.join(rootDir, "public", "work", "hyang-incense", "index.html"),
|
||||
out: path.join(shotsDir, "work-hyang-incense.png"),
|
||||
altUrl: path.join(rootDir, "public", "work", "hyang-incense", "index.html"),
|
||||
altOut: path.join(shotsDir, "work-hyang-incense-2.png"),
|
||||
},
|
||||
{
|
||||
url: path.join(rootDir, "public", "work", "synapse-bci", "index.html"),
|
||||
out: path.join(shotsDir, "work-synapse-bci.png"),
|
||||
altUrl: path.join(rootDir, "public", "work", "synapse-bci", "index.html"),
|
||||
altOut: path.join(shotsDir, "work-synapse-bci-2.png"),
|
||||
},
|
||||
{
|
||||
url: path.join(rootDir, "public", "work", "baekje-celadon", "index.html"),
|
||||
out: path.join(shotsDir, "work-baekje-celadon.png"),
|
||||
altUrl: path.join(rootDir, "public", "work", "baekje-celadon", "index.html"),
|
||||
altOut: path.join(shotsDir, "work-baekje-celadon-2.png"),
|
||||
},
|
||||
{
|
||||
url: path.join(rootDir, "public", "work", "orbit-aerospace", "index.html"),
|
||||
out: path.join(shotsDir, "work-orbit-aerospace.png"),
|
||||
altUrl: path.join(rootDir, "public", "work", "orbit-aerospace", "index.html"),
|
||||
altOut: path.join(shotsDir, "work-orbit-aerospace-2.png"),
|
||||
},
|
||||
{
|
||||
url: path.join(rootDir, "public", "work", "gaon-lms", "index.html"),
|
||||
out: path.join(shotsDir, "work-gaon-lms.png"),
|
||||
altUrl: path.join(rootDir, "public", "work", "gaon-lms", "index.html"),
|
||||
altOut: path.join(shotsDir, "work-gaon-lms-2.png"),
|
||||
},
|
||||
{
|
||||
url: path.join(rootDir, "public", "work", "dure-enrollment", "index.html"),
|
||||
out: path.join(shotsDir, "work-dure-enrollment.png"),
|
||||
altUrl: path.join(rootDir, "public", "work", "dure-enrollment", "index.html"),
|
||||
altOut: path.join(shotsDir, "work-dure-enrollment-2.png"),
|
||||
},
|
||||
];
|
||||
|
||||
console.log("📸 Capturing high-resolution screenshots...");
|
||||
|
||||
const shot = (t, url, out) => {
|
||||
const flags = t.webgl
|
||||
? ["--no-sandbox", "--use-angle=swiftshader"] // --disable-gpu 는 WebGL 을 죽인다
|
||||
: ["--disable-gpu", "--no-sandbox"];
|
||||
execFileSync(chromePath, [
|
||||
"--headless=new",
|
||||
"--hide-scrollbars",
|
||||
...flags,
|
||||
"--force-device-scale-factor=1",
|
||||
"--window-size=1440,900",
|
||||
`--screenshot=${out}`,
|
||||
`file://${url}`,
|
||||
]);
|
||||
};
|
||||
|
||||
for (const t of targets) {
|
||||
console.log(`- Capturing ${path.basename(t.out)}`);
|
||||
try {
|
||||
shot(t, t.url, t.out);
|
||||
} catch (e) {
|
||||
console.error(`Error capturing ${t.out}:`, e.message);
|
||||
}
|
||||
|
||||
if (t.altOut) {
|
||||
console.log(`- Capturing ${path.basename(t.altOut)}`);
|
||||
try {
|
||||
shot(t, t.altUrl, t.altOut);
|
||||
} catch (e) {
|
||||
console.error(`Error capturing ${t.altOut}:`, e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log("✅ All screenshots captured successfully!");
|
||||
Loading…
Add table
Add a link
Reference in a new issue