- 증강마다 48×48 SVG 아이콘(aug-icons/): 타일 색 = 종류(규칙·즉시·사용·승리 조건), 그림 = 증강. 선택 카드·사람 카드 칩·쓰기 버튼·승리 팝업·방 설정 목록·규칙 보기에 표시. 고양이가 된 증강은 회색 고양이. 모아 보기: apps/web/scripts/aug-icon-sheet.tsx - 새 증강 20개: 다시 던지기, 곱빼기, 올인, 저주 인형, 얼음!, 자석, 뒤로 돌아, 꼴찌의 반란, 텃세, 따라쟁이, 청개구리, 사냥꾼, 줍줍, 도장 깨기, 스타트 대시, 방공호, 벼락, 블랙홀, 로켓 발사, 최후의 일격 (규칙·컴퓨터·테스트·문서) - augOff 기본값 = 이 사이트 추가 증강 30개(방에서 [추가 증강 켜기]로 켬) - 카니발리즘: 내 말 잡기를 '잡기'로 세지 않음(ownCaptures) → 개돼지와 함께일 때 컴퓨터·시간 초과가 자기 말을 잡고 다시 던지기를 끝없이 반복하던 문제 수정 - 방 설정 탭이 방 정보 갱신으로 다시 그려질 때 [윷놀이 설정]으로 되돌아가던 문제 수정 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
37 lines
2.0 KiB
TypeScript
37 lines
2.0 KiB
TypeScript
/**
|
|
* Dev tool: renders every 증강 icon (big and small, light and dark background) to a PNG contact sheet.
|
|
* cd apps/web && bun scripts/aug-icon-sheet.tsx [out.png] [ids,comma,separated]
|
|
*/
|
|
import { renderToStaticMarkup } from 'react-dom/server';
|
|
import { chromium } from 'playwright-core';
|
|
import { AUGS, AUG_IDS, type AugId } from '@bg/games/yut/augments';
|
|
import { AugIcon, GLYPHS } from '../src/games/yut/aug-icons';
|
|
|
|
const out = process.argv[2] ?? `${process.env.HOME}/.tmp/aug-icons.png`;
|
|
const only = process.argv[3]?.split(',').filter(Boolean) as AugId[] | undefined;
|
|
const ids = only?.length ? only : [...AUG_IDS];
|
|
const cell = (id: AugId) => (
|
|
<div className="cell">
|
|
<AugIcon id={id} size={72} />
|
|
<div className="row">
|
|
<div className="light"><AugIcon id={id} size={20} /></div>
|
|
<div className="dark"><AugIcon id={id} size={20} /></div>
|
|
</div>
|
|
<div className={`name${GLYPHS[id] ? '' : ' missing'}`}>{AUGS[id].name}</div>
|
|
<div className="id">{id}</div>
|
|
</div>
|
|
);
|
|
const html = `<!doctype html><meta charset="utf-8"><style>
|
|
body{margin:0;padding:12px;font-family:sans-serif;background:#f3f4f6}
|
|
.grid{display:grid;grid-template-columns:repeat(10,112px);gap:8px}
|
|
.cell{display:flex;flex-direction:column;align-items:center;gap:4px;background:#fff;border-radius:8px;padding:6px}
|
|
.row{display:flex;gap:4px}.light{background:#fff;padding:3px;border:1px solid #ddd}.dark{background:#111827;padding:3px}
|
|
.name{font-size:11px;font-weight:700;text-align:center}.missing{color:#dc2626}.id{font-size:10px;color:#6b7280}
|
|
</style><div class="grid">${renderToStaticMarkup(<>{ids.map((id) => <div key={id}>{cell(id)}</div>)}</>)}</div>`;
|
|
const browser = await chromium.launch({ executablePath: process.env.CHROME ?? '/usr/bin/google-chrome', headless: true });
|
|
const page = await browser.newPage({ viewport: { width: 1240, height: 400 }, deviceScaleFactor: 1 });
|
|
await page.setContent(html);
|
|
await page.screenshot({ path: out, fullPage: true });
|
|
await browser.close();
|
|
console.log(out, ids.length, 'icons,', ids.filter((id) => !GLYPHS[id]).length, 'missing');
|