@a2f0/skyline 0.2.23 → 0.2.24
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/docs/package.md +4 -1
- package/lib/skyline-shell.d.ts +1 -1
- package/package.json +1 -1
- package/site/skyline-3d.html +2 -0
- package/site/skyline-viewer.js +1 -0
- package/site/study.css +15 -0
package/docs/package.md
CHANGED
|
@@ -11,9 +11,12 @@ Omitting `colour` keeps the existing greyscale default. The setting belongs to t
|
|
|
11
11
|
it does not use storage or affect another embed. The standalone viewer accepts `?colour=1`.
|
|
12
12
|
|
|
13
13
|
Pass `theme: "light"` or `theme: "dark"` from the host's active theme to choose the
|
|
14
|
-
loading backdrop, animated outline
|
|
14
|
+
loading backdrop, animated outline, error palette and bottom control bar.
|
|
15
|
+
The loading palette applies synchronously,
|
|
15
16
|
before the viewer's code or stylesheets load. After the first frame, the scene
|
|
16
17
|
supplies its own sky; returning to greyscale restores the black sky and stars.
|
|
18
|
+
The control bar keeps the host's theme, including its buttons, focus outlines,
|
|
19
|
+
time slider and celebration badges, independently of the scene's time or materials.
|
|
17
20
|
Without `theme`, `colour: true`
|
|
18
21
|
boots light and greyscale boots dark. The theme does not select scene materials or
|
|
19
22
|
time of day: for a light host, pass both `theme: "light"` and `colour: true`.
|
package/lib/skyline-shell.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface ViewerContext {
|
|
|
13
13
|
readonly controls: "open" | "closed";
|
|
14
14
|
/** Start the scene and its building details in sunny-day colour. */
|
|
15
15
|
readonly colour?: boolean;
|
|
16
|
-
/** Loading
|
|
16
|
+
/** Loading palette and control bar; defaults to light for colour, dark otherwise. */
|
|
17
17
|
readonly theme: "light" | "dark";
|
|
18
18
|
/** Show the OpenStreetMap credit with the scene's controls. */
|
|
19
19
|
readonly attribution: boolean;
|
package/package.json
CHANGED
package/site/skyline-3d.html
CHANGED
|
@@ -92,6 +92,8 @@
|
|
|
92
92
|
// markup in its shadow root, applies its own options the same way (skyline-viewer.ts).
|
|
93
93
|
(() => {
|
|
94
94
|
const settings = new URLSearchParams(location.search);
|
|
95
|
+
const theme = settings.get("theme");
|
|
96
|
+
document.body.dataset.theme = theme === "light" || (theme !== "dark" && settings.get("colour") === "1") ? "light" : "dark";
|
|
95
97
|
if (settings.get("controls") === "open") {
|
|
96
98
|
const toggle = document.querySelector("#menu-toggle");
|
|
97
99
|
toggle.setAttribute("aria-expanded", "true");
|
package/site/skyline-viewer.js
CHANGED
|
@@ -40,6 +40,7 @@ export function mount(root, { assets, signal, controls, colour, theme, attributi
|
|
|
40
40
|
viewer.dataset["embedded"] = "";
|
|
41
41
|
const stars = element(document, "div", { className: "stars", id: "stars" }, { "aria-hidden": "true" });
|
|
42
42
|
const scene = element(document, "div", { className: "skyline-3d", id: "skyline-3d-scene" });
|
|
43
|
+
scene.dataset["theme"] = theme;
|
|
43
44
|
const drawing = element(document, "img", { className: "scene drawing", id: "drawing", alt: "Original Chicago skyline", hidden: true });
|
|
44
45
|
const originalReturn = element(document, "button", { type: "button", className: "original-return", id: "return-skyline-3d", title: home.title, hidden: true, textContent: home.label });
|
|
45
46
|
const embeddedOriginal = element(document, "button", { type: "button", className: "original-return", id: "embedded-original", title: toggles.original.title, hidden: true, textContent: toggles.original.label });
|
package/site/study.css
CHANGED
|
@@ -185,6 +185,21 @@ body.skyline-3d { height: 100vh; height: 100dvh; }
|
|
|
185
185
|
.control-bar .menu-toggle:hover { color: #fff; background: #ffffff14; }
|
|
186
186
|
.menu-toggle svg { width: 20px; height: 20px; fill: currentColor; transition: rotate 0.35s cubic-bezier(0.2, 0.7, 0.2, 1); }
|
|
187
187
|
.menu-toggle[aria-expanded="true"] svg { rotate: 30deg; }
|
|
188
|
+
/* The host theme owns the bar throughout loading and interaction, independently
|
|
189
|
+
of the scene's materials or time of day. The standalone page uses the same
|
|
190
|
+
theme/colour defaults as mountSkyline. Keep the other studies' palette intact. */
|
|
191
|
+
.skyline-3d[data-theme="light"] .control-bar { color-scheme: light; background: #f5f5f5; border-color: #bbb; color: #444; }
|
|
192
|
+
.skyline-3d[data-theme="light"] .control-bar button { --control-button-background: #fff; background: var(--control-button-background); border-color: #888; color: #444; -webkit-tap-highlight-color: #00000022; }
|
|
193
|
+
.skyline-3d[data-theme="light"] .control-bar button:is(:hover, [aria-pressed="true"]) { --control-button-background: #e0e0e0; border-color: #666; color: #111; }
|
|
194
|
+
.skyline-3d[data-theme="light"] .control-bar :focus-visible { outline-color: #111; }
|
|
195
|
+
.skyline-3d[data-theme="light"] .time-controls :is(label, output) { color: #444; }
|
|
196
|
+
.skyline-3d[data-theme="light"] :is(.time-controls #time-date, .celebration-caption) { color: #666; }
|
|
197
|
+
.skyline-3d[data-theme="light"] .time-controls input { accent-color: #666; }
|
|
198
|
+
.skyline-3d[data-theme="light"] .celebration-controls .logo-cut { stroke: var(--control-button-background); }
|
|
199
|
+
.skyline-3d[data-theme="light"] .celebration-controls button[aria-pressed="true"] { border-color: #666; box-shadow: inset 0 -2px #444; }
|
|
200
|
+
.skyline-3d[data-theme="light"] .celebration-controls button[aria-pressed="mixed"] { color: #333; border-color: #666; }
|
|
201
|
+
.skyline-3d[data-theme="light"] .control-bar .menu-toggle { background: none; color: #666; }
|
|
202
|
+
.skyline-3d[data-theme="light"] .control-bar .menu-toggle:hover { background: #00000014; color: #111; }
|
|
188
203
|
/* Compact badges leave room for the time slider. Smaller screens retain 36px
|
|
189
204
|
touch targets. */
|
|
190
205
|
@container skyline (min-width: 1440px) {
|