shadok-ai 0.9.15 → 0.9.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/public/index.html +27 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shadok-ai",
3
- "version": "0.9.15",
3
+ "version": "0.9.16",
4
4
  "main": "dist/session.js",
5
5
  "scripts": {
6
6
  "test": "node --import tsx --test test/*.ts context/*/test/*.test.mjs",
package/public/index.html CHANGED
@@ -3302,12 +3302,12 @@
3302
3302
  * dips the ball with the effort. The arm is recomputed each call from the
3303
3303
  * (bobbed) shoulder to the lever end it grips, so the linkage is always right —
3304
3304
  * animating the arm with CSS instead made it swing around the pivot, backwards.
3305
- * `sym` stamps a bold "!" / "?" over the ball, outlined in the ground colour so
3306
- * the accent-on-accent "?" still reads (eyes stay clear above it). Legs and the
3307
- * fulcrum stay planted. Eyes are always white + dark, never the accent, so they
3308
- * read on any `fill` (the `currentColor` indicator included). */
3305
+ * Legs and the fulcrum stay planted. Eyes are always white + dark, never the
3306
+ * accent, so they read on any `fill` (the `currentColor` indicator included).
3307
+ * The drawing carries no glyph: a waiting state is a signal tile drawn around
3308
+ * it (see `faviconSVG`), not a stamp on its belly. */
3309
3309
  const PX = 23.2, PY = 24.4; // the pump lever's fulcrum
3310
- function shadokInner(fill, { lever = null, bob = 0, sym = null, symColor } = {}) {
3310
+ function shadokInner(fill, { lever = null, bob = 0 } = {}) {
3311
3311
  const base = themeColor("--bg", "#14161d");
3312
3312
  const cx = 13.8, cy = 16.2, r = 8.4, eyeY = cy - 8.4, eyeSep = 5.8, eyeR = 2.6, pupR = 1.3;
3313
3313
  const shX = cx + r - 2.6, shY = cy + 1.8 + bob; // shoulder (moves with the bob)
@@ -3322,9 +3322,6 @@
3322
3322
  } else {
3323
3323
  armEl = `<line x1="${shX}" y1="${cy + 1 + bob}" x2="${cx + r + 1.8}" y2="${cy + 4.2 + bob}" stroke="${fill}" stroke-width="1.3" stroke-linecap="round"/>`;
3324
3324
  }
3325
- const glyph = sym
3326
- ? `<text x="${cx}" y="${cy + 3.4 + bob}" font-family="ui-monospace, monospace" font-size="14" font-weight="800" fill="${symColor || fill}" stroke="${base}" stroke-width="2.4" paint-order="stroke" text-anchor="middle">${sym}</text>`
3327
- : "";
3328
3325
  return (
3329
3326
  fulcrum + leverEl +
3330
3327
  // thin legs + feet (planted)
@@ -3341,12 +3338,11 @@
3341
3338
  `<path d="M${cx - 1.6} ${cy + 2} L${cx + 1.6} ${cy + 2} L${cx} ${cy + 5.4} Z" fill="${fill}"/>` +
3342
3339
  `<circle cx="${cx - eyeSep / 2}" cy="${eyeY}" r="${eyeR}" fill="#fff"/><circle cx="${cx + eyeSep / 2}" cy="${eyeY}" r="${eyeR}" fill="#fff"/>` +
3343
3340
  `<circle cx="${cx - eyeSep / 2 + 0.3}" cy="${eyeY + 0.3}" r="${pupR}" fill="${base}"/><circle cx="${cx + eyeSep / 2 + 0.3}" cy="${eyeY + 0.3}" r="${pupR}" fill="${base}"/>` +
3344
- `</g>` +
3345
- glyph
3341
+ `</g>`
3346
3342
  );
3347
3343
  }
3348
- function faviconWrap(inner) {
3349
- const base = themeColor("--bg", "#14161d");
3344
+ function faviconWrap(inner, ground) {
3345
+ const base = ground || themeColor("--bg", "#14161d");
3350
3346
  return (
3351
3347
  "data:image/svg+xml," +
3352
3348
  encodeURIComponent(
@@ -3355,12 +3351,27 @@
3355
3351
  )
3356
3352
  );
3357
3353
  }
3358
- /** The favicon: an accent Shadok on the dark ground. A waiting state stamps a
3359
- * bold "!" (something to answer) or "?" (something to read) OVER it, in its
3360
- * colour. No symbol → the idle Shadok. */
3354
+ /** The favicon.
3355
+ *
3356
+ * Idle: an accent Shadok on the dark ground.
3357
+ *
3358
+ * Waiting: a SIGNAL TILE. The whole tile takes the state colour, the glyph —
3359
+ * "!" (answer me) or "?" (something to read) — is drawn in the ground colour
3360
+ * at nearly the tile's height, and the Shadok stays behind it as a watermark.
3361
+ * It used to be a 14px glyph stamped on the Shadok's belly, which at the 16px
3362
+ * a browser tab actually renders left about seven pixels of symbol competing
3363
+ * with the whole drawing: unreadable exactly when it mattered. A favicon has
3364
+ * one glyph's worth of room, so the glyph has to BE the favicon. */
3365
+ const GLYPH_SIZE = 29;
3361
3366
  function faviconSVG(symbol, symColor) {
3362
3367
  const accent = themeColor("--amber", "#f0a848");
3363
- return faviconWrap(shadokInner(accent, symbol ? { sym: symbol, symColor } : {}));
3368
+ if (!symbol) return faviconWrap(shadokInner(accent));
3369
+ const base = themeColor("--bg", "#14161d");
3370
+ const inner =
3371
+ `<g opacity="0.18">${shadokInner(base)}</g>` +
3372
+ `<text x="16" y="23.5" font-family="ui-monospace, monospace" font-size="${GLYPH_SIZE}"` +
3373
+ ` font-weight="800" fill="${base}" text-anchor="middle">${symbol}</text>`;
3374
+ return faviconWrap(inner, symColor || accent);
3364
3375
  }
3365
3376
  /** The pump pose for a phase p (0..1..0): the Shadok pushes the lever DOWN (near
3366
3377
  * end down = negative angle) and the ball dips with the effort — shared by the