Skip to content

Add shift-letter animations and a toggleable help overlay#2

Open
curtisahuang wants to merge 4 commits intomasterfrom
cosine/shift-letters-animation-backtick-help
Open

Add shift-letter animations and a toggleable help overlay#2
curtisahuang wants to merge 4 commits intomasterfrom
cosine/shift-letters-animation-backtick-help

Conversation

@curtisahuang
Copy link
Collaborator

@curtisahuang curtisahuang commented Mar 10, 2026

This PR introduces a new shift-key animation variant for letter-triggered effects and adds a glassy, toggleable help panel that explains how to interact with the page.

What changed:

  • Animations

    • newEffect(letter, intensity, variant) now accepts a variant. When shift is held, letters spawn with a different animation variant (shift). Implemented by mapping variant to a different type selection.
    • The animation type for the shift variant is computed as (idx + 4) % 9 to differentiate from the normal variant.
    • Letter spawning now respects repeat and shiftKey for intensity and variant.
  • Help overlay

    • Added a help container (#help) that describes how to play: move the mouse, press letters, use numbers to change background, and press ` to toggle help.
    • Help defaults to visible on load (helpVisible = true) and can be toggled with the backtick (`) key.
    • Implemented in code with applyHelpVisibility() and toggleHelp() to show/hide the help panel.
    • Updated HTML to include the help panel and CSS for a glassy, accessible panel that overlays the page.
    • Backtick key now toggles the help panel; 0–9 change the background; letters spawn effects with optional shift-variant animation.
  • UI/CSS

    • Added styles for the glass-like help panel, including a subtle blur, translucent background, and smooth show/hide transitions.
    • Minor font/style tweak to improve canvas UI readability when the help panel is visible.

How this solves the task:

  • Users can now trigger a distinct animation by holding Shift while pressing letters, giving a visual variety to the spawned effects.
  • A built-in, ready-to-use help panel guides new users on how to interact with the page, defaulting to visible, and can be hidden with the ` key as requested.

https://cosine.wtf/cosine-stg/cat-coded-page/task/e0nj711tv7bz
https://cosine.wtf/gh/CosineAI/cat-coded-page/pull/2
Author: Curtis Huang

curtisahuang and others added 4 commits March 10, 2026 14:08
…adopt profile-driven parameters across effects

Co-authored-by: Cosine <agent@cosine.sh>
…; update effect type mapping and rendering flow

Co-authored-by: Cosine <agent@cosine.sh>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant