Fix scroll during generate, restore Claude Code easter egg

- 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 <noreply@anthropic.com>
This commit is contained in:
b1rdmania
2025-12-29 13:41:46 +00:00
parent 3b1130659e
commit 3d85a8e981
2 changed files with 9 additions and 0 deletions
+4
View File
@@ -1228,6 +1228,10 @@
<h4>Why "Enable Audio" on iPhone?</h4> <h4>Why "Enable Audio" on iPhone?</h4>
<p>Apple blocks sound until you tap. Hit the button once and you're good.</p> <p>Apple blocks sound until you tap. Hit the button once and you're good.</p>
</div> </div>
<div class="faq-item">
<h4>Ps.</h4>
<p>Built with Claude Code.</p>
</div>
</div> </div>
</main> </main>
</div> </div>
+5
View File
@@ -509,8 +509,11 @@ class MotifApp {
await unlockAudio(); await unlockAudio();
this.updateIOSAudioBanner(); this.updateIOSAudioBanner();
// Preserve scroll position during state change
const scrollY = window.scrollY;
// Once generation starts: lock into generated experience mode. // Once generation starts: lock into generated experience mode.
this.setState('generated'); this.setState('generated');
window.scrollTo(0, scrollY);
this.updateStatus('Generating…'); this.updateStatus('Generating…');
this.motifBtn.disabled = true; this.motifBtn.disabled = true;
this.playPauseBtn.disabled = true; this.playPauseBtn.disabled = true;
@@ -538,7 +541,9 @@ class MotifApp {
this.updateStatus(''); this.updateStatus('');
this.hasGenerated = true; this.hasGenerated = true;
// Refresh generated state now that generation succeeded (enables Copy link, etc.) // Refresh generated state now that generation succeeded (enables Copy link, etc.)
const scrollYEnd = window.scrollY;
this.setState('generated'); this.setState('generated');
window.scrollTo(0, scrollYEnd);
} catch (error) { } catch (error) {
this.updateStatus(`Motif error: ${error instanceof Error ? error.message : 'Unknown error'}`); this.updateStatus(`Motif error: ${error instanceof Error ? error.message : 'Unknown error'}`);
this.motifBtn.disabled = false; this.motifBtn.disabled = false;