Skip to content

Comments

Add scramble-button component with GSAP registerEffect#74

Open
JOYBOY-0 wants to merge 2 commits intomainfrom
claude/add-scramble-button-component-zUDlE
Open

Add scramble-button component with GSAP registerEffect#74
JOYBOY-0 wants to merge 2 commits intomainfrom
claude/add-scramble-button-component-zUDlE

Conversation

@JOYBOY-0
Copy link
Contributor

@JOYBOY-0 JOYBOY-0 commented Feb 11, 2026

Introduces the first GSAP-powered component using the registerEffect
pattern. The scramble effect (lib/gsap/effects/scramble.ts) animates
text by cycling random characters and progressively revealing the
final text left-to-right. The ScrambleButton component triggers this
effect on hover, with a scramble prop for programmatic control on
touch devices. Demo includes a Switch fallback visible on mobile.

  • Add gsap and @gsap/react dependencies
  • Add lib/gsap/effects/scramble.ts (registered GSAP effect)
  • Add registry/joyco/blocks/scramble-button.tsx (component)
  • Add demos/scramble-button-demo.tsx (with mobile switch fallback)
  • Add content/components/scramble-button.mdx (documentation)
  • Add components/ui/switch.tsx (shadcn switch for demo)
  • Update registry.json and meta.json

https://claude.ai/code/session_01HMNgAqrU1XBYUoQBvrWuoW

Greptile Overview

Greptile Summary

Introduces a new GSAP-powered scramble effect and button component with comprehensive documentation and proper registry integration. The scramble effect animates text with random character cycling and staggered left-to-right reveal. The implementation includes mobile-friendly programmatic control via a scramble prop and follows established architectural patterns for effects categorization.

Key Changes:

  • Added lib/gsap/effects/scramble.ts with character-by-character reveal animation
  • Added ScrambleButton component with hover and programmatic trigger support
  • Extended sidebar architecture to support Effects category alongside UI and Games
  • Added comprehensive MDX documentation for both effect and component
  • Added Switch component for demo's mobile fallback

Issues Found:

  • Critical: Switch component imports from incorrect package radix-ui instead of @radix-ui/react-switch, causing runtime errors

Confidence Score: 3/5

  • This PR has a critical import error that will cause runtime failures
  • The scramble effect and button implementations are solid, but the Switch component has an incorrect import from radix-ui instead of @radix-ui/react-switch, which will cause the demo to crash at runtime. All other changes follow proper patterns and integrate well with the codebase architecture.
  • Fix components/ui/switch.tsx - incorrect import will cause runtime error

Important Files Changed

Filename Overview
components/ui/switch.tsx New switch component added, but has incorrect import that will cause runtime errors
lib/gsap/effects/scramble.ts Well-implemented GSAP effect with proper character scrambling logic, auto-scaling duration, and staggered reveal
registry/joyco/blocks/scramble-button.tsx Clean button component with proper hover handlers, programmatic control via scramble prop, and cleanup on unmount
package.json Added gsap and @gsap/react dependencies; added unnecessary radix-ui meta-package dependency
registry.json Properly registered both scramble effect and scramble-button with correct dependencies and registry structure

Introduces the first GSAP-powered component using the registerEffect
pattern. The scramble effect (lib/gsap/effects/scramble.ts) animates
text by cycling random characters and progressively revealing the
final text left-to-right. The ScrambleButton component triggers this
effect on hover, with a `scramble` prop for programmatic control on
touch devices. Demo includes a Switch fallback visible on mobile.

- Add gsap and @gsap/react dependencies
- Add lib/gsap/effects/scramble.ts (registered GSAP effect)
- Add registry/joyco/blocks/scramble-button.tsx (component)
- Add demos/scramble-button-demo.tsx (with mobile switch fallback)
- Add content/components/scramble-button.mdx (documentation)
- Add components/ui/switch.tsx (shadcn switch for demo)
- Update registry.json and meta.json

https://claude.ai/code/session_01HMNgAqrU1XBYUoQBvrWuoW
@vercel
Copy link
Contributor

vercel bot commented Feb 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
joyco-hub Ready Ready Preview, Comment Feb 11, 2026 10:43pm

Major changes:
- Split scramble into standalone registry item (`@joyco/scramble`) and
  scramble-button that references it via registryDependencies
- Add "Effects" sidebar category alongside UI and Games, using
  `type: effect` frontmatter (same pattern as games)
- Rewrite scramble effect with per-character jittered resolve timing,
  weighted character sets (underscores for visual breathing room), and
  auto-scaling duration (~50ms/char)
- Fix demo: monospace font, uppercase text, overflow-hidden container,
  proper button sizing — eliminates layout shift during animation
- Add revealDelay and scrambleFrames config for fine-tuning

Files changed:
- source.config.ts: add 'effect' to type enum
- lib/source.ts: add getEffectSlugs()
- layout.tsx → sidebar/index.tsx → sidebar/section.tsx: pipe effectSlugs
  through to render Effects subsection with TextScan icon
- registry.json: scramble as standalone item, scramble-button references it
- content/components/scramble.mdx: standalone effect documentation
- content/components/scramble-button.mdx: updated to reference effect

https://claude.ai/code/session_01HMNgAqrU1XBYUoQBvrWuoW
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.

2 participants