metronome/src/infoembed.js
Me Here 9e5c79b3b2 Split each form factor into a lean widget page + a separate info page
Previously every device .html bundled its full narrative (purpose, BOM,
dimensioned drawings, embedding docs) inside a #techinfo block that embed
mode (?embed=1) only CSS-hid — so every embedder and every landing-page
iframe downloaded all of it (showcase 77%, teacher 49% of the file) for
content no embedder ever sees.

Now:
  - <device>.html is the lean widget only: header + front view/controls +
    title + summary + program box. ?embed=1 still collapses to the bare
    widget; the heavy narrative is gone from the payload.
  - info-<device>.html (new, one per form factor) carries all the words —
    purpose, dimensions, priced BOM, embedding docs — and embeds the live
    widget at the top via the existing iframe + auto-resize protocol
    (new shared src/infoembed.html + src/infoembed.js).
  - Each device links out to its info page ("…dimensions & BOM →"); the
    landing panes and viewport bar now offer both Open ↗ and Specs & info ⓘ.
  - Dropped the now-dead "Show info" toggle (CSS + progbox.js).

Branding: adopt the official VARASYS "tagline on the bottom" logos from the
brand kit (light-background variant now matches; dark already did). The
tagline is baked into the PNGs, so remove the CSS .brand-tag / .dev-tag
spans and the showcase canvas-drawn tagline. Brand cyan #0AB3F7 / navy
#1C283F already match the official palette.

build.sh / deploy.sh: build + deploy the six new info-*.html pages.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 14:18:23 -05:00

21 lines
1.1 KiB
JavaScript

/* Info-page live widget loader — assembled into each info-<device>.html by build.sh.
The host page sets window.INFO_DEVICE = {file, name}. This builds the embedded widget
(<device>.html?embed=1, which loads the default set lists) and auto-sizes the iframe
from the {type:'varasys-h'} height the widget posts back. Defers to DOM-ready. */
(function () {
function init() {
var d = window.INFO_DEVICE || { file: "/editor.html", name: "PolyMeter" };
var ifr = document.getElementById("ifr"),
nm = document.getElementById("ivName"),
op = document.getElementById("ivOpen");
if (nm) nm.innerHTML = "<b>" + d.name + "</b>";
if (op) op.href = d.file;
if (ifr) ifr.src = d.file + "?embed=1";
}
addEventListener("message", function (e) {
var ifr = document.getElementById("ifr");
if (!e.data || !ifr || e.source !== ifr.contentWindow) return;
if (e.data.type === "varasys-h" && typeof e.data.h === "number") ifr.style.height = e.data.h + "px";
});
if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", init); else init();
})();