TokenEconomizer
코딩 에이전트를 위한 경험 기반 블랙박스 비용 제어
작은 상호작용 몇 개를 포함한 패키지로 사용자를 작은 행동으로 보상하고 미소를 짓게 합니다
A package containing a few micro-interactions you can use to reward your users for little things and make them smile!
개발 도구GitHub @thedevelobear직접 설치운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
저장소 정보는 아직 수집하지 않았습니다.
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
메이커가 쓴 소개는 위의 한 줄이 전부입니다. 더 자세한 내용은 저장소 README에서 읽을 수 있습니다. 저장소 README ↗
README 전체를 불러오는 중입니다.
README 전문 보기 ↗:sparkles: GPU-rendered: WebGL2, with a Canvas 2D fallback
:evergreen_tree: Tree-shakeable: about 7 kB gzipped for useReward and confetti
:female_detective: Built with TypeScript
:stopwatch: Frame-rate independent, and quiet for people who prefer reduced motion
React-rewards lets you add micro-interactions to your app, and rewards users with the rain of confetti, emoji, balloons or fireworks in seconds. Firing confetti all over the page may seem like a questionable idea, but keep in mind that rewarding users for their actions is not. If a huge cloud of smiling emoji doesn't fit your application well, try changing the physics config to make it more subtle.
You can read more on the subject of micro-interactions in my blog post - https://www.thedevelobear.com/post/microinteractions/
thedevelobear.github.io/react-rewards has every effect live, with its settings and the code for what you pick, and the docs:
useReward: its settings, burst options and return valuefire: effects without ReactsetRendererdefineEffectpnpm add react-rewards
# or
npm install react-rewards
# or
yarn add react-rewards
React 18 or later. The package is ESM only.
Give useReward a ref to the element a reward starts from, and an effect. Each call to reward() fires a burst from the centre of that element.
import { useRef } from 'react';
import { confetti, useReward } from 'react-rewards';
export const RewardButton = () => {
const ref = useRef<HTMLButtonElement>(null);
const { reward, isAnimating } = useReward(ref, confetti);
return (
<button ref={ref} type="button" onClick={() => reward()}>
{isAnimating ? 'Yay!' : 'Reward me'}
</button>
);
};
The effects are confetti, emoji, balloon and firework, and each has its settings on its page of the docs.
The repo uses pnpm, and records its decisions in docs/. Start with AGENTS.md for the commands.
MIT