XP Gain
Install with shadcn
Needs a free account token. Get a token
npx shadcn@latest add @movin/button-xp-gainAbout this component
On each click, a "+100 XP" label floats upward from the click position and fades out over 860ms via CSS keyframes. A running total increments in the button label. Click position is captured from the mouse event and used to place the floating element.
Triggers
- Click
- State change
Techniques
- Keyframes
- Event position
Difficulty
Beginner
Accessibility
Reduced motion
Float animation disabled under prefers-reduced-motion; XP counter still increments.
Use it in anything you build, commercial and client work included. Licence