● Play money · 4 games · 1 script tag

Tiny casino games for any website.

Slots, Plinko, Mines and Crash as drop-in web components. No sign-in, no server, no real money — paste two lines and your site has an arcade.

Four games, one wallet.

Every game on a page shares the same play-money balance, saved in the visitor's browser. Win at Plinko, spend it in Mines. Go broke and hit Refill.

🧩

Drop-in

Plain web components. Works with any site: static HTML, WordPress, React, Astro. No build step, no dependencies.

🎨

Yours to theme

Accent color, light or dark, your currency name and icon, even your own slot symbols — all with attributes.

🔒

Nothing leaves the browser

No accounts, no tracking, no cookies. Balances live in localStorage. Every game returns exactly 99% on average.

Playground.

Tweak it, try it, copy the snippet. What you see is exactly what lands on your site.

Docs.

Everything there is to know fits on one page.

Install

Add the script once, anywhere on the page, then put a game wherever you want it.


      

The games size themselves to their container (up to 560px wide by default) and work on phones.

Elements

ElementAttributes
<chip-slots>symbols — six comma-separated emoji or image URLs, most common first.
<chip-plinko>rows 8–16 (default 12), risk low · medium · high.
<chip-mines>mines 1–24 (default 3), gem, bomb — emoji or image URL.
<chip-crash>auto — default auto cash-out multiplier (e.g. 2.5).
all gamesbet default bet · accent any CSS color · theme="light" · label custom title · currency / icon override · no-footer

Site-wide options

Set these as data- attributes on the script tag. They apply to every game on the page.

AttributeDefaultWhat it does
data-currencyChipsName shown next to balances.
data-icon●Emoji or image URL for the currency.
data-start1000Starting balance, and what Refill tops back up to.
data-bet10Default bet.
data-max-bet100000Largest single bet.
data-storagedefaultWallet name. Use different names to keep separate wallets on one domain.

Events

Every finished round fires chiplets:result, plus chiplets:win or chiplets:lose. They bubble, so one listener on document hears every game. Hook them up to confetti, sounds, badges, or your own leaderboard.

document.addEventListener('chiplets:win', (e) => {
  // e.detail = { game, bet, payout, profit, multiplier, balance, currency, ... }
  console.log(`Won ${e.detail.profit} at ${e.detail.game}`);
});
document.addEventListener('chiplets:balance', (e) => updateMyHeader(e.detail.balance));

Theming

The quick way is accent and theme. For full control, set CSS custom properties on the element or any parent.

chip-mines {
  --chip-accent: #ff5c00;   /* buttons, highlights */
  --chip-bg: #101010;       /* outer card */
  --chip-panel: #1a1a1a;    /* game area */
  --chip-fg: #fff;  --chip-muted: #999;
  --chip-win: #22c55e;  --chip-lose: #ef4444;
  --chip-radius: 8px;  --chip-font: "Your Font", sans-serif;
  --chip-max-width: 420px;
}

Each game also exposes ::part(box), ::part(stage) and ::part(balance).

JavaScript API

Chiplets.wallet.balance        // current balance
Chiplets.wallet.give(500)      // reward a visitor (daily bonus, quiz answer…)
Chiplets.wallet.take(50)       // spend on something of yours; false if they can't afford it
Chiplets.wallet.refill()       // top up to the start balance
Chiplets.wallet.reset()
Chiplets.wallet.stats()        // { balance, played, wagered, returned, refills }
Chiplets.config({ currency: 'Tokens', icon: '🪙' })
Chiplets.odds.plinko(12, 'high')   // { multipliers: [...], rtp }
Chiplets.odds.mines(3)             // payout after each safe tile

The math

Every game is tuned to return 99% of what's bet over the long run. Randomness comes from the browser's crypto.getRandomValues.

GameHow it works
SlotsThree reels of 64 stops with weighted symbols. Three of a kind on the middle line pays; multipliers are scaled so the expected return is 99%.
PlinkoThe ball goes left or right at each row with even odds, so buckets follow a binomial curve. Multipliers grow toward the edges and are scaled to 99% for every row count and risk level.
MinesPayout after k safe tiles is 0.99 ÷ (chance of surviving k picks). Cashing out at any point is worth the same 99% on average.
CrashThe crash point is drawn so the chance of reaching x is 0.99 ÷ x. Whatever target you pick, the long-run return is 99%. Max 1,000×.

FAQ

Play money only. Chiplets has no way to buy currency, cash out, or win prizes, and it's meant to stay that way. If you connect it to real money or prizes, gambling laws apply to you.
Can visitors cheat?

Yes — it all runs in their browser, so anyone with dev tools can give themselves a billion chips. That's fine for play money. Don't hang anything valuable off a client-side balance.

Does it collect any data?

No. There are no requests after the script loads. Balances are stored in the visitor's own browser under chiplets:* keys.

Will the balance follow visitors between my sites?

No — browsers keep storage per domain, so each site has its own wallet. Within one site, every page shares it.

Does it work with React / Vue / WordPress?

Yes. They're standard custom elements: load the script, then render <chip-plinko> like any other tag. In WordPress, paste the snippet into a Custom HTML block.