Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ badclaude
- Click: drop whip.
- Whip him 😩💢
- It sends an interrupt (Ctrl-C) and one of 5 encouraging messages!
- Shows a visual "CRACK!" text at the tip when you whip hard enough!
- Tracks your total whips in the tray menu.

## Roadmap

- [x] Initial release! 🥳
- [x] Cease and desist letter from Anthropic
- [x] Logs of how many times you whipped claude
- [x] Visual feedback on "crack"
- [ ] Crypto miner
- [ ] Logs of how many times you whipped claude so when the robots come we can order people nicely for them
- [ ] Updated whip physics
19 changes: 14 additions & 5 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ if (process.platform === 'win32') {
let tray, overlay;
let overlayReady = false;
let spawnQueued = false;
let whipCount = 0;

const VK_CONTROL = 0x11;
const VK_RETURN = 0x0D;
Expand All @@ -29,6 +30,16 @@ const VK_MENU = 0x12; // Alt
const VK_TAB = 0x09;
const KEYUP = 0x0002;

function updateTrayMenu() {
if (!tray) return;
const contextMenu = Menu.buildFromTemplate([
{ label: `Total Whips: ${whipCount}`, enabled: false },
{ type: 'separator' },
{ label: 'Quit', click: () => app.quit() },
]);
tray.setContextMenu(contextMenu);
}

/** One Alt+Tab / Cmd+Tab so focus returns to the previously active app after tray click. */
function refocusPreviousApp() {
const delayMs = 80;
Expand Down Expand Up @@ -166,6 +177,8 @@ function toggleOverlay() {

// ── IPC ─────────────────────────────────────────────────────────────────────
ipcMain.on('whip-crack', () => {
whipCount++;
updateTrayMenu();
try {
sendMacro();
} catch (err) {
Expand Down Expand Up @@ -243,11 +256,7 @@ function sendMacroMac(text) {
app.whenReady().then(async () => {
tray = new Tray(await getTrayIcon());
tray.setToolTip('Bad Claude – click for whip');
tray.setContextMenu(
Menu.buildFromTemplate([
{ label: 'Quit', click: () => app.quit() },
])
);
updateTrayMenu();
tray.on('click', toggleOverlay);
});

Expand Down
36 changes: 36 additions & 0 deletions overlay.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
let whipSpawnTime = 0;
let handleAngle = P.baseTargetAngle;
let handleAngVel = 0;
let cracks = [];

const WHIP_CRACK_SOUNDS = ['sounds/A.mp3', 'sounds/B.mp3', 'sounds/C.mp3', 'sounds/D.mp3', 'sounds/E.mp3'];

Expand All @@ -97,6 +98,7 @@
dropping = false;
lastCrackTime = 0;
whipSpawnTime = Date.now();
cracks = [];
const pts = [];
for (let i = 0; i < P.segments; i++) {
const t = i / (P.segments - 1);
Expand Down Expand Up @@ -363,9 +365,22 @@
lastCrackTime = now;
playCrackSound();
window.bridge.whipCrack();

// Add visual crack effect
cracks.push({
x: tip.x,
y: tip.y,
time: now,
text: ['CRACK!', 'POW!', 'SNAP!', 'WHIP!'][Math.floor(Math.random() * 4)],
rotation: (Math.random() - 0.5) * 0.5
});
}
}

// Update cracks (fade out)
const now = Date.now();
cracks = cracks.filter(c => now - c.time < 600);

// If dropping, check if everything fell off screen
if (dropping && whip.every(p => p.y > H + 60)) {
whip = null;
Expand Down Expand Up @@ -425,6 +440,27 @@
ctx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x2, y2);
ctx.stroke();
}

// Draw cracks
const now = Date.now();
for (const c of cracks) {
const age = now - c.time;
const alpha = 1 - age / 600;
const scale = 1 + age / 300;
ctx.save();
ctx.translate(c.x, c.y);
ctx.rotate(c.rotation);
ctx.scale(scale, scale);
ctx.font = 'bold 24px sans-serif';
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.fillStyle = `rgba(255, 255, 255, ${alpha})`;
ctx.strokeStyle = `rgba(0, 0, 0, ${alpha})`;
ctx.lineWidth = 4;
ctx.strokeText(c.text, 0, 0);
ctx.fillText(c.text, 0, 0);
ctx.restore();
}
}

// ── Main loop ───────────────────────────────────────────────────────────────
Expand Down
32 changes: 20 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"pack": "npm pack"
},
"dependencies": {
"electron": "^33.0.0",
"electron": "^41.1.1",
"koffi": "^2.9.0"
}
}