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 🙏

© 2024 – Pkg Stats / Ryan Hefner

checkers-game

v2.3.1

Published

A functional game of checkers

Downloads

52

Readme

Welcome to Checkers-Game (react-only)

Setup:

Open your terminal, and run npm i checkers-game

In the component where you want the checkers board, add:

import { Board } from 'checkers-game';

Styling:

boardStyle

All styles will live in this object:

<Board boardStyle={{ text: 'no-text', boardTheme: 'b/w' }}/>

boardTheme

<Board boardStyle={{ boardTheme: 'b/w' }}/>

border

"border" holds two possible border customization options. Size and color.

<Board boardStyle={{ border: { borderColor: 'white', borderSize: '10px' } }}/>

If you only specify a color, size will default to 3. If you only specify a size, color will default to white.

boardTiles

boardTiles contains 4 seperate properties:

p1 - The color that lights up when selecting a player 1 piece. p2 - The color that lights up when selecting a player 2 piece. diag1 - The first diagonal. diag2 - The second diagonal.

These can all be set with valid css colors.

<Board boardStyle={{ boardTiles: { p1: 'orange', p2: 'blue', diag1: 'blue', diag2: 'green'} }}/>

p1/p2

p1 & p2 are the player 1 and player 2 checkers piece colors respectively.

These colors have 3 options: black/brown/red

<Board boardStyle={{ p1: 'black', p2: 'brown' }}/>

Ensure to note the difference between p1/p2 in the boardTiles object and in the boardStyle object.

text

text is a pretty simple one. By default there is text that shows both players piece count and turn.

If you don't want this, simply use:

<Board boardStyle={{ text: 'no-text' }}/>

Upcoming features:

  1. Custom theming
  2. Websocket compatibility
  3. Ability to play Chess & Checkers by clicking a button to switch

Any questions feel free to reach out:

LinkedIn: https://www.linkedin.com/in/austin-westbury/ GitHub: https://www.github.com/TrueAndTrue/