feat: PhraseCycle — discrete phrase-state cycling primitive#24
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Recovers the
.flickerpattern 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
PhraseCyclereplaces the entire element text with each phrase in sequence at a fixed interval, then settles onfinalTextloop: truecycles forever without settling@whykusanagi/corrupted-theme/phrase-cycleFiles changed
src/lib/phrase-cycle.js— new classtests/lib/phrase-cycle.test.js— 11 new testsexamples/advanced/phrase-cycle.html— example page (3 demos: loading, boot, looping spinner)package.json—./phrase-cycleexport addedREADME.md—#### PhraseCyclesection added in Component Quick Referencedocs/COMPONENTS_REFERENCE.md— full entry with options table, methods, and 3-way distinction noteCHANGELOG.md— entry in 0.2.0 Added sectionindex.html,examples/index.html,examples/showcase.html,examples/showcase-complete.html,examples/advanced/decrypt-reveal.htmlTest plan
node -e "require('./package.json').exports['./phrase-cycle']"returns./src/lib/phrase-cycle.js🤖 Generated with Claude Code