mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-26 21:18:49 +00:00
format
This commit is contained in:
parent
e0e896d4b5
commit
fb7a9e2083
@ -3,7 +3,7 @@ import { getDrawContext } from '@strudel.cycles/core';
|
|||||||
let audio = false;
|
let audio = false;
|
||||||
let hydra;
|
let hydra;
|
||||||
|
|
||||||
function appendCanvas(c){
|
function appendCanvas(c) {
|
||||||
const { canvas: testCanvas } = getDrawContext();
|
const { canvas: testCanvas } = getDrawContext();
|
||||||
c.canvas.id = 'hydra-canvas';
|
c.canvas.id = 'hydra-canvas';
|
||||||
c.canvas.style.position = 'absolute';
|
c.canvas.style.position = 'absolute';
|
||||||
@ -22,12 +22,12 @@ export async function initHydra(config) {
|
|||||||
|
|
||||||
// if config.audio is true
|
// if config.audio is true
|
||||||
// and current canvas des not detect audio
|
// and current canvas des not detect audio
|
||||||
if (config?.audio && !hydra.detectAudio ){
|
if (config?.audio && !hydra.detectAudio) {
|
||||||
//remove previous canvas without audio detection
|
//remove previous canvas without audio detection
|
||||||
document.getElementById('hydra-canvas').remove()
|
document.getElementById('hydra-canvas').remove();
|
||||||
// create and append a new audio responsive canvas
|
// create and append a new audio responsive canvas
|
||||||
hydra = new Hydra({ detectAudio: audio});
|
hydra = new Hydra({ detectAudio: audio });
|
||||||
appendCanvas(hydra)
|
appendCanvas(hydra);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user