Give the colour wash a roomier frame

Nothing else is on screen while the wash runs, so the frame does not
have to leave space for a second one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tg15tLAuT6NrCE1ZxKVgDB
This commit is contained in:
simon
2026-08-09 23:31:32 +02:00
co-authored by Claude Opus 5
parent 223292708f
commit f55298ff4f
2 changed files with 11 additions and 3 deletions
+7 -3
View File
@@ -20,6 +20,7 @@ import {
TRAIL_LENGTH,
TRAIL_FADE_SECONDS,
WASH_CYCLE_SECONDS,
WASH_FRAME_SCALE,
WASH_SPREAD,
WASH_STRENGTH,
AUTO_ANIMATION,
@@ -45,8 +46,8 @@ export function frameSize(viewportWidth, viewportHeight, scale = FRAME_SCALE) {
}
/** Size the frame to the current viewport and report the size back. */
function applyFrameSize(element) {
const size = frameSize(window.innerWidth, window.innerHeight);
function applyFrameSize(element, scale = FRAME_SCALE) {
const size = frameSize(window.innerWidth, window.innerHeight, scale);
element.style.width = `${size.width}px`;
element.style.height = `${size.height}px`;
return size;
@@ -943,7 +944,7 @@ export function startWash({ element }) {
element.classList.add('washing');
function centre() {
const size = applyFrameSize(element);
const size = applyFrameSize(element, WASH_FRAME_SCALE);
place(element, (window.innerWidth - size.width) / 2, (window.innerHeight - size.height) / 2);
}
@@ -975,6 +976,9 @@ export function startWash({ element }) {
wash.remove();
element.classList.remove('washing');
element.style.removeProperty('--wash');
// Same reason as the drag animation: the next one sizes the frame itself,
// but a wash-sized frame left up for one paint would flash.
applyFrameSize(element);
};
}