From 3d85a8e981e3f67a3e00f98133583f14af2494a8 Mon Sep 17 00:00:00 2001 From: b1rdmania <102524336+b1rdmania@users.noreply.github.com> Date: Mon, 29 Dec 2025 13:41:46 +0000 Subject: [PATCH] Fix scroll during generate, restore Claude Code easter egg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Preserve scroll position when clicking Generate - Add back "Ps. Built with Claude Code" in FAQ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- index.html | 4 ++++ src/main.ts | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/index.html b/index.html index 78afdba..6e71b94 100644 --- a/index.html +++ b/index.html @@ -1228,6 +1228,10 @@

Why "Enable Audio" on iPhone?

Apple blocks sound until you tap. Hit the button once and you're good.

+
+

Ps.

+

Built with Claude Code.

+
diff --git a/src/main.ts b/src/main.ts index 91b0c25..03f2f3b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -509,8 +509,11 @@ class MotifApp { await unlockAudio(); this.updateIOSAudioBanner(); + // Preserve scroll position during state change + const scrollY = window.scrollY; // Once generation starts: lock into generated experience mode. this.setState('generated'); + window.scrollTo(0, scrollY); this.updateStatus('Generating…'); this.motifBtn.disabled = true; this.playPauseBtn.disabled = true; @@ -538,7 +541,9 @@ class MotifApp { this.updateStatus(''); this.hasGenerated = true; // Refresh generated state now that generation succeeded (enables Copy link, etc.) + const scrollYEnd = window.scrollY; this.setState('generated'); + window.scrollTo(0, scrollYEnd); } catch (error) { this.updateStatus(`Motif error: ${error instanceof Error ? error.message : 'Unknown error'}`); this.motifBtn.disabled = false;