Skip to content

Commit

Permalink
add visualizer help prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
terryzfeng committed Oct 3, 2024
1 parent 2e75da2 commit 82f72f5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@
<div id="console" class="bg-white dark:bg-dark-2 h-full"></div>
</div>
<div id="visualizerContainer" class="flex-1 bg-white dark:bg-dark-2 hidden">
<div id="visualizer-help" class="w-full h-full flex items-center justify-center text-[#666] dark:text-[#bbb] transition">
<b>Start WebChucK for visualizer</b>
</div>
<canvas id="visualizer" class="w-full h-full"></canvas>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/gui/gui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const BUTTON_MARGIN = 10 * RATIO;
const BUTTON_SIZE = 70 * RATIO;
const SLIDER_MARGIN = 15 * RATIO;
const SLIDER_HEIGHT = 48 * RATIO;
const TITLE_SIZE = 15 * RATIO;
const TITLE_SIZE = 16 * RATIO;
const SLIDERS_PER_ROW = 2;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/components/visualizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export default class Visualizer {
private spectrumFill: string = spectrumFillLight;

constructor(canvas: HTMLCanvasElement, analyserNode: AnalyserNode) {
document.getElementById("visualizer-help")?.remove();

const visualizerDefaultOptions = {
frameSize: 2048,
drawWaveform: true,
Expand All @@ -57,8 +59,6 @@ export default class Visualizer {
this.frequencyData = new Float32Array(
visualizerDefaultOptions.frameSize / 2
);

// Set theme
this.theme(getColorScheme() === "dark");
}

Expand Down
2 changes: 1 addition & 1 deletion src/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export async function startChuck() {
.then(() => theChuck.runFile("scoreplayer.ck")),
]);
} catch (error) {
// Failed to load EZScore
console.error("Failed to load EZScore", error);
}
}

Expand Down

0 comments on commit 82f72f5

Please sign in to comment.