style: auto-fix linting issues

This commit is contained in:
EduardPrigoana 2026-02-09 10:49:11 +00:00 committed by github-actions[bot]
parent 7c568030af
commit a308d380b9
2 changed files with 3990 additions and 2835 deletions

View file

@ -1,11 +1,10 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Butterchurn Demo Fixed</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="https://unpkg.com/normalize.css/normalize.css" />
<style>
@ -60,10 +59,13 @@
</div>
<div id="presetControls">
<label>Preset: <select id="presetSelect"></select></label>
<label>Cycle: <input type="checkbox" id="presetCycle" checked></label>
<label>Seconds: <input type="number" id="presetCycleLength" value="15" min="1"></label>
<label>Random: <input type="checkbox" id="presetRandom" checked></label>
<label
>Preset:
<select id="presetSelect"></select
></label>
<label>Cycle: <input type="checkbox" id="presetCycle" checked /></label>
<label>Seconds: <input type="number" id="presetCycleLength" value="15" min="1" /></label>
<label>Random: <input type="checkbox" id="presetRandom" checked /></label>
</div>
<canvas id="canvas" width="800" height="600"></canvas>
@ -114,8 +116,8 @@
function loadLocalFiles(files, index = 0) {
audioContext.resume();
const reader = new FileReader();
reader.onload = e => {
audioContext.decodeAudioData(e.target.result, buffer => {
reader.onload = (e) => {
audioContext.decodeAudioData(e.target.result, (buffer) => {
playBufferSource(buffer);
setTimeout(() => {
if (files.length > index + 1) loadLocalFiles(files, index + 1);
@ -145,7 +147,7 @@
function prevPreset(blendTime = 5.7) {
if (presetIndexHist.length > 0) presetIndex = presetIndexHist.pop();
else presetIndex = ((presetIndex - 1) + presetKeys.length) % presetKeys.length;
else presetIndex = (presetIndex - 1 + presetKeys.length) % presetKeys.length;
visualizer.loadPreset(presets[presetKeys[presetIndex]], blendTime);
document.getElementById('presetSelect').value = presetIndex;
}
@ -179,7 +181,7 @@
width: canvas.width,
height: canvas.height,
pixelRatio: window.devicePixelRatio || 1,
textureRatio: 1
textureRatio: 1,
});
nextPreset(0);
@ -193,7 +195,7 @@
input.type = 'file';
input.accept = 'audio/*';
input.multiple = true;
input.onchange = e => loadLocalFiles(e.target.files);
input.onchange = (e) => loadLocalFiles(e.target.files);
input.click();
};
@ -212,30 +214,32 @@
visualizer.loadPreset(presets[presetKeys[presetIndex]], 5.7);
};
document.getElementById('presetCycle').onchange = e => {
document.getElementById('presetCycle').onchange = (e) => {
presetCycle = e.target.checked;
restartCycleInterval();
};
document.getElementById('presetCycleLength').onchange = e => {
document.getElementById('presetCycleLength').onchange = (e) => {
presetCycleLength = parseInt(e.target.value) * 1000;
restartCycleInterval();
};
document.getElementById('presetRandom').onchange = e => {
document.getElementById('presetRandom').onchange = (e) => {
presetRandom = e.target.checked;
};
// Start on first user click (required for autoplay policies)
document.body.addEventListener('click', () => {
document.body.addEventListener(
'click',
() => {
if (!audioContext) initPlayer();
}, { once: true });
},
{ once: true }
);
</script>
<!-- Load Butterchurn presets as global scripts -->
<script src="https://unpkg.com/butterchurn-presets@3.0.0-beta.4/dist/base.min.js"></script>
<script src="https://unpkg.com/butterchurn-presets@3.0.0-beta.4/dist/extra.min.js"></script>
</body>
</html>

2193
index.html

File diff suppressed because one or more lines are too long