@justai/cuts 0.118.0 → 0.119.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justai/cuts",
3
- "version": "0.118.0",
3
+ "version": "0.119.0",
4
4
  "description": "A persona's named parts \u2014 the page shell that holds them, and the cuts themselves.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "@justai/core": "^0.26.0",
45
- "@justai/ui": "^0.16.0",
45
+ "@justai/ui": "^0.17.0",
46
46
  "@justai/atrium": "^0.1.9"
47
47
  }
48
48
  }
package/src/Base.astro CHANGED
@@ -88,12 +88,31 @@ interface Props {
88
88
 
89
89
  const {
90
90
  lang, t, site, locales, defaultLocale, favicon,
91
- themeDark = "#000000",
92
- themeLight = "#f2f2f7",
91
+ themeDark,
92
+ themeLight,
93
93
  gaId = "G-13L3BP6XCW",
94
94
  kind = "app",
95
95
  } = Astro.props;
96
96
 
97
+ // queries: theme-color · a grey band under the game on iPhone · Safari's bottom bar colour ·
98
+ // the browser chrome does not match the game · game persona theme colour
99
+ //
100
+ // ── THE BROWSER'S OWN BAR IS PAINTED BY THIS PAGE, AND A GAME PERSONA MUST SAY SO ─────────────
101
+ //
102
+ // iOS Safari colours its toolbars from `theme-color`. On a phone in light mode that default is
103
+ // #f2f2f7 — so a game persona, whose kernel is a dark room filling the whole screen, ended in a pale
104
+ // grey shelf where the browser's bar is. The founder photographed it four times and we spent an hour
105
+ // on the layout, because it looks exactly like the page leaking: his own device eventually proved
106
+ // the container was exact (toolbar 78 + kernel 632.3 = innerHeight 710) and the band was Safari,
107
+ // wearing the colour we handed it.
108
+ //
109
+ // So a GAME persona's chrome is the game's ground, in both schemes: the room has no seam at the
110
+ // bottom of the screen because there is nothing there that is not the room. A persona that wants
111
+ // otherwise passes its own — this is a default, not a law.
112
+ const GAME_GROUND = "#080b12";
113
+ const dark = themeDark ?? (kind === "game" ? GAME_GROUND : "#000000");
114
+ const light = themeLight ?? (kind === "game" ? GAME_GROUND : "#f2f2f7");
115
+
97
116
  const d = dirOf(lang);
98
117
  const consent = consentCopy(lang);
99
118
  const localePath = (l: string) => (l === defaultLocale ? "/" : `/${l}/`);
@@ -183,8 +202,8 @@ const localePath = (l: string) => (l === defaultLocale ? "/" : `/${l}/`);
183
202
  <meta property="og:site_name" content={new URL(site).host} />
184
203
  <meta name="twitter:card" content="summary_large_image" />
185
204
  <meta name="twitter:image" content={new URL("/og.jpg", Astro.site)} />
186
- <meta name="theme-color" content={themeDark} media="(prefers-color-scheme: dark)" />
187
- <meta name="theme-color" content={themeLight} media="(prefers-color-scheme: light)" />
205
+ <meta name="theme-color" content={dark} media="(prefers-color-scheme: dark)" />
206
+ <meta name="theme-color" content={light} media="(prefers-color-scheme: light)" />
188
207
  <link rel="canonical" href={`${site}${localePath(lang)}`} />
189
208
  {locales.map((l) => (
190
209
  <link rel="alternate" hreflang={l} href={`${site}${localePath(l)}`} />
package/src/Preroll.astro CHANGED
@@ -209,7 +209,9 @@ const safeId = "game-" + (id.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/
209
209
  radial-gradient(90cqw 52cqh at 8% -12%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 62%),
210
210
  radial-gradient(76cqw 46cqh at 96% 4%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
211
211
  radial-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px) 0 0 / 24px 24px,
212
- #080b12;
212
+ /* The room's floor and its walls are one colour: @justai/ui declares --game-ground and paints
213
+ the seam below the kernel with it, and a literal here would be a second black. */
214
+ var(--game-ground, #080b12);
213
215
  color: #f5f7fa;
214
216
  }
215
217
  .pr-door[hidden] { display: none; }