Skip to content

feat: PhraseCycle — discrete phrase-state cycling primitive#24

Merged
whykusanagi merged 1 commit into
mainfrom
feat/phrase-cycle
May 18, 2026
Merged

feat: PhraseCycle — discrete phrase-state cycling primitive#24
whykusanagi merged 1 commit into
mainfrom
feat/phrase-cycle

Conversation

@whykusanagi
Copy link
Copy Markdown
Owner

Recovers the .flicker pattern dropped during the DecryptReveal rename (PR #23). Standalone class for cycling through discrete phrases (loading screens, boot sequences, decrypting preambles). Conceptually distinct from TypingAnimation (streaming/typed) and DecryptReveal (fixed-length char scramble).

Summary

  • PhraseCycle replaces the entire element text with each phrase in sequence at a fixed interval, then settles on finalText
  • loop: true cycles forever without settling
  • 3-way distinction documented in full: TypingAnimation | DecryptReveal | PhraseCycle
  • Package export: @whykusanagi/corrupted-theme/phrase-cycle

Files changed

  • src/lib/phrase-cycle.js — new class
  • tests/lib/phrase-cycle.test.js — 11 new tests
  • examples/advanced/phrase-cycle.html — example page (3 demos: loading, boot, looping spinner)
  • package.json./phrase-cycle export added
  • README.md#### PhraseCycle section added in Component Quick Reference
  • docs/COMPONENTS_REFERENCE.md — full entry with options table, methods, and 3-way distinction note
  • CHANGELOG.md — entry in 0.2.0 Added section
  • Nav links added to: index.html, examples/index.html, examples/showcase.html, examples/showcase-complete.html, examples/advanced/decrypt-reveal.html

Test plan

  • 11 new tests pass (166/166 total, 0 fail)
  • node -e "require('./package.json').exports['./phrase-cycle']" returns ./src/lib/phrase-cycle.js
  • ESM dynamic import in Node resolves and destroys cleanly
  • Example page demos 3 scenarios: settling cycle, boot sequence, looping spinner

🤖 Generated with Claude Code

Recovers the .flicker pattern that was dropped from CorruptionManager
during the DecryptReveal rename (PR #23). Different conceptual model
from both TypingAnimation (streaming/typed) and DecryptReveal
(fixed-length char scramble):

PhraseCycle replaces the entire element's text with phrase A, then
phrase B, etc., at a fixed interval, then settles on finalText.
Optional loop: true cycles forever without settling.

Use cases: loading screens, boot sequences, decrypting preambles,
glitch transitions between named states.

API:
  new PhraseCycle(element, { phrases, interval, duration, finalText, loop })
    .start() .stop() .destroy() .isRunning()

Package export: ./phrase-cycle -> src/lib/phrase-cycle.js

Tests: 11 new tests, 166/166 total pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@whykusanagi whykusanagi merged commit 6d29228 into main May 18, 2026
1 of 2 checks passed
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