Files

35 lines
1.2 KiB
HTML
Raw Permalink Normal View History

2026-07-04 09:47:50 -04:00
<!DOCTYPE html>
<html>
<head><meta charset="UTF-8"><style>html,body{margin:0;background:#000}canvas{display:block}</style></head>
<body>
<canvas id="c"></canvas>
<script type="module">
import { generateUmbel } from '../src/milkweed/umbel.js';
import { renderWatercolor } from '../src/render/watercolor.js';
const q = new URLSearchParams(location.search);
const params = {
seed: q.get('seed') || 'ASCLEPIAS-0001',
palette: 'milkweed',
paperTone: 'cream', toneStrength: 1, paperBright: 1.06, glow: 0.5,
saturation: 1, hueShift: 0, size: 1, density: 1, depth: 0, aging: 0,
showHeader: true,
};
// pass through any query param (numbers/bools), incl. wc* dials and umbel* knobs
for (const [k, v] of q) {
if (k === 'size_px' || k === 'hq') continue;
params[k] = (v === 'true') ? true : (v === 'false') ? false : (isNaN(+v) ? v : +v);
}
const SIZE = +(q.get('size_px') || 1200);
const c = document.getElementById('c');
c.width = c.height = SIZE;
const ctx = c.getContext('2d', { willReadFrequently: true });
const scene = generateUmbel(params);
renderWatercolor(ctx, SIZE, SIZE, scene, params, { preview: q.get('hq') !== '1' });
document.title = 'done';
window.__done = true;
</script>
</body>
</html>