{"_id":"playcaptcha","name":"playcaptcha","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"playcaptcha","version":"0.1.0","description":"claw machine captcha for react - grab the right toy to prove you're human","type":"module","license":"MIT","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./clawcaptcha.css":"./dist/clawcaptcha.css"},"sideEffects":["**/*.css"],"scripts":{"build":"tsup","prepublishOnly":"npm run build"},"peerDependencies":{"react":">=18","react-dom":">=18"},"dependencies":{"motion":"^12.0.0"},"devDependencies":{"@types/react":"^19.0.0","@types/react-dom":"^19.0.0","tsup":"^8.3.0","typescript":"^5.7.0"},"gitHead":"5ca8df26fa0493a2e027cff8195131a9d53f2f6c","_id":"playcaptcha@0.1.0","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-7DF6WxO0OGye/nhkW2d8C55a66qDG7JBwcuw5glMUxnkoQz+ogeJ3fF+ZNyKb8i9w3+YJctaQRZTvTdFcFwZnQ==","shasum":"843a02ff9a1b26c95506f6a0d67673f5e2715d56","tarball":"https://registry.npmjs.org/playcaptcha/-/playcaptcha-0.1.0.tgz","fileCount":19,"unpackedSize":1162568,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGDVQv26mKuYbKQM0ysn8IfChhcxwpTTZ8POeyqsv8E6AiAGBb23lcrzHbRwSCrtoGqMg8eONpwWI2H+FId47s2uow=="}]},"_npmUser":{"name":"moratspace","email":"physiohub.io@proton.me"},"directories":{},"maintainers":[{"name":"moratspace","email":"physiohub.io@proton.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/playcaptcha_0.1.0_1781226371500_0.4869392975882638"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-12T01:06:11.429Z","0.1.0":"2026-06-12T01:06:11.740Z","modified":"2026-06-12T01:06:11.988Z"},"maintainers":[{"name":"moratspace","email":"physiohub.io@proton.me"}],"description":"claw machine captcha for react - grab the right toy to prove you're human","license":"MIT","readme":"# playcaptcha\n\nA captcha that's a claw machine.\n\nIt asks for a toy. You drive the claw with the joystick (or arrow keys), hit the red button, the claw dives down and grabs whatever's under it. Carry the catch over the hatch and drop it in. Right toy and you're verified, wrong toy bounces off the lid and goes back on the pile.\n\nNo physics engine behind it, just damped springs and scripted phases in one rAF loop. React state only changes when the phase changes, the rest is transforms written through refs, so it stays smooth even on weak devices.\n\nObvious but worth saying: this checks that someone is *playing*, not who they are. Keep it in front of your real checks, don't replace them with it.\n\nThis is part of [FeralUI](https://github.com/mortspace/feralui).\n\n## setup\n\n```bash\nnpm install playcaptcha\n```\n\nThen copy the `assets/` folder into whatever your app serves statically. The component looks for the toy renders under `/toys/` and the logo at `/playcaptcha.svg` by default, `assetBase` moves that.\n\n```tsx\nimport { ClawCaptcha } from 'playcaptcha'\nimport 'playcaptcha/clawcaptcha.css'\n\n<ClawCaptcha onVerify={() => unlock()} />\n```\n\nLeave `target` off and every mount asks for a different random toy. Or pin one:\n\n```tsx\n<ClawCaptcha target=\"duck\" onVerify={() => unlock()} />\n```\n\nThe 12 toy ids: duck, bear, panda, bunny, dino, penguin, fox, frog, whale, cat, puppy, unicorn.\n\nOther props: `title` (the heading), `assetBase`, `className`. That's all of them.\n\n## theming\n\nCSS vars on any ancestor:\n\n```css\n:root {\n  --clawcap-bg: #ffffff;     /* card */\n  --clawcap-ink: #1c1c1e;    /* text */\n  --clawcap-muted: #8a8a8e;\n  --clawcap-accent: #1c1c1e; /* dialog button + focus ring */\n  --clawcap-action: #ff5159; /* the big red button */\n}\n```\n\nKeyboard runs the whole thing (arrows + space/enter), the joystick is a real slider role, and prefers-reduced-motion swaps the decorative stuff (entrance tumble, confetti, ring pulse) for instant state changes.\n\nMIT. Toy renders live in assets/toys.\n","readmeFilename":"README.md","_rev":"1-84d67d228edb9020a92b615e7dac512a"}