Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Update Slopus branding and icons

Bitti614ba649f935
diff --git a/README.md b/README.md
index a8c6d7d..40c2fc0 100644
--- a/README.md
+++ b/README.md
@@ -25,19 +25,18 @@ cd src-tauri && cargo test
## Application icons
-`src-tauri/icons/` is generated, not hand-drawn. The mark is the film ticket from
-the in-app logo -- blue plate, four perforations, and a single heavy white **S** --
-and it is rasterised at every size by `scripts/make-icons.mjs`, which writes the
-PNG/BMP/ICO/ICNS containers itself (no image toolchain required).
+`marketing/icon.png` is the source artwork for the application icon, browser
+favicon, and Project Library logo. `scripts/make-icons.mjs` uses the installed
+Tauri CLI to generate the desktop PNG, ICO, and ICNS files in `src-tauri/icons/`.
```sh
npm run icons # rewrite every file listed in bundle.icon
-node scripts/make-icons.mjs --check # decode the files back and print them as ASCII
+node scripts/make-icons.mjs --check # verify packaged icons against the source artwork
```
-Edit the geometry at the top of the script and re-run to re-tune the mark. Use
-`--check` to confirm the letter is still legible at 16px; full wordmarks become
-an illegible smudge at application-icon sizes.
+Replace the square, transparent `marketing/icon.png` and run `npm run icons` to
+update the packaged artwork. Intermediate platform assets are generated under
+the ignored `artifacts/generated-icons/` folder.
## Project folders
diff --git a/index.html b/index.html
index edbbf11..6343448 100644
--- a/index.html
+++ b/index.html
@@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <link rel="icon" type="image/png" href="/marketing/icon.png" />
<meta name="theme-color" content="#080a0f" />
<meta name="description" content="Slopus — an agentic video creation workspace." />
<title>Slopus - 0.1.0</title>
diff --git a/marketing/icon.png b/marketing/icon.png
new file mode 100644
index 0000000..7c57ff2
--- /dev/null
+++ b/marketing/icon.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6481f6155e2448a1800f88cb92933537e361293229744a1e1e471972deaf5bf3
+size 321269
diff --git a/marketing/logo.png b/marketing/logo.png
deleted file mode 100644
index cd2c1c8..0000000
--- a/marketing/logo.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:4e72a5029460466f2cffb781cbff44e9f413f50e2e83665b3a3bc65e491f6f59
-size 1149198
diff --git a/scripts/make-icons.mjs b/scripts/make-icons.mjs
index f490f32..6d88691 100644
--- a/scripts/make-icons.mjs
+++ b/scripts/make-icons.mjs
@@ -1,478 +1,55 @@
#!/usr/bin/env node
-/**
- * Generates the Slopus application icons into src-tauri/icons/.
- *
- * node scripts/make-icons.mjs # write the icons
- * node scripts/make-icons.mjs --check # decode what is on disk and print it as ASCII
- *
- * There is no image toolchain in this repo (no ImageMagick, no canvas), so the
- * bitmaps are rasterised here by hand and encoded straight into PNG/BMP/ICO/ICNS
- * containers. Keeping the icons generated rather than checked in as opaque blobs
- * is the point: the mark can be re-tuned by editing the geometry below and
- * re-running, and `--check` decodes the real files back so a regression is
- * visible in the terminal instead of only in a taskbar.
- *
- * The mark is the film ticket from the in-app logo (src/components/SlopusLogo.tsx):
- * a flat blue plate with a column of four perforations punched clean through it
- * and a heavy white letter. Every size carries a single "S" — "Slop" is four letters in
- * the space that fits one, and at 16px it was an illegible smudge.
- *
- * The perforations are transparent, not white, at every size. They are 2x2 at
- * 16px and grow from there, always with at least 2px of plate to their left, so
- * a hole reads as a hole rather than as a nibbled edge; and the whole point of
- * the mark is that light passes through the film.
+/** Generate desktop icons from the shared marketing artwork.
+ * npm run icons writes the packaged icons
+ * npm run icons -- --check verifies packaged icons against fresh output
+ * Tauri's intermediate platform assets stay in the ignored artifacts folder.
*/
-
-import { deflateSync, inflateSync } from "node:zlib";
+import { run } from "@tauri-apps/cli";
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
-const ICONS_DIR = join(dirname(fileURLToPath(import.meta.url)), "..", "src-tauri", "icons");
-
-/* ---------------------------------------------------------------- geometry */
-
-/** Stable brand blue shared with .slopus-logo__ticket. */
-const PLATE_COLOR = [0x3f, 0x64, 0xd9];
-
-/**
- * Layout for one canvas size, in pixel units.
- *
- * Small canvases are snapped to whole pixels: a 2px-wide perforation that
- * starts at x=1.84 is two columns of grey, and grey is how "Slop" became a
- * smudge in the first place.
- */
-function layout(size) {
- const r = Math.round;
-
- // Full-bleed at icon sizes, a hair of inset once there are pixels to spare.
- const margin = size >= 48 ? r(size * 0.04) : 0;
- const D = size - 2 * margin;
- const plate = { x0: margin, y0: margin, x1: margin + D, y1: margin + D, r: D * 0.2 };
-
- // The letter, in heavy grotesque proportions keyed off its cap height.
- const Sh = r(D * 0.72);
- const t = Math.max(1, r(Sh * 0.18));
- const Sw = r(Sh * 0.66);
-
- // Four perforations down the left, wider than tall like the CSS ones, and
- // spanning the same height as the letter beside them.
- const perfH = Math.max(1, r(Sh * 0.17));
- const perfGap = Math.max(1, r(Sh * 0.09));
- const perfW = Math.max(1, r(perfH * 1.1));
- const perfSpan = 4 * perfH + 3 * perfGap;
-
- // Perforations + letter are one group, centred in the plate as a unit; a
- // letter centred on its own leaves the mark visibly shoved to the right.
- const inner = Math.max(1, r(D * 0.1));
- const gx = margin + r((D - (perfW + inner + Sw)) / 2);
- const cy = margin + D / 2;
-
- // Every edge but the plate's corners and the bowl's curve lands on a pixel
- // boundary. A 2px-wide perforation that starts at x=1.84 is two columns of
- // grey, and grey is how "Slop" became a smudge in the first place.
- return {
- size,
- margin,
- D,
- plate,
- perf: { x: gx, y: r(cy - perfSpan / 2), w: perfW, h: perfH, gap: perfGap, r: perfW >= 5 ? 1 : 0 },
- s: { x: gx + perfW + inner, y: r(cy - Sh / 2), w: Sw, h: Sh, t },
- };
-}
-
-/** Inside-test for a rectangle with per-corner radii. */
-function inRoundRect(x, y, x0, y0, x1, y1, rtl, rtr, rbr, rbl) {
- if (x < x0 || x > x1 || y < y0 || y > y1) return false;
- const corner = (cx, cy, r) => {
- if (r <= 0) return true;
- const dx = x - cx;
- const dy = y - cy;
- return dx * dx + dy * dy <= r * r;
- };
- if (x < x0 + rtl && y < y0 + rtl) return corner(x0 + rtl, y0 + rtl, rtl);
- if (x > x1 - rtr && y < y0 + rtr) return corner(x1 - rtr, y0 + rtr, rtr);
- if (x > x1 - rbr && y > y1 - rbr) return corner(x1 - rbr, y1 - rbr, rbr);
- if (x < x0 + rbl && y > y1 - rbl) return corner(x0 + rbl, y1 - rbl, rbl);
- return true;
-}
-
-function inPlate(L, x, y) {
- const { x0, y0, x1, y1, r } = L.plate;
- return inRoundRect(x, y, x0, y0, x1, y1, r, r, r, r);
-}
-
-/**
- * The four perforations. These are holes, not ink: the plate is punched out
- * there and the alpha channel carries it, so whatever the icon sits on shows
- * through — the same thing the in-app logo's mask does.
- */
-function inPerf(L, x, y) {
- const { perf } = L;
- for (let i = 0; i < 4; i++) {
- const y0 = perf.y + i * (perf.h + perf.gap);
- if (inRoundRect(x, y, perf.x, y0, perf.x + perf.w, y0 + perf.h, perf.r, perf.r, perf.r, perf.r)) return true;
- }
- return false;
-}
-
-/** The white ink: a heavy geometric letter S. */
-function inLetter(L, x, y) {
- const { s } = L;
- const mid = s.y + s.h / 2;
- const radius = s.t / 2;
- const bar = (y0) => inRoundRect(x, y, s.x, y0, s.x + s.w, y0 + s.t,
- radius, radius, radius, radius);
- if (bar(s.y) || bar(mid - s.t / 2) || bar(s.y + s.h - s.t)) return true;
- if (inRoundRect(x, y, s.x, s.y, s.x + s.t, mid, radius, radius, radius, radius)) return true;
- return inRoundRect(x, y, s.x + s.w - s.t, mid, s.x + s.w, s.y + s.h,
- radius, radius, radius, radius);
-}
-
-const SS = 8; // supersampling factor per axis (64 samples/pixel)
-
-/** Rasterise one square canvas to RGBA bytes. */
-function render(size) {
- const L = layout(size);
- const out = Buffer.alloc(size * size * 4);
- for (let py = 0; py < size; py++) {
- for (let px = 0; px < size; px++) {
- let solid = 0;
- let ink = 0;
- for (let sy = 0; sy < SS; sy++) {
- for (let sx = 0; sx < SS; sx++) {
- const x = px + (sx + 0.5) / SS;
- const y = py + (sy + 0.5) / SS;
- if (!inPlate(L, x, y)) continue;
- if (inPerf(L, x, y)) continue; // punched out: contributes to neither
- solid++;
- if (inLetter(L, x, y)) ink++;
- }
- }
- const n = SS * SS;
- const i = (py * size + px) * 4;
- if (solid === 0) continue; // outside the plate, or entirely inside a hole
- const a = solid / n;
- const inkShare = ink / solid;
- for (let j = 0; j < 3; j++) out[i + j] = Math.round(PLATE_COLOR[j] + (255 - PLATE_COLOR[j]) * inkShare);
- out[i + 3] = Math.round(a * 255);
- }
- }
- return out;
-}
-
-/* -------------------------------------------------------------------- PNG */
-
-const CRC_TABLE = (() => {
- const t = new Int32Array(256);
- for (let n = 0; n < 256; n++) {
- let c = n;
- for (let k = 0; k < 8; k++) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
- t[n] = c;
- }
- return t;
-})();
-
-function crc32(buf) {
- let c = -1;
- for (let i = 0; i < buf.length; i++) c = CRC_TABLE[(c ^ buf[i]) & 0xff] ^ (c >>> 8);
- return (c ^ -1) >>> 0;
-}
-
-function chunk(type, data) {
- const len = Buffer.alloc(4);
- len.writeUInt32BE(data.length);
- const body = Buffer.concat([Buffer.from(type, "ascii"), data]);
- const crc = Buffer.alloc(4);
- crc.writeUInt32BE(crc32(body));
- return Buffer.concat([len, body, crc]);
-}
-
-function encodePNG(size, rgba) {
- const ihdr = Buffer.alloc(13);
- ihdr.writeUInt32BE(size, 0);
- ihdr.writeUInt32BE(size, 4);
- ihdr[8] = 8; // bit depth
- ihdr[9] = 6; // RGBA
- const raw = Buffer.alloc(size * (size * 4 + 1));
- for (let y = 0; y < size; y++) {
- raw[y * (size * 4 + 1)] = 0; // filter: none
- rgba.copy(raw, y * (size * 4 + 1) + 1, y * size * 4, (y + 1) * size * 4);
- }
- return Buffer.concat([
- Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]),
- chunk("IHDR", ihdr),
- chunk("IDAT", deflateSync(raw, { level: 9 })),
- chunk("IEND", Buffer.alloc(0)),
- ]);
-}
-
-/** Minimal decoder for the PNGs this script writes (8-bit RGBA, all filters). */
-function decodePNG(buf) {
- let off = 8;
- let width = 0;
- let height = 0;
- const idat = [];
- while (off < buf.length) {
- const len = buf.readUInt32BE(off);
- const type = buf.toString("ascii", off + 4, off + 8);
- const data = buf.subarray(off + 8, off + 8 + len);
- const stored = buf.readUInt32BE(off + 8 + len);
- if (crc32(buf.subarray(off + 4, off + 8 + len)) !== stored) throw new Error(`bad CRC on ${type}`);
- if (type === "IHDR") {
- width = data.readUInt32BE(0);
- height = data.readUInt32BE(4);
- if (data[8] !== 8 || data[9] !== 6) throw new Error("expected 8-bit RGBA");
- } else if (type === "IDAT") idat.push(data);
- else if (type === "IEND") break;
- off += 12 + len;
- }
- const raw = inflateSync(Buffer.concat(idat));
- const stride = width * 4;
- const out = Buffer.alloc(height * stride);
- for (let y = 0; y < height; y++) {
- const filter = raw[y * (stride + 1)];
- const line = raw.subarray(y * (stride + 1) + 1, (y + 1) * (stride + 1));
- for (let x = 0; x < stride; x++) {
- const a = x >= 4 ? out[y * stride + x - 4] : 0;
- const b = y > 0 ? out[(y - 1) * stride + x] : 0;
- const c = x >= 4 && y > 0 ? out[(y - 1) * stride + x - 4] : 0;
- let v = line[x];
- if (filter === 1) v += a;
- else if (filter === 2) v += b;
- else if (filter === 3) v += (a + b) >> 1;
- else if (filter === 4) {
- const p = a + b - c;
- const pa = Math.abs(p - a);
- const pb = Math.abs(p - b);
- const pc = Math.abs(p - c);
- v += pa <= pb && pa <= pc ? a : pb <= pc ? b : c;
- }
- out[y * stride + x] = v & 0xff;
- }
- }
- return { width, height, rgba: out };
-}
-
-/* -------------------------------------------------------------------- BMP */
-
-/** ICO-flavoured DIB: BITMAPINFOHEADER, bottom-up BGRA, then the 1bpp AND mask. */
-function encodeDIB(size, rgba) {
- const header = Buffer.alloc(40);
- header.writeUInt32LE(40, 0);
- header.writeInt32LE(size, 4);
- header.writeInt32LE(size * 2, 8); // XOR + AND
- header.writeUInt16LE(1, 12);
- header.writeUInt16LE(32, 14);
- const xor = Buffer.alloc(size * size * 4);
- const maskStride = Math.ceil(size / 32) * 4;
- const mask = Buffer.alloc(maskStride * size);
- for (let y = 0; y < size; y++) {
- const src = y * size * 4;
- const dst = (size - 1 - y) * size * 4;
- for (let x = 0; x < size; x++) {
- xor[dst + x * 4 + 0] = rgba[src + x * 4 + 2];
- xor[dst + x * 4 + 1] = rgba[src + x * 4 + 1];
- xor[dst + x * 4 + 2] = rgba[src + x * 4 + 0];
- xor[dst + x * 4 + 3] = rgba[src + x * 4 + 3];
- if (rgba[src + x * 4 + 3] < 128) mask[(size - 1 - y) * maskStride + (x >> 3)] |= 0x80 >> (x & 7);
+const root = join(dirname(fileURLToPath(import.meta.url)), "..");
+const source = join(root, "marketing", "icon.png");
+const output = join(root, "artifacts", "generated-icons");
+const target = join(root, "src-tauri", "icons");
+const config = JSON.parse(readFileSync(join(root, "src-tauri", "tauri.conf.json"), "utf8"));
+
+// Tauri emits ICNS entries from a map whose iteration order varies by run.
+// Sorting the entries keeps packaged files and verification reproducible.
+function canonicalIcon(name, bytes) {
+ if (!name.endsWith(".icns")) return bytes;
+ if (bytes.toString("ascii", 0, 4) !== "icns" || bytes.readUInt32BE(4) !== bytes.length) {
+ throw new Error(`Invalid ICNS header: ${name}`);
+ }
+ const entries = [];
+ for (let offset = 8; offset < bytes.length;) {
+ const size = bytes.readUInt32BE(offset + 4);
+ if (size < 8 || offset + size > bytes.length) throw new Error(`Invalid ICNS entry: ${name}`);
+ entries.push(bytes.subarray(offset, offset + size));
+ offset += size;
+ }
+ entries.sort((a, b) => Buffer.compare(a.subarray(0, 4), b.subarray(0, 4)));
+ return Buffer.concat([bytes.subarray(0, 8), ...entries]);
+}
+
+mkdirSync(output, { recursive: true });
+await run(["icon", source, "--output", output], "slopus-icons");
+
+const check = process.argv.includes("--check");
+mkdirSync(target, { recursive: true });
+for (const icon of config.bundle.icon) {
+ const name = icon.replace(/^icons\//, "");
+ const generated = join(output, name);
+ const packaged = join(target, name);
+ const bytes = canonicalIcon(name, readFileSync(generated));
+ if (check) {
+ if (!bytes.equals(canonicalIcon(name, readFileSync(packaged)))) {
+ throw new Error(`${icon} differs from marketing/icon.png; run npm run icons.`);
}
+ console.log(`Verified ${icon}`);
+ } else {
+ writeFileSync(packaged, bytes);
+ console.log(`Updated ${icon}`);
}
- header.writeUInt32LE(xor.length + mask.length, 20);
- return Buffer.concat([header, xor, mask]);
}
-
-function decodeDIB(buf) {
- const width = buf.readInt32LE(4);
- const height = buf.readInt32LE(8) / 2;
- const bpp = buf.readUInt16LE(14);
- if (bpp !== 32) throw new Error(`expected 32bpp DIB, got ${bpp}`);
- const rgba = Buffer.alloc(width * height * 4);
- for (let y = 0; y < height; y++) {
- const src = 40 + (height - 1 - y) * width * 4;
- for (let x = 0; x < width; x++) {
- rgba[(y * width + x) * 4 + 0] = buf[src + x * 4 + 2];
- rgba[(y * width + x) * 4 + 1] = buf[src + x * 4 + 1];
- rgba[(y * width + x) * 4 + 2] = buf[src + x * 4 + 0];
- rgba[(y * width + x) * 4 + 3] = buf[src + x * 4 + 3];
- }
- }
- return { width, height, rgba };
-}
-
-/* -------------------------------------------------------------- ICO / ICNS */
-
-/**
- * Vista and later read PNG entries at any size, but classic DIB entries are what
- * every shell has always understood, so the small sizes stay DIB and only the
- * two big ones use PNG (a 256x256 DIB alone is 270KB).
- */
-function buildICO(images) {
- const entries = images.map(({ size, rgba }) => ({
- size,
- data: size >= 128 ? encodePNG(size, rgba) : encodeDIB(size, rgba),
- }));
- const dir = Buffer.alloc(6 + entries.length * 16);
- dir.writeUInt16LE(0, 0);
- dir.writeUInt16LE(1, 2);
- dir.writeUInt16LE(entries.length, 4);
- let offset = dir.length;
- entries.forEach((entry, i) => {
- const o = 6 + i * 16;
- dir[o] = entry.size >= 256 ? 0 : entry.size;
- dir[o + 1] = entry.size >= 256 ? 0 : entry.size;
- dir.writeUInt16LE(1, o + 4);
- dir.writeUInt16LE(32, o + 6);
- dir.writeUInt32LE(entry.data.length, o + 8);
- dir.writeUInt32LE(offset, o + 12);
- offset += entry.data.length;
- });
- return Buffer.concat([dir, ...entries.map((e) => e.data)]);
-}
-
-const ICNS_TYPES = { 16: "icp4", 32: "icp5", 128: "ic07", 256: "ic08", 512: "ic09" };
-
-function buildICNS(images) {
- const parts = [];
- for (const { size, rgba } of images) {
- const type = ICNS_TYPES[size];
- if (!type) continue;
- const png = encodePNG(size, rgba);
- const head = Buffer.alloc(8);
- head.write(type, 0, "ascii");
- head.writeUInt32BE(png.length + 8, 4);
- parts.push(head, png);
- }
- const body = Buffer.concat(parts);
- const head = Buffer.alloc(8);
- head.write("icns", 0, "ascii");
- head.writeUInt32BE(body.length + 8, 4);
- return Buffer.concat([head, body]);
-}
-
-/* ------------------------------------------------------------------ ASCII */
-
-const RAMP = ".:-=+*#%@";
-
-/** Prints a decoded image as ASCII, ramped on the red channel: the plate is
- * blue and the ink is white (r = 0xff), so red distinguishes the ink.
- * A blank is transparent — outside the plate, or one of the four perforations
- * punched through it, which is why the holes show as gaps in the column. */
-function ascii({ width, height, rgba }) {
- const lines = [];
- for (let y = 0; y < height; y++) {
- let line = "";
- for (let x = 0; x < width; x++) {
- const i = (y * width + x) * 4;
- const a = rgba[i + 3];
- if (a < 40) {
- line += " ";
- continue;
- }
- const ink = Math.max(0, Math.min(1, (rgba[i] - PLATE_COLOR[0]) / (0xff - PLATE_COLOR[0])));
- line += RAMP[Math.min(RAMP.length - 1, Math.round(ink * (RAMP.length - 1)))];
- }
- lines.push(line);
- }
- return lines.join("\n");
-}
-
-/**
- * The alpha actually stored in a decoded image, at the centre of each
- * perforation and, for contrast, at the centre of the plate. Reading the
- * generator proves nothing about the bytes on disk; these numbers do. Holes
- * must read 0 and the plate 255.
- */
-function alphaProbe({ width, rgba }) {
- const L = layout(width);
- const at = (x, y) => rgba[(Math.floor(y) * width + Math.floor(x)) * 4 + 3];
- const holes = [];
- for (let i = 0; i < 4; i++) {
- const cy = L.perf.y + i * (L.perf.h + L.perf.gap) + L.perf.h / 2;
- holes.push(at(L.perf.x + L.perf.w / 2, cy));
- }
- return `alpha: holes [${holes.join(", ")}], plate ${at(L.plate.x0 + L.D / 2, L.plate.y0 + L.D / 2)}`;
-}
-
-function parseICO(buf) {
- if (buf.readUInt16LE(0) !== 0 || buf.readUInt16LE(2) !== 1) throw new Error("not an ICO");
- const count = buf.readUInt16LE(4);
- const out = [];
- for (let i = 0; i < count; i++) {
- const o = 6 + i * 16;
- const declared = buf[o] || 256;
- const len = buf.readUInt32LE(o + 8);
- const off = buf.readUInt32LE(o + 12);
- const data = buf.subarray(off, off + len);
- const isPNG = data.readUInt32BE(0) === 0x89504e47;
- const img = isPNG ? decodePNG(data) : decodeDIB(data);
- if (img.width !== declared || img.height !== declared) throw new Error(`entry ${declared} decodes to ${img.width}x${img.height}`);
- out.push({ declared, kind: isPNG ? "PNG" : "BMP", bytes: len, ...img });
- }
- return out;
-}
-
-/* ------------------------------------------------------------------- main */
-
-const SIZES = [16, 24, 32, 48, 64, 128, 256, 512];
-const PNG_FILES = { 32: "32x32.png", 128: "128x128.png", 256: "[email protected]", 512: "icon.png" };
-
-function parseICNS(buf) {
- if (buf.toString("ascii", 0, 4) !== "icns") throw new Error("not an ICNS");
- if (buf.readUInt32BE(4) !== buf.length) throw new Error("ICNS length header disagrees with the file");
- const out = [];
- let off = 8;
- while (off < buf.length) {
- const type = buf.toString("ascii", off, off + 4);
- const len = buf.readUInt32BE(off + 4);
- if (len < 8 || off + len > buf.length) throw new Error(`bad ICNS entry ${type}`);
- const img = decodePNG(buf.subarray(off + 8, off + len));
- out.push(`${type}=${img.width}x${img.height}`);
- off += len;
- }
- return out;
-}
-
-/**
- * Decodes what is actually on disk and prints it. The point is to look at the
- * icon rather than trust the generator: the old wordmark icon survived a whole
- * round of "fixing the logo" because nobody parsed the ICO back.
- */
-function check() {
- const entries = parseICO(readFileSync(join(ICONS_DIR, "icon.ico")));
- console.log(`icon.ico entries: ${entries.map((e) => e.declared).join(",")}`);
- for (const e of entries) {
- console.log(`\n--- ${e.declared}x${e.declared} (${e.kind}, ${e.bytes} bytes) — ${alphaProbe(e)} ---`);
- console.log(ascii(e));
- }
- console.log(`\nicon.icns: ${parseICNS(readFileSync(join(ICONS_DIR, "icon.icns"))).join(" ")}`);
- for (const [size, name] of Object.entries(PNG_FILES)) {
- const img = decodePNG(readFileSync(join(ICONS_DIR, name)));
- if (img.width !== Number(size) || img.height !== Number(size)) throw new Error(`${name} is ${img.width}x${img.height}`);
- console.log(`${name}: ${img.width}x${img.height} RGBA — ${alphaProbe(img)}`);
- }
-}
-
-function main() {
- if (process.argv.includes("--check")) {
- check();
- return;
- }
-
- mkdirSync(ICONS_DIR, { recursive: true });
- const images = SIZES.map((size) => ({ size, rgba: render(size) }));
- const written = [];
- const write = (name, data) => {
- writeFileSync(join(ICONS_DIR, name), data);
- written.push(`${name} (${data.length} bytes)`);
- };
-
- write("icon.ico", buildICO(images.filter((i) => i.size <= 256)));
- write("icon.icns", buildICNS(images));
- for (const { size, rgba } of images) {
- if (PNG_FILES[size]) write(PNG_FILES[size], encodePNG(size, rgba));
- }
- console.log(written.join("\n"));
-}
-
-main();
diff --git a/src-tauri/icons/128x128.png b/src-tauri/icons/128x128.png
index cae9100..ba9d252 100644
--- a/src-tauri/icons/128x128.png
+++ b/src-tauri/icons/128x128.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:302a6fdd8e3c206b03a096c36ec8e569a2186f73b170fdc5d6d6e762f66d9526
-size 1010
+oid sha256:c9ccf56f896322f4d180fb0beb23ccc3efc8865646da8076ae66a9c0f45ae9ae
+size 18287
diff --git a/src-tauri/icons/[email protected] b/src-tauri/icons/[email protected]
index 3ce8e1c..818a694 100644
--- a/src-tauri/icons/[email protected]
+++ b/src-tauri/icons/[email protected]
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:56e161ebfe3011e6533bcb842ef3744a2559f279f89c9efd26981da46e87e4df
-size 2729
+oid sha256:ffcecad8bba7c6dfdf52db09b7df38661c909a751504e2ff5b0f99527e885501
+size 54415
diff --git a/src-tauri/icons/32x32.png b/src-tauri/icons/32x32.png
index 52927e7..33681f5 100644
--- a/src-tauri/icons/32x32.png
+++ b/src-tauri/icons/32x32.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:24e5133c48976667891557b594fb5aa9abde8b482ac56e5706c70529a00eb77b
-size 305
+oid sha256:94a69462f60d25f440e6768d99f33b38d63502d879d36d89c2e3859ea7f18d3a
+size 2443
diff --git a/src-tauri/icons/icon.icns b/src-tauri/icons/icon.icns
index 89caa38..1588709 100644
--- a/src-tauri/icons/icon.icns
+++ b/src-tauri/icons/icon.icns
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:5775584702843d22662853564d2c4fbe0c2accadb3403fffdbdb3a75b3a25a7a
-size 11429
+oid sha256:18672ec3f7cc1796b9cfdb62032e492139effb4ec97ec867e033ab6142fe4646
+size 1254202
diff --git a/src-tauri/icons/icon.ico b/src-tauri/icons/icon.ico
index 6c03aa6..fe722f3 100644
--- a/src-tauri/icons/icon.ico
+++ b/src-tauri/icons/icon.ico
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:05c748f6e00f3e90e02ca4292fe19f3290451e9b8888be59b799aab47d4d9ba8
-size 38265
+oid sha256:cc691b16200c7891f9283dbcb38eae4683acd0a2ba6da42a638bfb97b0ea4297
+size 73296
diff --git a/src-tauri/icons/icon.png b/src-tauri/icons/icon.png
index 3499650..2ba88f0 100644
--- a/src-tauri/icons/icon.png
+++ b/src-tauri/icons/icon.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:9fdc016f79f9e1800395c0b99d2fe596490edc33a6fbbe745b8ca481ada19ae1
-size 7160
+oid sha256:07ba623214c8d7a74eae747f84464df8e0c2b019ea25db56f61e3294fe2f41d4
+size 203280
diff --git a/src/App.test.tsx b/src/App.test.tsx
index afd607c..95c0354 100644
--- a/src/App.test.tsx
+++ b/src/App.test.tsx
@@ -81,10 +81,12 @@ describe("project library controls", () => {
it("focuses search with Ctrl/Cmd+K and switches between grid and list", async () => {
const { container } = render(<App />);
await screen.findByText("Northern Light — Brand Film");
- expect(container.querySelector(".brand .slopus-logo")).not.toBeNull();
- expect(container.querySelector(".brand .slopus-logo__monogram")?.textContent).toBe("Slop");
- expect(container.querySelector(".brand .slopus-logo__wordmark")?.textContent).toBe("us");
- expect(container.querySelector(".brand img")).toBeNull();
+ expect(container.querySelector(".brand__wordmark")?.textContent).toBe("Slopus");
+ expect(container.querySelector(".brand__edition")?.textContent).toBe("ALPHA");
+ expect(container.querySelector(".brand .slopus-logo__ticket")).toBeNull();
+ const icon = container.querySelector(".brand img");
+ expect(icon?.getAttribute("src")).toContain("marketing/icon.png");
+ expect(icon?.nextElementSibling?.textContent).toBe("Slopus");
const search = screen.getByRole("textbox", { name: "Search projects" });
fireEvent.keyDown(window, { key: "k", ctrlKey: true });
diff --git a/src/components/Brand.tsx b/src/components/Brand.tsx
index 7400aa9..8bc0267 100644
--- a/src/components/Brand.tsx
+++ b/src/components/Brand.tsx
@@ -4,7 +4,8 @@ export function Brand({ compact = false }: { compact?: boolean }) {
return (
<div className={compact ? "brand brand--compact" : "brand"} role="img" aria-label="Slopus">
<SlopusLogo compact={compact} decorative />
- {!compact && <span className="brand__edition">BETA</span>}
+ {!compact && <span className="brand__wordmark">Slopus</span>}
+ {!compact && <span className="brand__edition">ALPHA</span>}
</div>
);
}
diff --git a/src/components/SlopusLogo.tsx b/src/components/SlopusLogo.tsx
index 0ccfb52..273502b 100644
--- a/src/components/SlopusLogo.tsx
+++ b/src/components/SlopusLogo.tsx
@@ -1,3 +1,5 @@
+import icon from "../../marketing/icon.png";
+
interface SlopusLogoProps {
compact?: boolean;
decorative?: boolean;
@@ -6,25 +8,5 @@ interface SlopusLogoProps {
export function SlopusLogo({ compact = false, decorative = false, className = "" }: SlopusLogoProps) {
const classes = ["slopus-logo", compact ? "slopus-logo--compact" : "", className].filter(Boolean).join(" ");
-
- return (
- <span
- className={classes}
- role={decorative ? undefined : "img"}
- aria-label={decorative ? undefined : "Slopus"}
- aria-hidden={decorative || undefined}
- >
- <span className="slopus-logo__ticket">
- {/* The perforations are punched out of the plate by a mask, so they are
- real holes and the page shows through them. These four <i> are the
- strip they occupy in the row, and the black fallback squares for a
- browser that cannot composite the mask. See .slopus-logo* in shell.css. */}
- <span className="slopus-logo__perforations" aria-hidden="true"><i /><i /><i /><i /></span>
- {/* The full lockup keeps “Slop” inside the film badge. The compact
- application mark uses one letter so it remains legible at icon size. */}
- <span className="slopus-logo__monogram">{compact ? "S" : "Slop"}</span>
- </span>
- {!compact && <span className="slopus-logo__wordmark">us</span>}
- </span>
- );
+ return <img className={classes} src={icon} alt={decorative ? "" : "Slopus"} aria-hidden={decorative || undefined} />;
}
diff --git a/src/lib/theme.test.ts b/src/lib/theme.test.ts
index ae06bd7..98ae45d 100644
--- a/src/lib/theme.test.ts
+++ b/src/lib/theme.test.ts
@@ -434,20 +434,6 @@ function ruleBlocks(css: string): { selector: string; body: string }[] {
/** Rule → why that rule is allowed to name a colour. Keyed by file name. */
const LITERALS_ALLOWED: Record<string, Record<string, string>> = {
- "shell.css": {
- /* Found by widening the regex to `%23`, not by reading the file: this had
- been sitting in the sheet the whole time, invisible because it is spelled
- percent-encoded inside a data URI. It is legitimate — a mask image is
- read for its ALPHA, so `fill='%23000'` means "opaque here" and nothing is
- ever painted this colour — but it was legitimate by luck rather than by
- anyone's decision, which is the state the allowlist exists to end. */
- ".slopus-logo":
- "brand mark: its fixed flat blue is shared with packaged icons; the data-URI black only supplies mask alpha",
- ".slopus-logo__ticket":
- "brand mark: the Slopus ticket is one artwork, blue plate and white letter, in both themes",
- ".slopus-logo__perforations i":
- "fallback perforations: painted black because a hole reads as a hole on any backdrop",
- },
"library.css": {
/* library.css says all of this in prose above the rules; the point of
repeating it here is that the guard knows, not that a reader does. */
diff --git a/src/styles/shell.css b/src/styles/shell.css
index 4559460..c4d0664 100644
--- a/src/styles/shell.css
+++ b/src/styles/shell.css
@@ -19,7 +19,7 @@
padding: 0 var(--space-2);
}
-/* Icon-only lockup for narrow rails: the ticket mark, centred, no edition tag. */
+/* Icon-only lockup for narrow rails, centred with no edition tag. */
.brand--compact {
gap: 0;
padding: 0;
@@ -35,125 +35,7 @@
padding: var(--space-1) var(--space-2);
}
-/* --- Logo mark (decorative artwork — proportions preserved) ----------------- */
-
-/* A flat film badge and wordmark. The badge uses one stable brand blue in every
- theme and at every size; its silhouette and punched perforations provide the
- visual character without gradients, highlights, or shadows. */
-.slopus-logo {
- /* Perforation geometry, in one place. The strip in the flex row
- (.slopus-logo__perforations) and the mask that punches the holes out of the
- plate (.slopus-logo__ticket::before) both read these, so the holes and the
- space reserved for them cannot drift apart. */
- --slopus-ticket-h: 28px;
- --slopus-perf-x: 3px;
- --slopus-perf-w: 4px;
- --slopus-perf-strip: 5px; /* the hole plus 1px of plate to its right */
- --slopus-perf-h: 3px;
- --slopus-perf-gap: 1px;
- --slopus-perf-span: calc(4 * var(--slopus-perf-h) + 3 * var(--slopus-perf-gap));
- --slopus-perf-y: calc((var(--slopus-ticket-h) - var(--slopus-perf-span)) / 2);
- --slopus-logo-blue: #3f64d9;
- /* One hole: a 4x3 rounded rect, used as a mask layer so a punched hole has
- the same soft corners the fallback rectangles carry. */
- --slopus-perf-hole: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 3'%3E%3Crect width='4' height='3' rx='1' fill='%23000'/%3E%3C/svg%3E");
-
- height: 36px;
- flex: 0 0 auto;
- display: inline-flex;
- align-items: center;
- overflow: hidden;
- padding: 4px 3px;
- color: var(--text-primary);
- background: transparent;
- white-space: nowrap;
-}
-
-/* The plate lives on ::before so the perforations can be punched out without
- masking the white monogram. */
-.slopus-logo__ticket {
- position: relative;
- z-index: 1;
- height: var(--slopus-ticket-h);
- flex: 0 0 auto;
- padding-right: 3px;
- display: flex;
- align-items: center;
- border-radius: 7px;
- color: #fff;
- background: transparent;
-}
-
-/* The plate is a separate layer so its mask does not also eat the monogram. */
-.slopus-logo__ticket::before {
- content: "";
- position: absolute;
- z-index: 0;
- inset: 0;
- border-radius: inherit;
- background: var(--slopus-logo-blue);
-}
-
-/* Positioned above the plate, so the fallback squares below are not painted
- underneath it and lost. */
-.slopus-logo__perforations {
- position: relative;
- z-index: 2;
- width: var(--slopus-perf-strip);
- height: var(--slopus-perf-span);
- margin-left: var(--slopus-perf-x);
- display: grid;
- grid-template-rows: repeat(4, var(--slopus-perf-h));
- gap: var(--slopus-perf-gap);
-}
-
-/* Fallback only: where the plate cannot be masked the holes are painted black,
- which still reads as a hole on any backdrop, light theme or dark. */
-.slopus-logo__perforations i {
- width: var(--slopus-perf-w);
- height: var(--slopus-perf-h);
- display: block;
- border-radius: 1px;
- background: #000;
-}
-
-/* Real holes: five mask layers — the plate, minus the four perforations — so
- whatever is behind the logo shows through them. mask-composite is the whole
- trick, hence the @supports: without it the layers would union into a solid
- mask and the perforations would vanish, so the black squares above stay. */
-@supports (mask-composite: exclude) {
- .slopus-logo__ticket::before {
- mask-image: var(--slopus-perf-hole), var(--slopus-perf-hole), var(--slopus-perf-hole), var(--slopus-perf-hole),
- linear-gradient(currentColor 0 0);
- mask-repeat: no-repeat;
- mask-size: var(--slopus-perf-w) var(--slopus-perf-h), var(--slopus-perf-w) var(--slopus-perf-h),
- var(--slopus-perf-w) var(--slopus-perf-h), var(--slopus-perf-w) var(--slopus-perf-h), 100% 100%;
- mask-position: var(--slopus-perf-x) var(--slopus-perf-y),
- var(--slopus-perf-x) calc(var(--slopus-perf-y) + 1 * (var(--slopus-perf-h) + var(--slopus-perf-gap))),
- var(--slopus-perf-x) calc(var(--slopus-perf-y) + 2 * (var(--slopus-perf-h) + var(--slopus-perf-gap))),
- var(--slopus-perf-x) calc(var(--slopus-perf-y) + 3 * (var(--slopus-perf-h) + var(--slopus-perf-gap))), 0 0;
- mask-composite: exclude;
- }
-
- .slopus-logo__perforations i {
- background: transparent;
- }
-}
-
-.slopus-logo__monogram {
- position: relative;
- z-index: 2;
- margin-left: 3px;
- font-size: var(--text-lg);
- font-weight: 800;
- line-height: 1;
- letter-spacing: -1.2px;
-}
-
-.slopus-logo__wordmark {
- position: relative;
- z-index: 2;
- margin-left: 0;
+.brand__wordmark {
color: var(--text-primary);
font-size: var(--text-xl);
font-weight: var(--weight-bold);
@@ -161,22 +43,19 @@
letter-spacing: -0.7px;
}
-/* Compact mark: the ticket with a single S in it. One letter has room to be
- read at icon size, so it takes the body size rather than the 12px floor. */
-.slopus-logo--compact {
- --slopus-ticket-h: 22px;
- height: 30px;
- padding: 4px 3px;
-}
+/* --- Application icon ----------------------------------------------------- */
-.slopus-logo--compact .slopus-logo__monogram {
- margin-left: 3px;
- font-size: var(--text-base);
- letter-spacing: -0.3px;
+.slopus-logo {
+ width: 36px;
+ height: 36px;
+ flex: 0 0 auto;
+ display: block;
+ object-fit: contain;
}
-.slopus-logo--compact .slopus-logo__ticket {
- padding-right: 7px;
+.slopus-logo--compact {
+ width: 30px;
+ height: 30px;
}
/* --- Settings launcher ------------------------------------------------------