npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

thief-police-captcha

v1.2.0

Published

A React captcha widget for thief-police game verification

Downloads

42

Readme

🎮 Thief vs Police CAPTCHA

An interactive, game-based CAPTCHA library for React applications. Verify users through engaging gameplay instead of boring text challenges!

npm version License: MIT

✨ Features

  • 🎯 3 Engaging Levels: City Chase, Jungle Hunt, Temple Showdown
  • 📱 Fully Responsive: Works on all devices (desktop, tablet, mobile)
  • 🎨 Beautiful UI: Modern design with smooth animations
  • Lightweight: Optimized bundle size
  • 🔒 Secure: Server-side verification support
  • 🎮 Fun UX: Users actually enjoy completing it!

📦 Installation

npm install thief-police-captcha

or

yarn add thief-police-captcha

🚀 Quick Start

import { ThiefPoliceGame } from 'thief-police-captcha';
import 'thief-police-captcha/dist/style.css';

function App() {
  const handleSuccess = (data) => {
    console.log('CAPTCHA verified!', data);
    // Proceed with your logic (form submission, etc.)
  };

  return (
    <div>
      <h1>Sign Up</h1>
      <ThiefPoliceGame onSuccess={handleSuccess} />
    </div>
  );
}

📖 API Reference

Props

| Prop | Type | Required | Default | Description | |------|------|----------|---------|-------------| | onSuccess | (data: object) => void | Yes | - | Callback when all levels are completed successfully | | onFailure | (reason: string) => void | No | - | Callback when CAPTCHA fails |

Success Data Structure

{
  success: true,
  level: 3,
  totalScore: 460,
  completedAt: "2024-01-01T12:00:00.000Z"
}

🎮 Game Levels

Level 1: City Chase

  • Objective: Catch the thief by aiming and throwing
  • Controls: Click to place targeting circle, then throw
  • Difficulty: Easy

Level 2: Jungle Hunt

  • Objective: Hit 4 real idols, avoid 3 fake ones
  • Controls: Drag targeting circle, throw darts
  • Difficulty: Medium

Level 3: Temple Showdown

  • Objective: Chase and catch the thief
  • Controls: Click to catch
  • Difficulty: Hard

🎨 Styling

The library includes default styles. Import the CSS file:

import 'thief-police-captcha/dist/style.css';

Custom Styling

You can override styles using CSS:

.game-stage {
  /* Your custom styles */
}

.game-btn {
  /* Custom button styles */
}

🔧 Advanced Usage

With Server Verification

import { ThiefPoliceGame } from 'thief-police-captcha';

function App() {
  const handleSuccess = async (data) => {
    try {
      const response = await fetch('/api/verify-captcha', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify(data)
      });
      
      if (response.ok) {
        console.log('Verified!');
        // Proceed with form submission
      }
    } catch (error) {
      console.error('Verification failed:', error);
    }
  };

  return <ThiefPoliceGame onSuccess={handleSuccess} />;
}

📱 Responsive Design

The CAPTCHA automatically adapts to different screen sizes:

  • Desktop: Full-size experience
  • Tablet: Scaled to fit
  • Mobile: Touch-optimized controls

🌐 Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)
  • Mobile browsers (iOS Safari, Chrome Mobile)

📄 License

MIT © Mikiyas Alemayehu

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

🐛 Issues

Found a bug? Please open an issue.

💡 Examples

Check out the example directory for complete integration examples.

🔗 Links


Made with ❤️ by Mikiyas Alemayehu