index.js
443 B · javascript · 14 lines
1import { run } from './frame.js';2import { matrix } from './matrix.js';3import { sleep } from './sleep.js';4import { mandelbrot, julia } from './fractal.js';56export const SAVERS = ['matrix', 'sleep', 'mandelbrot', 'julia'];78const MAKE = { matrix, sleep, mandelbrot, julia };910export function saver(canvas, name = SAVERS[0], opts = {}) {11 const make = MAKE[name];12 if (!canvas || !make) return () => {};13 return run(canvas, make, opts);14}