This commit is contained in:
Andras Schmelczer 2026-05-19 21:03:53 +01:00
commit 7c70f15e49
65 changed files with 1122 additions and 1906 deletions

View file

@ -28,6 +28,7 @@ import {
} from './utils/error-handler';
import { initializeGpu } from './utils/graphics/initialize-gpu';
import { clamp01 } from './utils/math';
import { rgbColorToCss } from './utils/rgb-color';
import { VIBE_PRESETS } from './vibes';
const AUDIO_VOLUME_STEP = 0.01;
@ -358,7 +359,7 @@ const renderAudioUi = (game: GameLoop | null) => {
const renderPaletteUi = (game: GameLoop | null) => {
elements.swatches.forEach((swatch, index) => {
swatch.style.backgroundColor = activeVibe.colors[index];
swatch.style.backgroundColor = rgbColorToCss(activeVibe.colors[index]);
swatch.classList.toggle(
CSS_CLASSES.active,
settings.selectedColorIndex === index && !isEraserActive
@ -368,7 +369,7 @@ const renderPaletteUi = (game: GameLoop | null) => {
game?.setEraseMode(isEraserActive);
document.documentElement.style.setProperty(
CSS_VARIABLES.gardenBackground,
activeVibe.backgroundColor
rgbColorToCss(activeVibe.backgroundColor)
);
};
@ -471,7 +472,7 @@ const main = async () => {
new FullScreenHandler(
elements.minimizeFullScreenButton,
elements.maximizeFullScreenButton,
document.body
document.documentElement
);
const startAudioFromUserGesture = (event: Event) => {
@ -599,7 +600,7 @@ const main = async () => {
elements.export4k.disabled = true;
try {
await game.export4K();
await game.exportSnapshot();
trackExport({ vibeId: activeVibe.id });
} catch (error) {
ErrorHandler.addException(error, { severity: Severity.WARNING });
@ -716,7 +717,7 @@ const main = async () => {
});
}
// Keep the toolbar/dock hidden until the user actually starts drawing.
// Keep the dev stats overlay hidden until the user actually starts drawing.
document.body.classList.add(CSS_CLASSES.preDrawing);
elements.canvas.addEventListener(
DOM_EVENTS.pointerDown,