@jossuealcala/madre 1.0.4 → 1.1.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/ADDITIONAL-TERMS.md +7 -2
- package/CHANGELOG.en.md +152 -1
- package/CHANGELOG.md +152 -1
- package/CONTRIBUTING.md +2 -2
- package/LICENSE +111 -661
- package/NOTICE +59 -24
- package/README.en.md +36 -204
- package/README.md +36 -210
- package/SECURITY.md +1 -0
- package/TRADEMARKS.en.md +13 -14
- package/TRADEMARKS.md +42 -26
- package/bin/madre.cjs +2 -2
- package/bin/madre.mjs +114 -42
- package/docs/REFERENCE.md +53 -6
- package/docs/SDK.md +44 -5
- package/docs/en/REFERENCE.md +53 -6
- package/docs/en/SDK.md +43 -4
- package/docs/madre-banner.png +0 -0
- package/docs/sdk/hello-module.mjs +3 -0
- package/package.json +3 -2
- package/public/abduction.js +6 -6
- package/public/activity.js +425 -0
- package/public/app.js +3519 -647
- package/public/assets/abduction-cat-blink.webp +0 -0
- package/public/assets/abduction-cat-control-left.webp +0 -0
- package/public/assets/abduction-cat-control-right.webp +0 -0
- package/public/assets/abduction-cat.webp +0 -0
- package/public/assets/manual/shots/en-agents.webp +0 -0
- package/public/assets/manual/shots/en-chats.webp +0 -0
- package/public/assets/manual/shots/en-code.webp +0 -0
- package/public/assets/manual/shots/en-composer.webp +0 -0
- package/public/assets/manual/shots/en-connectors.webp +0 -0
- package/public/assets/manual/shots/en-continuity.webp +0 -0
- package/public/assets/manual/shots/en-coordinator.webp +0 -0
- package/public/assets/manual/shots/en-copilot.webp +0 -0
- package/public/assets/manual/shots/en-diagnostics.webp +0 -0
- package/public/assets/manual/shots/en-home.webp +0 -0
- package/public/assets/manual/shots/en-local.webp +0 -0
- package/public/assets/manual/shots/en-market.webp +0 -0
- package/public/assets/manual/shots/en-memory.webp +0 -0
- package/public/assets/manual/shots/en-modes.webp +0 -0
- package/public/assets/manual/shots/en-notes.webp +0 -0
- package/public/assets/manual/shots/en-settings.webp +0 -0
- package/public/assets/manual/shots/en-welcome.webp +0 -0
- package/public/assets/manual/shots/en-windows.webp +0 -0
- package/public/assets/manual/shots/es-agents.webp +0 -0
- package/public/assets/manual/shots/es-chats.webp +0 -0
- package/public/assets/manual/shots/es-code.webp +0 -0
- package/public/assets/manual/shots/es-composer.webp +0 -0
- package/public/assets/manual/shots/es-connectors.webp +0 -0
- package/public/assets/manual/shots/es-continuity.webp +0 -0
- package/public/assets/manual/shots/es-coordinator.webp +0 -0
- package/public/assets/manual/shots/es-copilot.webp +0 -0
- package/public/assets/manual/shots/es-diagnostics.webp +0 -0
- package/public/assets/manual/shots/es-home.webp +0 -0
- package/public/assets/manual/shots/es-local.webp +0 -0
- package/public/assets/manual/shots/es-market.webp +0 -0
- package/public/assets/manual/shots/es-memory.webp +0 -0
- package/public/assets/manual/shots/es-modes.webp +0 -0
- package/public/assets/manual/shots/es-notes.webp +0 -0
- package/public/assets/manual/shots/es-settings.webp +0 -0
- package/public/assets/manual/shots/es-welcome.webp +0 -0
- package/public/assets/manual/shots/es-windows.webp +0 -0
- package/public/assets/news/1.1/en/chats.webp +0 -0
- package/public/assets/news/1.1/en/home.webp +0 -0
- package/public/assets/news/1.1/en/maps.webp +0 -0
- package/public/assets/news/1.1/en/market.webp +0 -0
- package/public/assets/news/1.1/en/permissions.webp +0 -0
- package/public/assets/news/1.1/en/privacy.webp +0 -0
- package/public/assets/news/1.1/en/welcome.webp +0 -0
- package/public/assets/news/1.1/es/chats.webp +0 -0
- package/public/assets/news/1.1/es/home.webp +0 -0
- package/public/assets/news/1.1/es/maps.webp +0 -0
- package/public/assets/news/1.1/es/market.webp +0 -0
- package/public/assets/news/1.1/es/permissions.webp +0 -0
- package/public/assets/news/1.1/es/privacy.webp +0 -0
- package/public/assets/news/1.1/es/welcome.webp +0 -0
- package/public/attribution.js +15 -16
- package/public/brands.js +2 -2
- package/public/code-tools.js +2 -2
- package/public/editor.js +13 -13
- package/public/en.js +483 -0
- package/public/es.js +1817 -598
- package/public/hardware.js +2 -2
- package/public/i18n.js +47 -9
- package/public/icons.js +158 -0
- package/public/index.html +68 -51
- package/public/inquiry.js +2 -2
- package/public/loader.js +271 -2
- package/public/macroverso.js +60 -21
- package/public/manual-content.js +900 -0
- package/public/manual-shots.js +47 -0
- package/public/manual.css +246 -0
- package/public/manual.html +15 -0
- package/public/manual.js +427 -0
- package/public/market-art.js +99 -41
- package/public/market-view.js +243 -47
- package/public/market.js +139 -26
- package/public/mcp-catalog.js +62 -0
- package/public/neural.js +64 -8
- package/public/nostromo-engine.js +709 -40
- package/public/page-errors.js +29 -0
- package/public/power.js +350 -11
- package/public/remedy.js +89 -0
- package/public/resay.js +4 -2
- package/public/review-ask.js +12 -7
- package/public/routing.js +3 -3
- package/public/salas-mac.css +875 -48
- package/public/salas-mac.html +27 -15
- package/public/salas-mac.js +1668 -338
- package/public/salas.css +2 -2
- package/public/salas.html +3 -3
- package/public/salas.js +3 -3
- package/public/styles.css +2694 -323
- package/public/syntax.js +2 -2
- package/public/terms.js +152 -0
- package/public/touch.js +2 -2
- package/public/tour-chapters.js +100 -92
- package/public/tour.js +118 -28
- package/public/troubleshooting.js +327 -21
- package/public/wallpaper.js +4 -3
- package/public/welcome.js +923 -0
- package/src/activity.mjs +85 -0
- package/src/adapters/claude.mjs +61 -35
- package/src/adapters/codex.mjs +18 -5
- package/src/adapters/cursor.mjs +60 -9
- package/src/adapters/gemini.mjs +17 -4
- package/src/adapters/madre.mjs +30 -9
- package/src/adapters/opencode.mjs +73 -10
- package/src/adapters/process.mjs +19 -15
- package/src/adapters/subagents.mjs +159 -0
- package/src/asking.mjs +8 -2
- package/src/auth-probe.mjs +47 -11
- package/src/bridge/devices.mjs +2 -2
- package/src/bridge/handoff.mjs +2 -2
- package/src/bridge/host.mjs +2 -2
- package/src/bridge/network.mjs +2 -2
- package/src/bridge/policy.mjs +3 -3
- package/src/bridge/qr.mjs +2 -2
- package/src/bridge/server.mjs +3 -3
- package/src/builtin-updates.mjs +87 -0
- package/src/capabilities.mjs +5 -5
- package/src/chats.mjs +51 -2
- package/src/checkpoint.mjs +67 -9
- package/src/choices.mjs +2 -2
- package/src/cli-args.mjs +2 -2
- package/src/cold.mjs +2 -2
- package/src/commands.mjs +2 -2
- package/src/config.mjs +2 -2
- package/src/conversation-context.mjs +2 -2
- package/src/credentials.mjs +80 -18
- package/src/dataset.mjs +2 -2
- package/src/directives.mjs +2 -2
- package/src/distiller.mjs +2 -2
- package/src/embeddings.mjs +2 -2
- package/src/enlaces.mjs +2 -2
- package/src/environment.mjs +147 -0
- package/src/event-store.mjs +2 -2
- package/src/exam.mjs +2 -2
- package/src/extensions.mjs +2 -2
- package/src/eyecat-watch.mjs +2 -2
- package/src/eyecat.mjs +2 -2
- package/src/file-ops.mjs +2 -2
- package/src/files.mjs +2 -2
- package/src/github.mjs +2 -2
- package/src/heartbeat.mjs +2 -2
- package/src/history.mjs +76 -0
- package/src/i18n.mjs +32 -3
- package/src/image-studio.mjs +2 -2
- package/src/install-metrics.mjs +109 -0
- package/src/json-file.mjs +2 -2
- package/src/launch.mjs +2 -2
- package/src/lease.mjs +15 -4
- package/src/lobby-work.mjs +11 -4
- package/src/local-ai.mjs +12 -4
- package/src/looks.mjs +19 -7
- package/src/market-check.mjs +165 -0
- package/src/market-key.mjs +10 -2
- package/src/market-license.mjs +104 -0
- package/src/market-remote.mjs +71 -13
- package/src/maturity.mjs +2 -2
- package/src/mcp/connect.mjs +2 -2
- package/src/mcp/github-server.mjs +2 -2
- package/src/mcp/image-server.mjs +2 -2
- package/src/mcp/memory-server.mjs +2 -2
- package/src/mcp/proxy.mjs +16 -5
- package/src/mcp/smtp-server.mjs +2 -2
- package/src/memory-dashboard.mjs +2 -2
- package/src/memory-tools.mjs +2 -2
- package/src/memory.mjs +2 -2
- package/src/models.mjs +115 -12
- package/src/module-scope.mjs +2 -2
- package/src/modules/ahp.mjs +2 -2
- package/src/modules/ash-policy.mjs +2 -2
- package/src/modules/ash.mjs +2 -2
- package/src/modules/bishop-exam.mjs +2 -2
- package/src/modules/bishop-plan.mjs +2 -2
- package/src/modules/bishop.mjs +9 -3
- package/src/modules/choices.mjs +2 -2
- package/src/modules/correo.mjs +2 -2
- package/src/modules/enlaces.mjs +2 -2
- package/src/modules/git-pulse.mjs +2 -2
- package/src/modules/github.mjs +2 -2
- package/src/modules/helpers.mjs +2 -2
- package/src/modules/image-studio.mjs +2 -2
- package/src/modules/index.mjs +92 -5
- package/src/modules/intents-calibration.mjs +2 -2
- package/src/modules/intents-desk.mjs +4 -3
- package/src/modules/intents-observe.mjs +2 -2
- package/src/modules/intents-policy.mjs +2 -2
- package/src/modules/intents-try.mjs +2 -2
- package/src/modules/intents.mjs +2 -2
- package/src/modules/local-models.mjs +41 -10
- package/src/modules/mcp-connect.mjs +2 -2
- package/src/modules/notes.mjs +281 -0
- package/src/modules/ollama.mjs +48 -13
- package/src/modules/playwright.mjs +16 -5
- package/src/modules/reminders.mjs +664 -0
- package/src/modules/ripley.mjs +3 -3
- package/src/modules/runs.mjs +2 -2
- package/src/modules/sdk.mjs +57 -9
- package/src/modules/updates.mjs +2 -2
- package/src/mother.mjs +13 -3
- package/src/npm-launch.mjs +2 -2
- package/src/ollama.mjs +8 -6
- package/src/opencode-health.mjs +83 -0
- package/src/outbound.mjs +35 -3
- package/src/override.mjs +27 -22
- package/src/ports.mjs +2 -2
- package/src/prices.mjs +2 -2
- package/src/privacy.mjs +2 -2
- package/src/quota-monitor.mjs +2 -2
- package/src/quota-sources.mjs +2 -2
- package/src/request-guard.mjs +2 -2
- package/src/review-ask.mjs +4 -3
- package/src/room/archivist.mjs +2 -2
- package/src/room/attachments.mjs +2 -2
- package/src/room/budget.mjs +2 -2
- package/src/room/context.mjs +2 -2
- package/src/room/control.mjs +2 -2
- package/src/room/copilot.mjs +2 -2
- package/src/room/economy.mjs +2 -2
- package/src/room/escalation.mjs +2 -2
- package/src/room/ghost.mjs +2 -2
- package/src/room/guard.mjs +6 -4
- package/src/room/prompt.mjs +3 -3
- package/src/room/returns.mjs +2 -2
- package/src/room/runs.mjs +6 -4
- package/src/room/vectors.mjs +2 -2
- package/src/room.mjs +144 -36
- package/src/router.mjs +2 -2
- package/src/runs.mjs +2 -2
- package/src/runtime-detection.mjs +36 -6
- package/src/salas.mjs +31 -6
- package/src/sentinel-errors.mjs +17 -7
- package/src/server-sentinel.mjs +2 -2
- package/src/server.mjs +980 -139
- package/src/setup-trouble.mjs +33 -0
- package/src/setup.mjs +4 -4
- package/src/smtp.mjs +2 -2
- package/src/telemetry.mjs +266 -0
- package/src/terms.mjs +43 -0
- package/src/tour.mjs +60 -7
- package/src/uninstall.mjs +225 -0
- package/src/updates.mjs +2 -2
- package/src/usage-sentinel.mjs +2 -2
- package/src/vault.mjs +2 -2
- package/src/verdict.mjs +13 -10
- package/src/whats-new.mjs +97 -3
- package/public/assets/abduction-cat-blink.png +0 -0
- package/public/assets/abduction-cat-control-left.png +0 -0
- package/public/assets/abduction-cat-control-right.png +0 -0
- package/public/assets/abduction-cat.png +0 -0
package/public/loader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
2
|
-
// MADRE · © 2026 Jossue Alcalá ·
|
|
1
|
+
// SPDX-License-Identifier: BUSL-1.1
|
|
2
|
+
// MADRE · © 2026 Jossue Alcalá · Business Source License 1.1: LICENSE
|
|
3
3
|
// MADRE loading (2026-10-10): the pulse of the logo beating, a thin bar that fills and the share
|
|
4
4
|
// done under it, as a Mac starts. One loader for every wait that takes time — a RELOAD, the room
|
|
5
5
|
// or Home coming back after an update, a project waking, an agent installing — so a wait always
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
// start and the end are known, `creep` moves the bar on its own towards a ceiling it never passes,
|
|
10
10
|
// slower the closer it gets, and the end fills it.
|
|
11
11
|
|
|
12
|
+
// MADRE's logo as the brandbook draws it (salas-mac.html, .brand-logo): the beat, then the word. Shared
|
|
13
|
+
// by the windows that wear it in their head — the welcome, the chapters (2026-10-28).
|
|
14
|
+
export const MADRE_LOGO = '<svg class="brand-logo" viewBox="-4.8 -4.8 377.1 49.6" aria-hidden="true"><g fill="none" stroke-linecap="round" stroke-linejoin="round"><g class="pulse" transform="translate(0 0) scale(2.5) translate(0 -2)"><path class="beat" d="M1 10H16L20 10L23.5 2L28 18L32 10L35 10L37 6L39 10H52" stroke-width="1.92" pathLength="100"/><circle class="beat-dot" cx="60" cy="10" r="3" stroke="none"/></g><g class="word" transform="translate(193.5 7)" stroke-width="4.8"><path d="M0 26V0L14 14.3L28 0V26"/><path transform="translate(36.5 0)" d="M0 26V7.8A7.8 7.8 0 0 1 7.8 0H17.2A7.8 7.8 0 0 1 25 7.8V26M0 15.6H25"/><path transform="translate(71.5 0)" d="M0 0H16A12 12 0 0 1 28 12V14A12 12 0 0 1 16 26H0Z"/><path transform="translate(110.5 0)" d="M0 26V0H20.85A7.15 7.15 0 0 1 28 7.15V7.15A7.15 7.15 0 0 1 20.85 14.3H0M15.12 14.3L28 26"/><path transform="translate(146 0)" d="M28 0H0V26H28M0 13H21"/></g></g></svg>';
|
|
12
15
|
export const LOADER_MARK = '<svg viewBox="-2 -1 66 22" aria-hidden="true"><path class="madre-loader-trace" d="M1 10H16L20 10L23.5 2L28 18L32 10L35 10L37 6L39 10H52" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path class="madre-loader-beat" d="M1 10H16L20 10L23.5 2L28 18L32 10L35 10L37 6L39 10H52" pathLength="100" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><circle class="madre-loader-dot" cx="60" cy="10" r="3" fill="currentColor"/></svg>';
|
|
13
16
|
|
|
14
17
|
const clamp = (value) => Math.max(0, Math.min(1, Number(value) || 0));
|
|
@@ -79,3 +82,269 @@ export function finishLoader(node, { hold = 260 } = {}) {
|
|
|
79
82
|
setLoader(node, 1);
|
|
80
83
|
return new Promise((resolve) => setTimeout(resolve, hold));
|
|
81
84
|
}
|
|
85
|
+
|
|
86
|
+
// THE OPENING, shared (2026-10-28): before the welcome's first step (welcome.js) and when a project
|
|
87
|
+
// opens again after it was closed (app.js). Here, beside the logo it draws, because every MADRE
|
|
88
|
+
// already serves this file. `dialog` is the top-layer window it plays in: it takes the class `intro`
|
|
89
|
+
// while it plays and `arriving` as it goes, so what it covers can rise in under it.
|
|
90
|
+
const make = (tag, className, text = null) => {
|
|
91
|
+
const node = document.createElement(tag);
|
|
92
|
+
node.className = className;
|
|
93
|
+
if (text !== null) node.textContent = text;
|
|
94
|
+
return node;
|
|
95
|
+
};
|
|
96
|
+
// THE OPENING (2026-10-28): before the first step, what MADRE is, said without words. The AIs a
|
|
97
|
+
// person already uses come in as points of light, each in its own color, find each other with fine
|
|
98
|
+
// lines and come together on one line that becomes MADRE's pulse: the beat, then the name. About five
|
|
99
|
+
// seconds; a click or any key goes straight to the welcome, and a computer that asked for less motion
|
|
100
|
+
// goes there without it. Drawn on a canvas, the points; the logo is MADRE's own drawing (loader.js),
|
|
101
|
+
// moved by hand so the line passes each point at the moment it takes it in.
|
|
102
|
+
const INTRO_HUES = {
|
|
103
|
+
dark: ['#7fe3b6', '#f2a37c', '#93acff', '#ecece6', '#c8b5ff'],
|
|
104
|
+
light: ['#1d9a68', '#cf6c40', '#4864d2', '#575a52', '#7a5ed2'],
|
|
105
|
+
};
|
|
106
|
+
const INTRO = { appear: 250, lines: 900, gather: 2300, gathered: 3300, draw: 2650, drawn: 3600, beat: 3550, word: 3850, hold: 5700, out: 650 };
|
|
107
|
+
// The pulse is drawn at the centre, alone; when the name comes it glides left to make room for it.
|
|
108
|
+
// The share of the logo's width between the pulse's centre and the whole logo's (loader.js viewBox).
|
|
109
|
+
const PULSE_OFF_CENTRE = (183.75 - 80) / 377.1;
|
|
110
|
+
const easeInOut = (x) => (x < 0.5 ? 4 * x * x * x : 1 - ((-2 * x + 2) ** 3) / 2);
|
|
111
|
+
const easeOut = (x) => 1 - (1 - x) ** 3;
|
|
112
|
+
const span = (now, from, to) => Math.max(0, Math.min(1, (now - from) / (to - from)));
|
|
113
|
+
|
|
114
|
+
// The page is ready (2026-10-30): the ground put over it before its first frame (index.html,
|
|
115
|
+
// salas-mac.html) fades out, the way a page arriving from another one does. Under an opening, it
|
|
116
|
+
// goes unseen; once is enough.
|
|
117
|
+
export function bootDone() {
|
|
118
|
+
const root = globalThis.document?.documentElement;
|
|
119
|
+
if (!root?.classList?.contains('madre-booting')) return;
|
|
120
|
+
root.classList.remove('madre-booting');
|
|
121
|
+
root.classList.add('madre-arriving');
|
|
122
|
+
setTimeout(() => root.classList.remove('madre-arriving'), 700);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Whether this page already played MADRE's opening: it is played once per page, never twice in a row.
|
|
126
|
+
let openingDone = false;
|
|
127
|
+
export const openingPlayed = () => openingDone;
|
|
128
|
+
|
|
129
|
+
export function playOpening(dialog, { skipLabel = 'Skip' } = {}) {
|
|
130
|
+
if (globalThis.matchMedia?.('(prefers-reduced-motion: reduce)').matches) return Promise.resolve(false);
|
|
131
|
+
openingDone = true;
|
|
132
|
+
return new Promise((resolve) => {
|
|
133
|
+
const light = document.documentElement.dataset.scheme === 'light';
|
|
134
|
+
const hues = INTRO_HUES[light ? 'light' : 'dark'];
|
|
135
|
+
// Only the picture is hidden from a screen reader: «Skip» inside it stays a key it can reach.
|
|
136
|
+
const stage = make('div', 'wl-intro');
|
|
137
|
+
const sky = make('canvas', 'wl-intro-sky');
|
|
138
|
+
sky.setAttribute('aria-hidden', 'true');
|
|
139
|
+
const mark = make('div', 'wl-intro-mark');
|
|
140
|
+
mark.setAttribute('aria-hidden', 'true');
|
|
141
|
+
mark.innerHTML = MADRE_LOGO.replace('class="brand-logo"', 'class="wl-intro-logo"'); // trusted: our own SVG string
|
|
142
|
+
const skip = make('button', 'wl-intro-skip', skipLabel);
|
|
143
|
+
skip.type = 'button';
|
|
144
|
+
skip.addEventListener('click', () => end(true));
|
|
145
|
+
stage.append(sky, mark, skip);
|
|
146
|
+
dialog.append(stage);
|
|
147
|
+
dialog.classList.add('intro');
|
|
148
|
+
const beat = mark.querySelector('.beat');
|
|
149
|
+
const dot = mark.querySelector('.beat-dot');
|
|
150
|
+
const word = mark.querySelector('.word');
|
|
151
|
+
const pen = sky.getContext('2d');
|
|
152
|
+
let width = 0;
|
|
153
|
+
let height = 0;
|
|
154
|
+
const fit = () => {
|
|
155
|
+
const ratio = Math.min(2, globalThis.devicePixelRatio || 1);
|
|
156
|
+
width = stage.clientWidth;
|
|
157
|
+
height = stage.clientHeight;
|
|
158
|
+
sky.width = Math.round(width * ratio);
|
|
159
|
+
sky.height = Math.round(height * ratio);
|
|
160
|
+
pen.setTransform(ratio, 0, 0, ratio, 0, 0);
|
|
161
|
+
};
|
|
162
|
+
fit();
|
|
163
|
+
// Where on the pulse each AI lands, as a share of its line: before the rise, the peak, the
|
|
164
|
+
// valley, the small step and the end.
|
|
165
|
+
const lands = [0.06, 0.4, 0.55, 0.74, 0.96];
|
|
166
|
+
const length = beat.getTotalLength();
|
|
167
|
+
const landing = () => lands.map((share) => {
|
|
168
|
+
const point = beat.getPointAtLength(share * length);
|
|
169
|
+
const matrix = beat.getScreenCTM();
|
|
170
|
+
const box = stage.getBoundingClientRect();
|
|
171
|
+
return { x: matrix.a * point.x + matrix.c * point.y + matrix.e - box.left, y: matrix.b * point.x + matrix.d * point.y + matrix.f - box.top };
|
|
172
|
+
});
|
|
173
|
+
// The five AIs, each at its own depth on a slow orbit, and a fine dust that gives the dark depth.
|
|
174
|
+
const agents = hues.map((hue, index) => ({ hue, angle: (index / hues.length) * Math.PI * 2 + 0.35 * Math.sin(index * 2.1), reach: 0.62 + 0.38 * ((index * 37) % 5) / 4, depth: 0.75 + ((index * 3) % 5) * 0.1 }));
|
|
175
|
+
const dust = Array.from({ length: 46 }, (_, index) => ({ x: ((index * 73) % 97) / 97, y: ((index * 41) % 89) / 89, r: 0.4 + ((index * 7) % 5) * 0.18, a: 0.05 + ((index * 11) % 7) * 0.016, drift: 0.004 + ((index * 5) % 9) * 0.0012 }));
|
|
176
|
+
const edges = [];
|
|
177
|
+
for (let a = 0; a < agents.length; a += 1) for (let b = a + 1; b < agents.length; b += 1) edges.push([a, b]);
|
|
178
|
+
const ink = (hex, alpha) => {
|
|
179
|
+
const value = Number.parseInt(hex.slice(1), 16);
|
|
180
|
+
return `rgba(${(value >> 16) & 255}, ${(value >> 8) & 255}, ${value & 255}, ${alpha})`;
|
|
181
|
+
};
|
|
182
|
+
// Where the mark stands: the pulse alone at the centre, then the whole logo as the name comes in.
|
|
183
|
+
const place = (time) => {
|
|
184
|
+
const settle = easeInOut(span(time, INTRO.word - 300, INTRO.word + 900));
|
|
185
|
+
const scale = 1.035 - 0.035 * easeOut(span(time, INTRO.gathered, INTRO.word + 900));
|
|
186
|
+
mark.style.transform = `translate(calc(-50% + ${(PULSE_OFF_CENTRE * mark.clientWidth * (1 - settle)).toFixed(2)}px), -50%) scale(${scale.toFixed(4)})`;
|
|
187
|
+
};
|
|
188
|
+
place(0);
|
|
189
|
+
let targets = landing();
|
|
190
|
+
let started = 0;
|
|
191
|
+
let frame = 0;
|
|
192
|
+
let done = false;
|
|
193
|
+
const onResize = () => { fit(); targets = landing(); };
|
|
194
|
+
globalThis.addEventListener('resize', onResize);
|
|
195
|
+
|
|
196
|
+
function paint(now) {
|
|
197
|
+
if (!started) started = now;
|
|
198
|
+
const time = now - started;
|
|
199
|
+
pen.clearRect(0, 0, width, height);
|
|
200
|
+
const cx = width / 2;
|
|
201
|
+
const cy = height * 0.48;
|
|
202
|
+
const radius = Math.min(width, height) * 0.2;
|
|
203
|
+
const gather = easeInOut(span(time, INTRO.gather, INTRO.gathered));
|
|
204
|
+
const drawn = easeOut(span(time, INTRO.draw, INTRO.drawn));
|
|
205
|
+
place(time);
|
|
206
|
+
if (time < INTRO.drawn) targets = landing();
|
|
207
|
+
// The dust drifts up, and goes when the AIs come together.
|
|
208
|
+
const dustFade = 1 - span(time, INTRO.gather, INTRO.gather + 700);
|
|
209
|
+
for (const speck of dust) {
|
|
210
|
+
const y = ((speck.y - time * speck.drift * 0.001) % 1 + 1) % 1;
|
|
211
|
+
pen.fillStyle = light ? `rgba(20, 24, 20, ${speck.a * 0.8 * dustFade})` : `rgba(235, 240, 230, ${speck.a * dustFade})`;
|
|
212
|
+
pen.beginPath();
|
|
213
|
+
pen.arc(speck.x * width, y * height, speck.r, 0, Math.PI * 2);
|
|
214
|
+
pen.fill();
|
|
215
|
+
}
|
|
216
|
+
// Where each AI is: on its orbit, turning slowly, until it glides to its place on the pulse.
|
|
217
|
+
const turn = time * 0.00011;
|
|
218
|
+
const at = agents.map((agent, index) => {
|
|
219
|
+
const angle = agent.angle + turn * agent.depth;
|
|
220
|
+
const free = { x: cx + Math.cos(angle) * radius * agent.reach * 1.35, y: cy + Math.sin(angle) * radius * agent.reach * 0.82 };
|
|
221
|
+
const target = targets[index];
|
|
222
|
+
return { x: free.x + (target.x - free.x) * gather, y: free.y + (target.y - free.y) * gather };
|
|
223
|
+
});
|
|
224
|
+
// The lines between them: drawn one after another, gone as they come together.
|
|
225
|
+
const linesFade = 1 - span(time, INTRO.gather, INTRO.gather + 500);
|
|
226
|
+
edges.forEach(([a, b], index) => {
|
|
227
|
+
const grow = easeOut(span(time, INTRO.lines + index * 70, INTRO.lines + index * 70 + 700));
|
|
228
|
+
if (!grow || !linesFade) return;
|
|
229
|
+
const from = at[a];
|
|
230
|
+
const to = at[b];
|
|
231
|
+
const gradient = pen.createLinearGradient(from.x, from.y, to.x, to.y);
|
|
232
|
+
gradient.addColorStop(0, ink(agents[a].hue, (light ? 0.3 : 0.22) * linesFade));
|
|
233
|
+
gradient.addColorStop(1, ink(agents[b].hue, (light ? 0.3 : 0.22) * linesFade));
|
|
234
|
+
pen.strokeStyle = gradient;
|
|
235
|
+
pen.lineWidth = 0.8;
|
|
236
|
+
pen.beginPath();
|
|
237
|
+
pen.moveTo(from.x, from.y);
|
|
238
|
+
pen.lineTo(from.x + (to.x - from.x) * grow, from.y + (to.y - from.y) * grow);
|
|
239
|
+
pen.stroke();
|
|
240
|
+
});
|
|
241
|
+
// The AIs: each comes in on its own, and goes into the line when the line reaches it.
|
|
242
|
+
agents.forEach((agent, index) => {
|
|
243
|
+
const shown = easeOut(span(time, INTRO.appear + index * 160, INTRO.appear + index * 160 + 600));
|
|
244
|
+
const taken = drawn >= lands[index] ? span(time, INTRO.draw + lands[index] * (INTRO.drawn - INTRO.draw) * 0.7, INTRO.draw + lands[index] * (INTRO.drawn - INTRO.draw) * 0.7 + 260) : 0;
|
|
245
|
+
const alpha = shown * (1 - taken);
|
|
246
|
+
if (!alpha) return;
|
|
247
|
+
const { x, y } = at[index];
|
|
248
|
+
const size = (2.8 - 0.8 * gather) * (1 + 0.5 * taken);
|
|
249
|
+
if (!light) {
|
|
250
|
+
const glow = pen.createRadialGradient(x, y, 0, x, y, size * 9);
|
|
251
|
+
glow.addColorStop(0, ink(agent.hue, 0.42 * alpha));
|
|
252
|
+
glow.addColorStop(1, ink(agent.hue, 0));
|
|
253
|
+
pen.fillStyle = glow;
|
|
254
|
+
pen.beginPath();
|
|
255
|
+
pen.arc(x, y, size * 9, 0, Math.PI * 2);
|
|
256
|
+
pen.fill();
|
|
257
|
+
}
|
|
258
|
+
pen.fillStyle = ink(agent.hue, alpha);
|
|
259
|
+
pen.beginPath();
|
|
260
|
+
pen.arc(x, y, size, 0, Math.PI * 2);
|
|
261
|
+
pen.fill();
|
|
262
|
+
});
|
|
263
|
+
// The pulse draws itself through them; then the beat, with one ring, and the name.
|
|
264
|
+
beat.style.strokeDashoffset = String(100 - 100 * drawn);
|
|
265
|
+
const beatIn = easeOut(span(time, INTRO.beat, INTRO.beat + 420));
|
|
266
|
+
dot.style.opacity = String(beatIn);
|
|
267
|
+
dot.style.transform = `scale(${0.4 + 0.6 * beatIn})`;
|
|
268
|
+
const ring = span(time, INTRO.beat + 60, INTRO.beat + 1000);
|
|
269
|
+
if (ring > 0 && ring < 1) {
|
|
270
|
+
const box = dot.getBoundingClientRect();
|
|
271
|
+
const stageBox = stage.getBoundingClientRect();
|
|
272
|
+
const rx = box.left + box.width / 2 - stageBox.left;
|
|
273
|
+
const ry = box.top + box.height / 2 - stageBox.top;
|
|
274
|
+
pen.strokeStyle = ink(light ? '#2f8a1c' : '#9bff66', 0.42 * (1 - easeOut(ring)));
|
|
275
|
+
pen.lineWidth = 1.2;
|
|
276
|
+
pen.beginPath();
|
|
277
|
+
pen.arc(rx, ry, box.width / 2 + easeOut(ring) * 46, 0, Math.PI * 2);
|
|
278
|
+
pen.stroke();
|
|
279
|
+
}
|
|
280
|
+
const wordIn = easeOut(span(time, INTRO.word, INTRO.word + 800));
|
|
281
|
+
word.style.opacity = String(wordIn);
|
|
282
|
+
word.style.transform = `translate(${193.5 + 10 * (1 - wordIn)}px, 7px)`;
|
|
283
|
+
if (time >= INTRO.hold) return end(false);
|
|
284
|
+
frame = requestAnimationFrame(paint);
|
|
285
|
+
}
|
|
286
|
+
// Any key or click goes straight on; Esc too, without closing the welcome under it.
|
|
287
|
+
const onKey = (event) => { event.preventDefault(); end(true); };
|
|
288
|
+
const onCancel = (event) => { event.preventDefault(); end(true); };
|
|
289
|
+
function end(early) {
|
|
290
|
+
if (done) return;
|
|
291
|
+
done = true;
|
|
292
|
+
cancelAnimationFrame(frame);
|
|
293
|
+
globalThis.removeEventListener('resize', onResize);
|
|
294
|
+
dialog.removeEventListener('keydown', onKey, true);
|
|
295
|
+
dialog.removeEventListener('cancel', onCancel);
|
|
296
|
+
stage.removeEventListener('click', onClick);
|
|
297
|
+
stage.classList.add('leaving');
|
|
298
|
+
if (early) stage.classList.add('fast');
|
|
299
|
+
dialog.classList.remove('intro');
|
|
300
|
+
dialog.classList.add('arriving');
|
|
301
|
+
setTimeout(() => stage.remove(), early ? 280 : INTRO.out);
|
|
302
|
+
// The welcome's own rise lasts a little longer than the stage takes to go.
|
|
303
|
+
setTimeout(() => dialog.classList.remove('arriving'), 1000);
|
|
304
|
+
resolve(true);
|
|
305
|
+
}
|
|
306
|
+
const onClick = () => end(true);
|
|
307
|
+
dialog.addEventListener('keydown', onKey, true);
|
|
308
|
+
dialog.addEventListener('cancel', onCancel);
|
|
309
|
+
stage.addEventListener('click', onClick);
|
|
310
|
+
frame = requestAnimationFrame(paint);
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// A PROJECT OPENS AGAIN (2026-10-28): its own opening, shorter than the welcome's and not the same — the
|
|
315
|
+
// pulse is traced in one stroke, its dot beats once with a ring, and where the welcome writes MADRE the
|
|
316
|
+
// project writes its own name; then everything comes closer and fades, and the room is under it. About
|
|
317
|
+
// a second and a half; a click or any key goes straight on, and less motion skips it (app.js).
|
|
318
|
+
export function playProjectOpening(dialog, { name = '', skipLabel = 'Skip' } = {}) {
|
|
319
|
+
if (globalThis.matchMedia?.('(prefers-reduced-motion: reduce)').matches) return Promise.resolve(false);
|
|
320
|
+
return new Promise((resolve) => {
|
|
321
|
+
const stage = make('div', 'wl-intro po-stage');
|
|
322
|
+
const mark = make('div', 'po-mark');
|
|
323
|
+
mark.setAttribute('aria-hidden', 'true');
|
|
324
|
+
const pulse = make('span', 'po-pulse');
|
|
325
|
+
pulse.innerHTML = '<svg viewBox="-2 -12 76 44" aria-hidden="true"><path class="po-beat" d="M1 10H16L20 10L23.5 2L28 18L32 10L35 10L37 6L39 10H52" pathLength="100" fill="none" stroke-width="2.1" stroke-linecap="round" stroke-linejoin="round"/><circle class="po-ring" cx="60" cy="10" r="3" fill="none" stroke-width="1"/><circle class="po-dot" cx="60" cy="10" r="3"/></svg>'; // trusted: our own SVG string
|
|
326
|
+
mark.append(pulse, make('span', 'po-name', name));
|
|
327
|
+
const skip = make('button', 'wl-intro-skip', skipLabel);
|
|
328
|
+
skip.type = 'button';
|
|
329
|
+
stage.append(mark, skip);
|
|
330
|
+
dialog.append(stage);
|
|
331
|
+
dialog.classList.add('intro');
|
|
332
|
+
let done = false;
|
|
333
|
+
const end = () => {
|
|
334
|
+
if (done) return;
|
|
335
|
+
done = true;
|
|
336
|
+
clearTimeout(timer);
|
|
337
|
+
dialog.removeEventListener('keydown', onKey, true);
|
|
338
|
+
dialog.removeEventListener('cancel', onKey);
|
|
339
|
+
stage.classList.add('po-leaving');
|
|
340
|
+
dialog.classList.remove('intro');
|
|
341
|
+
setTimeout(() => stage.remove(), 520);
|
|
342
|
+
resolve(true);
|
|
343
|
+
};
|
|
344
|
+
const onKey = (event) => { event.preventDefault(); end(); };
|
|
345
|
+
const timer = setTimeout(end, 1500);
|
|
346
|
+
dialog.addEventListener('keydown', onKey, true);
|
|
347
|
+
dialog.addEventListener('cancel', onKey);
|
|
348
|
+
stage.addEventListener('click', end);
|
|
349
|
+
});
|
|
350
|
+
}
|
package/public/macroverso.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
2
|
-
// MADRE · © 2026 Jossue Alcalá ·
|
|
1
|
+
// SPDX-License-Identifier: BUSL-1.1
|
|
2
|
+
// MADRE · © 2026 Jossue Alcalá · Business Source License 1.1: LICENSE
|
|
3
3
|
// THE MACROVERSE: every room on this Mac as a NOSTROMO in open space (docs/MACROVERSO.md, phase 3a).
|
|
4
4
|
// It is entered from SALAS and only on a large screen; on a phone SALAS is the list and nothing more.
|
|
5
5
|
//
|
|
@@ -24,8 +24,9 @@
|
|
|
24
24
|
// for less motion gets one still frame redrawn when something changes. No line joins two universes
|
|
25
25
|
// until a link exists (phase 3c).
|
|
26
26
|
|
|
27
|
-
import { COLLAPSED, FOCUS_VEIL, MEMORY_COLORS, NEURAL_AXON, NEURAL_CROSSFADE, NEURAL_IGNITION, PITCH_LIMIT, TURN_PER_PIXEL, alongCurve, collapsedChip, createNostromo, currentAlong, drawNeuralBulb, dwarfChip, hexAlpha, hexMix, magmaMap, neuralGround, neuronGlow, texturesReady } from './nostromo-engine.js';
|
|
28
|
-
import { createStrain, inviteNeural, neuralKey, paintNeuralKey } from './neural.js';
|
|
27
|
+
import { COLLAPSED, FOCUS_VEIL, MEMORY_COLORS, NEURAL_AXON, NEURAL_COLORS, NEURAL_CROSSFADE, NEURAL_IGNITION, PITCH_LIMIT, TURN_PER_PIXEL, alongCurve, collapsedChip, createNostromo, currentAlong, drawNeuralBulb, dwarfChip, hexAlpha, hexMix, magmaMap, neuralGround, neuronChip, neuronGlow, texturesReady } from './nostromo-engine.js';
|
|
28
|
+
import { createStrain, inviteNeural, neuralKey, paintNeuralKey, tellViews } from './neural.js';
|
|
29
|
+
import { trazo } from './icons.js';
|
|
29
30
|
|
|
30
31
|
const KINDS = Object.keys(MEMORY_COLORS);
|
|
31
32
|
const TILT = 0.42; // how flat the orbits read: the plane seen a little from above
|
|
@@ -301,8 +302,12 @@ function bishopOrb() {
|
|
|
301
302
|
return { canvas, wisps, reach: REACH, paint, paintedAt: -1 };
|
|
302
303
|
}
|
|
303
304
|
|
|
304
|
-
// How big a universe reads at zoom 1, in css px of radius:
|
|
305
|
-
|
|
305
|
+
// How big a universe reads at zoom 1, in css px of radius: the more it knows, the bigger
|
|
306
|
+
// (2026-10-28), plainly enough to tell one project from another, and never past a size that looks
|
|
307
|
+
// wrong beside the rest.
|
|
308
|
+
const REACH_SMALL = 52;
|
|
309
|
+
const REACH_BIG = 140;
|
|
310
|
+
const reachOf = (room) => Math.min(REACH_BIG, REACH_SMALL + 18 * Math.log2(1 + (room.glance?.census?.memories ?? 0) / 8));
|
|
306
311
|
|
|
307
312
|
// A scene for the engine: everything it reads, and nothing of a room's page. `bare`: no sky, no
|
|
308
313
|
// stars, no vignette — the space around it is this file's to draw.
|
|
@@ -434,22 +439,27 @@ export function openMacroverso({ host, rooms, here, enlaces = [], accent = '#9bf
|
|
|
434
439
|
const legend = document.createElement('span');
|
|
435
440
|
legend.className = 'nostromo-legend';
|
|
436
441
|
legend.setAttribute('aria-label', words.legend ?? 'Memory kinds');
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
const
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
442
|
+
// In the neural drawing each kind is the neuron the Memory map draws (2026-10-28): alive, going out
|
|
443
|
+
// when it is not used, dead when it is doubtful (app.js, paintLegend).
|
|
444
|
+
const paintLegend = (asNeurons) => {
|
|
445
|
+
const chips = [];
|
|
446
|
+
for (const [kind, hex] of Object.entries(MEMORY_COLORS)) {
|
|
447
|
+
const chip = document.createElement('span');
|
|
448
|
+
chip.className = `k ${kind}`;
|
|
449
|
+
const said = document.createElement('i');
|
|
450
|
+
said.textContent = words.kinds?.[kind] ?? kind;
|
|
451
|
+
chip.append(asNeurons ? neuronChip(NEURAL_COLORS[kind] ?? hex, 16, kind === COLLAPSED ? 'dead' : 'alive') : kind === COLLAPSED ? collapsedChip(hex, 14) : dwarfChip(hex, 14), said);
|
|
452
|
+
chips.push(chip);
|
|
453
|
+
}
|
|
446
454
|
const chip = document.createElement('span');
|
|
447
455
|
chip.className = 'k dim';
|
|
448
456
|
const said = document.createElement('i');
|
|
449
457
|
said.textContent = words.kinds?.dim ?? 'Out of circulation';
|
|
450
|
-
chip.append(dwarfChip(hexMix(MEMORY_COLORS.fact, '#0b0f16', 0.52), 14), said);
|
|
451
|
-
|
|
452
|
-
|
|
458
|
+
chip.append(asNeurons ? neuronChip(NEURAL_COLORS.fact, 16, 'spent') : dwarfChip(hexMix(MEMORY_COLORS.fact, '#0b0f16', 0.52), 14), said);
|
|
459
|
+
chips.push(chip);
|
|
460
|
+
legend.replaceChildren(...chips);
|
|
461
|
+
};
|
|
462
|
+
paintLegend(Boolean(neuralStart));
|
|
453
463
|
const keys = document.createElement('span');
|
|
454
464
|
keys.className = 'nostromo-actions';
|
|
455
465
|
const recenter = document.createElement('button');
|
|
@@ -466,7 +476,7 @@ export function openMacroverso({ host, rooms, here, enlaces = [], accent = '#9bf
|
|
|
466
476
|
back.className = 'surface-mode close x-close x-only mv-back';
|
|
467
477
|
back.setAttribute('aria-label', words.back);
|
|
468
478
|
back.title = words.back;
|
|
469
|
-
back.insertAdjacentHTML('beforeend',
|
|
479
|
+
back.insertAdjacentHTML('beforeend', `<span class="x-icon">${trazo('close')}</span>`); // trusted: our own SVG
|
|
470
480
|
backTrack.append(back);
|
|
471
481
|
// Neural mode (public/neural.js): the same space drawn as neurons, chosen here or in a project.
|
|
472
482
|
const neuralButton = document.createElement('button');
|
|
@@ -480,7 +490,8 @@ export function openMacroverso({ host, rooms, here, enlaces = [], accent = '#9bf
|
|
|
480
490
|
card.hidden = true;
|
|
481
491
|
const hint = document.createElement('p');
|
|
482
492
|
hint.className = 'mv-hint';
|
|
483
|
-
|
|
493
|
+
// A line of words, or the keys to move round it (public/neural.js, mapKeys).
|
|
494
|
+
if (typeof Node === 'function' && words.hint instanceof Node) hint.append(words.hint); else hint.textContent = words.hint;
|
|
484
495
|
layer.append(canvas, head, card, hint);
|
|
485
496
|
host.append(layer);
|
|
486
497
|
|
|
@@ -530,6 +541,7 @@ export function openMacroverso({ host, rooms, here, enlaces = [], accent = '#9bf
|
|
|
530
541
|
neural = on;
|
|
531
542
|
neuralSince = on && !reduced ? clock : null;
|
|
532
543
|
paintNeuralKey(neuralButton, on);
|
|
544
|
+
paintLegend(on);
|
|
533
545
|
layer.querySelector('.neural-invite')?.remove();
|
|
534
546
|
const now = performance.now() / 1000;
|
|
535
547
|
for (const one of universes) {
|
|
@@ -544,6 +556,11 @@ export function openMacroverso({ host, rooms, here, enlaces = [], accent = '#9bf
|
|
|
544
556
|
neuralButton.addEventListener('click', () => setNeuralMode(!neural));
|
|
545
557
|
// When this machine does not give the space its frames, the key invites to try the mode.
|
|
546
558
|
const strain = createStrain({ onStrain: () => { if (!neural) inviteNeural({ key: neuralButton, host: layer, map: 'projects', onTry: () => setNeuralMode(true) }); } });
|
|
559
|
+
// The two drawings, said once (2026-10-28): Home keeps that it was said (salas-mac.js, the tour).
|
|
560
|
+
setTimeout(() => {
|
|
561
|
+
if (!layer.isConnected || !actions.mayTellViews?.()) return;
|
|
562
|
+
if (tellViews({ key: neuralButton, host: layer, neural, onSwitch: () => setNeuralMode(!neural) })) actions.toldViews?.();
|
|
563
|
+
}, 2200);
|
|
547
564
|
const motes = Array.from({ length: ORB_MOTES }, (_, i) => { const rnd = random(hash(`mote${i}`)); return { phase: rnd() * Math.PI * 2, reach: 1.3 + rnd() * 0.65, speed: 0.12 + rnd() * 0.2, tilt: (rnd() - 0.5) * 0.5, size: 0.35 + rnd() * 0.6 }; });
|
|
548
565
|
|
|
549
566
|
function layout(all) {
|
|
@@ -1029,6 +1046,23 @@ export function openMacroverso({ host, rooms, here, enlaces = [], accent = '#9bf
|
|
|
1029
1046
|
ctx.globalAlpha = awake ? 1 : 0.8;
|
|
1030
1047
|
ctx.drawImage(orb.canvas, p.x - r, p.y - r, r * 2, r * 2);
|
|
1031
1048
|
ctx.globalAlpha = 1;
|
|
1049
|
+
// Volume (2026-10-28): the light comes from the upper left, as its atmosphere says; the far side
|
|
1050
|
+
// falls into a soft night and a sheen sits where the light strikes, so it reads as a sphere.
|
|
1051
|
+
ctx.save();
|
|
1052
|
+
ctx.beginPath(); ctx.arc(p.x, p.y, r, 0, Math.PI * 2); ctx.clip();
|
|
1053
|
+
const night = ctx.createLinearGradient(p.x - r * 0.72, p.y - r * 0.78, p.x + r * 0.82, p.y + r * 0.88);
|
|
1054
|
+
night.addColorStop(0, 'rgba(6, 4, 20, 0)');
|
|
1055
|
+
night.addColorStop(0.5, 'rgba(6, 4, 20, 0.08)');
|
|
1056
|
+
night.addColorStop(1, `rgba(6, 4, 20, ${0.55 * (awake ? 1 : 0.8)})`);
|
|
1057
|
+
ctx.fillStyle = night;
|
|
1058
|
+
ctx.fillRect(p.x - r, p.y - r, r * 2, r * 2);
|
|
1059
|
+
ctx.globalCompositeOperation = 'lighter';
|
|
1060
|
+
const sheen = ctx.createRadialGradient(p.x - r * 0.4, p.y - r * 0.44, 0, p.x - r * 0.4, p.y - r * 0.44, r * 0.6);
|
|
1061
|
+
sheen.addColorStop(0, `rgba(236, 228, 255, ${0.24 * life})`);
|
|
1062
|
+
sheen.addColorStop(1, 'rgba(236, 228, 255, 0)');
|
|
1063
|
+
ctx.fillStyle = sheen;
|
|
1064
|
+
ctx.fillRect(p.x - r, p.y - r, r * 2, r * 2);
|
|
1065
|
+
ctx.restore();
|
|
1032
1066
|
// Its own thin atmosphere, brighter on the side the light comes from.
|
|
1033
1067
|
ctx.globalCompositeOperation = 'lighter';
|
|
1034
1068
|
const limb = ctx.createRadialGradient(p.x - r * 0.1, p.y - r * 0.12, r * 0.9, p.x, p.y, r * 1.14);
|
|
@@ -1229,7 +1263,7 @@ export function openMacroverso({ host, rooms, here, enlaces = [], accent = '#9bf
|
|
|
1229
1263
|
shut.setAttribute('aria-label', words.close ?? 'Close');
|
|
1230
1264
|
const cross = document.createElement('span');
|
|
1231
1265
|
cross.className = 'x-icon';
|
|
1232
|
-
cross.innerHTML = '
|
|
1266
|
+
cross.innerHTML = trazo('close');
|
|
1233
1267
|
shut.append(cross);
|
|
1234
1268
|
track.append(shut);
|
|
1235
1269
|
head.append(kind, track);
|
|
@@ -1577,6 +1611,9 @@ export function openMacroverso({ host, rooms, here, enlaces = [], accent = '#9bf
|
|
|
1577
1611
|
// the new size, the sprites only if the density changed.
|
|
1578
1612
|
const onResize = () => { clearTimeout(resizeTimer); resizeTimer = setTimeout(() => { size(); layout(rooms); redraw(); }, 150); };
|
|
1579
1613
|
window.addEventListener('resize', onResize);
|
|
1614
|
+
// As a window (salas-mac.js, homeWindow) it is sized by its own sides, not the browser's.
|
|
1615
|
+
const sized = typeof ResizeObserver === 'function' ? new ResizeObserver(() => { if (view.w && Math.abs(layer.getBoundingClientRect().width - view.w) + Math.abs(layer.getBoundingClientRect().height - view.h) > 1) onResize(); }) : null;
|
|
1616
|
+
sized?.observe(layer);
|
|
1580
1617
|
const onVisible = () => { if (!document.hidden && !raf && !reduced) { last = performance.now(); if (live) live.last = last; raf = requestAnimationFrame(frame); } else if (document.hidden && raf) { cancelAnimationFrame(raf); raf = 0; } };
|
|
1581
1618
|
document.addEventListener('visibilitychange', onVisible);
|
|
1582
1619
|
|
|
@@ -1587,6 +1624,7 @@ export function openMacroverso({ host, rooms, here, enlaces = [], accent = '#9bf
|
|
|
1587
1624
|
live = null;
|
|
1588
1625
|
document.removeEventListener('keydown', onKey);
|
|
1589
1626
|
window.removeEventListener('resize', onResize);
|
|
1627
|
+
sized?.disconnect();
|
|
1590
1628
|
document.removeEventListener('visibilitychange', onVisible);
|
|
1591
1629
|
layer.classList.add('leaving');
|
|
1592
1630
|
setTimeout(() => layer.remove(), reduced ? 0 : 260);
|
|
@@ -1606,5 +1644,6 @@ export function openMacroverso({ host, rooms, here, enlaces = [], accent = '#9bf
|
|
|
1606
1644
|
return {
|
|
1607
1645
|
update(next, nextEnlaces = enlaces) { rooms = next; enlaces = nextEnlaces; layout(next); redraw(); },
|
|
1608
1646
|
close,
|
|
1647
|
+
layer,
|
|
1609
1648
|
};
|
|
1610
1649
|
}
|