feat(ui): replace gameplay icons with local SVGs
This commit is contained in:
@@ -269,6 +269,31 @@ test("player assets are local, Russian, accessible, and responsive", () => {
|
||||
assert.match(icons, /id="maze"/);
|
||||
});
|
||||
|
||||
test("reference-derived SVG gameplay symbols preserve local yellow and blue ownership", () => {
|
||||
const icons = fs.readFileSync(path.join(project, "web/icons.svg"), "utf8");
|
||||
const script = fs.readFileSync(path.join(project, "web/player.js"), "utf8");
|
||||
const css = fs.readFileSync(path.join(project, "web/player.css"), "utf8");
|
||||
const html = fs.readFileSync(path.join(project, "web/index.html"), "utf8");
|
||||
const playerUi = fs.readFileSync(path.join(project, "docs/PLAYER_UI.md"), "utf8");
|
||||
for (const iconId of ["player", "key", "exit-closed", "crystal", "exit-open", "spikes"]) {
|
||||
assert.match(icons, new RegExp(`<symbol id="${iconId}" viewBox="0 0 64 64">`));
|
||||
}
|
||||
assert.doesNotMatch(icons, /<(?:image|foreignObject)\b/i);
|
||||
assert.doesNotMatch(icons, /data:image\//i);
|
||||
assert.match(script, /icon\(variant \? "exit-open" : "exit-closed", "object object-exit"\)/);
|
||||
assert.match(script, /icon\("crystal", "object object-vision"\)/);
|
||||
assert.match(script, /icon\("player", `pawn/);
|
||||
assert.match(html, /\/icons\.svg#spikes/);
|
||||
assert.match(css, /--p1: #ffd33d/);
|
||||
assert.match(css, /--p2: #41b6ff/);
|
||||
assert.match(css, /--warning: #ffad38/);
|
||||
assert.match(css, /--pause: #9b8cff/);
|
||||
assert.match(css, /\.pawn-owner-two \{ border-style: dashed; \}/);
|
||||
assert.match(html, /Жёлтый/);
|
||||
assert.match(html, /Синий/);
|
||||
assert.match(playerUi, /`player`, `key`, `exit-closed`,\n`crystal`, `exit-open`, and `spikes`/);
|
||||
});
|
||||
|
||||
test("observer view fits large screens and bounds zoom", () => {
|
||||
assert.equal(player.observerFitScale(1024, 600, 32, 32), 2.25);
|
||||
assert.equal(player.clampObserverZoom(.01), .25);
|
||||
|
||||
Reference in New Issue
Block a user