A collection of bits - no build steps, no backend, no bundler https://webbits.tfks.net
  • HTML 74.4%
  • JavaScript 17.9%
  • CSS 7.6%
Find a file
Erik Stephens c481575cdc backgammon: auto bear-off, drag-and-drop, & doubling cube support
Adds pointer-event-based drag-and-drop for moving checkers, including single drags that consume multiple dice (e.g. 24→19 with [3,2]) via a DFS path finder in rules.js. Drag coexists with the existing click flow, highlights legal and compound-reachable destinations with distinct intensities, and supports bearing off by dropping on a home-rail strip.

A wiki note explaining why drag-controller state must live in closure variables — putting it on the Alpine reactive object schedules a microtask re-render between pointerdown and pointerup that detaches the click target and silently kills the synthetic click event.
2026-05-23 04:59:05 -07:00
.claude add spamilyze bit, tfks-api client, and misc improvements 2026-05-03 21:12:00 -07:00
bits backgammon: auto bear-off, drag-and-drop, & doubling cube support 2026-05-23 04:59:05 -07:00
lib backgammon: auto bear-off, drag-and-drop, & doubling cube support 2026-05-23 04:59:05 -07:00
openspec backgammon: auto bear-off, drag-and-drop, & doubling cube support 2026-05-23 04:59:05 -07:00
wiki backgammon: auto bear-off, drag-and-drop, & doubling cube support 2026-05-23 04:59:05 -07:00
.gitignore add spamilyze bit, tfks-api client, and misc improvements 2026-05-03 21:12:00 -07:00
.prettierrc more fields for camp-jam 2026-04-17 05:20:53 -07:00
.rsync-filter backgammon: auto bear-off, drag-and-drop, & doubling cube support 2026-05-23 04:59:05 -07:00
CLAUDE.md refactor gear-closet nav + add per-theme accent color 2026-04-08 22:00:13 -07:00
favicon.png more fields for camp-jam 2026-04-17 05:20:53 -07:00
IDEAS.md add spamilyze bit, tfks-api client, and misc improvements 2026-05-03 21:12:00 -07:00
index.html hide the bone v1 2026-05-15 16:40:02 -07:00
justfile add multi-player support for backgammon 2026-05-03 15:08:24 -07:00
README.md make public 2026-03-20 03:12:29 -07:00
STORAGE.md change theme from "ai purple" to "terminal green" 2026-04-07 07:55:41 -07:00

The FunKy bitS

A collection of web bits - no build steps, no backend, no bundler

Live Demo - Inspired By Simon Willison


Stack

Purpose Library CDN
DOM components Shoelace cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.20.1
DOM components Custom Web Components ./lib/components.js
Reactivity Alpine.js v3 cdn.jsdelivr.net/npm/alpinejs@3.x.x
Styling Tailwind CSS cdn.tailwindcss.com

Structure

├── index.html
├── lib/components/
│   ├── NAME.js
│   └── NAME.css
└── bits/
    ├── NAME.html

Adding a New Bit

  1. Create the file: ./bits/NAME.html

  2. Use this template:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Your Bit</title>
  <script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-gray-50 min-h-screen">
  <site-header></site-header>
  <main x-data="yourBit()" class="max-w-5xl mx-auto px-6 py-8">
    <!-- your bit here -->
  </main>
  <site-footer></site-footer>

  <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
  <script>
    function yourBit() {
      return {
        // Alpine data
      };
    }
  </script>
</body>
</html>
  1. Register it in index.html — add an entry to window.bits:
{
  name: 'Your Bit',
  icon: '🔧',
  desc: 'One-sentence description of what it does.',
  tags: ['tag1', 'tag2'],
  href: 'bits/NAME.html',
}