basic hydra integration

This commit is contained in:
Felix Roos 2023-10-26 13:05:54 +02:00
parent 05095805f1
commit 7f3cdedef9
7 changed files with 261 additions and 44 deletions

11
packages/hydra/hydra.mjs Normal file
View file

@ -0,0 +1,11 @@
export async function initHydra() {
if (!document.getElementById('hydra-canvas')) {
await import('https://unpkg.com/hydra-synth');
const testCanvas = document.getElementById('test-canvas');
const hydraCanvas = testCanvas.cloneNode(true);
hydraCanvas.id = 'hydra-canvas';
testCanvas.after(hydraCanvas);
new Hydra({ canvas: hydraCanvas, detectAudio: false });
s0.init({ src: testCanvas });
}
}