Canvas height now derives from column width via aspect-ratio (CSS custom prop --canvas-aspect set by JS on the grid host), with --panel-h as a ceiling. Dropdown options: scaled/locked × 1:1/3:2. Default scaled 3:2. Legacy 'independent'/'locked' values still parse. Canvas resizes after aspect changes via requestAnimationFrame.
16 lines
532 B
JavaScript
16 lines
532 B
JavaScript
// compare.js — thin shim that parses ?stem=…&stem=… (legacy ?a=&b=) and
|
|
// hands off to panel-grid.js.
|
|
|
|
import { mountPanels } from './panel-grid.js?v=4';
|
|
|
|
const params = new URLSearchParams(window.location.search);
|
|
let stems = params.getAll('stem').filter(Boolean);
|
|
if (stems.length === 0) {
|
|
stems = [params.get('a') || '', params.get('b') || ''].filter(Boolean);
|
|
}
|
|
|
|
const host = document.getElementById('panel-host');
|
|
const controls = document.getElementById('compare-controls');
|
|
|
|
mountPanels({ host, controls, stems });
|