ClaudeMods
☰
ZH-CN
● 0 人在线 · 浏览 0 次
赞助提交作品
GitHub 仓库 · 发布者 phuclh

halloween

Claude Code 终端的万圣节主题。

phuclh@phuclh

phuclh/claude-halloween/tree/main/plugins/halloween

已翻译

关于这个 mod

🎃 Claude Code 的万圣节

Claude Code 终端的万圣节主题。

<p align="center"> <img src="assets/demo.svg" alt="带有万圣节主题的 Claude Code:蝙蝠飞过对话区,提示列由闪烁的南瓜灯、树叶和骷髅围成" width="100%"> </p>
  • 提示列周围的闹鬼边框。 蝙蝠、树叶和月亮停在提示列上方的紫罗兰色边缘。下方是一条苔藓藤蔓,南瓜灯在上面随机成簇生长,把闪烁的光映到藤蔓上。幽灵偶尔沿着顶部飘过,拖着一缕灵质。每个工作会话都会得到独立的随机布局。
  • 飞过对话区的蝙蝠。 一小群蝙蝠会完整飞过聊天区:从一侧飞入、从另一侧飞出,沿平缓的弧线升降,有的缓慢巡航,有的快速掠过。
  • 诡异文字。 转圈行会显示 Brewing…、Summoning… 或 Stirring the cauldron… 之类的文字,完成的回合会显示 Haunted for 12s。
  • 敢用的话,还有诡异音效。 每次按键都会发出蝙蝠般的吱声,偶尔还会像闪电一样劈啪作响。按 Enter 发送回答时,会随机播放反派的 mwah-ha-ha、女巫的尖笑、恶魔的笑声、哀号的幽灵声、管风琴声或雷鸣声。每种 Enter 音效都会先播放一次,之后才会重复,而且同一种不会连续播放两次。开启前音效处于关闭状态。

安装

在 Claude Code 中:

/plugin marketplace add phuclh/claude-halloween
/plugin install halloween@phuclh-plugins

或者从 shell 执行:

claude plugin marketplace add phuclh/claude-halloween
claude plugin install halloween@phuclh-plugins

然后启动新的工作会话。

使用

  • /halloween 可切换主题。你的选择会在不同工作会话之间保留。
  • /halloween sounds 可切换音效,设置同样会被记住。音效仅在 macOS 上播放:Claude Code 使用 afplay 播放,在 Linux 或 Windows 上不会播放任何声音。
  • 如果 90 秒内既没有输入,也没有 Claude 的工作,动画会暂停并停止占用 CPU。你开始输入或 Claude 开始工作后,它会立即恢复。

要求

  • 全屏模式用于显示边框和蝙蝠:在 ~/.claude/settings.json 中设置 "tui": "fullscreen",或使用 /tui 切换。在其他界面中,你会看到诡异文字和提示行上的小花环。
  • 较新的 Claude Code。 主题使用 Claude Code 的早期访问 function-hook API,该 API 可能随版本变化。在 Claude Code 2.1.287 上构建并测试。

性能

动画运行时,主题每秒重绘屏幕 8 次,在 110×40 的终端上约占用一个 CPU 核心的 8–11%。暂停后不占用资源。

开启音效后,每次按键都会启动一个短暂的 afplay,间隔至少 70 ms。每次按键约增加 0.02 s 的 CPU 时间,而且只在输入时发生。

开发

claude --plugin-dir ./plugins/halloween       # 从此文件夹运行
claude plugin validate ./plugins/halloween    # 检查清单和 hooks
claude plugin test ./plugins/halloween        # 运行测试

上面的演示由插件自己的边框和飞行动画代码绘制。修改后再次渲染:

npx -p typescript tsc -p scripts
node .demo-build/scripts/render-demo.js > assets/demo.svg

音效由 scripts/render-sounds.ts 使用振荡器、噪声和滤波器合成;笑声来自一个小型共振峰合成器。没有录音或采样。要重新渲染到 plugins/halloween/sounds/:

npx -p typescript tsc -p scripts
node .demo-build/scripts/render-sounds.js

安装

请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。

claude plugin marketplace add phuclh/claude-halloween
claude plugin install halloween
原文 / README

🎃 Halloween for Claude Code

A Halloween theme for the Claude Code terminal.

<p align="center"> <img src="assets/demo.svg" alt="Claude Code with the Halloween theme: bats fly across the conversation above a prompt framed by flickering jack-o'-lanterns, leaves and skulls" width="100%"> </p>
  • A haunted frame around the prompt. Bats, leaves and a moon perch on a violet edge above the prompt. Below it runs a moss vine where jack-o'-lanterns grow in random clumps and flicker their glow onto the vine. A ghost drifts along the top every so often, trailing ectoplasm. Every session gets its own random layout.
  • Bats across the conversation. A small flock flies whole journeys over your chat: in from one side and out the other, rising or falling along a gentle arc, some cruising and some darting.
  • Spooky words. The spinner says things like Brewing…, Summoning… or Stirring the cauldron…, and finished turns read Haunted for 12s.
  • Spooky sounds, if you dare. Each keystroke squeaks like a bat or, now and then, cracks like lightning. Enter answers with a villain's mwah-ha-ha, a witch's cackle, a demon's laugh, a wailing ghost, a pipe organ or a thunderclap. Every Enter sound plays once before any repeats, and the same one never plays twice in a row. Sounds are off until you turn them on.

Install

In Claude Code:

/plugin marketplace add phuclh/claude-halloween
/plugin install halloween@phuclh-plugins

Or from a shell:

claude plugin marketplace add phuclh/claude-halloween
claude plugin install halloween@phuclh-plugins

Then start a new session.

Use

  • /halloween turns the theme off and on. Your choice is remembered across sessions.
  • /halloween sounds turns the sounds on and off, and is remembered too. Sounds play on macOS only: Claude Code plays them with afplay, and plays nothing on Linux or Windows.
  • After 90 seconds with no typing and no work from Claude, the animation pauses and stops using CPU. It wakes as soon as you type or Claude starts working.

Requirements

  • Fullscreen mode for the frame and the bats: set "tui": "fullscreen" in ~/.claude/settings.json, or switch with /tui. On other screens you get the spooky words and a small garland on the hint line.
  • A recent Claude Code. The theme uses Claude Code's early-access function-hook API, which may change between releases. Built and tested on Claude Code 2.1.287.

Performance

While animating, the theme redraws the screen 8 times a second, which costs about 8–11% of one CPU core on a 110×40 terminal. Once paused, it costs nothing.

With sounds on, each keystroke starts a short afplay, at most one every 70 ms. That adds about 0.02 s of CPU per keystroke, and only while you type.

Develop

claude --plugin-dir ./plugins/halloween       # run it from this folder
claude plugin validate ./plugins/halloween    # check the manifest and hooks
claude plugin test ./plugins/halloween        # run the tests

The demo above is drawn by the plugin's own frame and flight code. To render it again after a change:

npx -p typescript tsc -p scripts
node .demo-build/scripts/render-demo.js > assets/demo.svg

The sounds are synthesized from oscillators, noise and filters by scripts/render-sounds.ts; the laughs come from a small formant synthesizer. Nothing is recorded or sampled. To render them again into plugins/halloween/sounds/:

npx -p typescript tsc -p scripts
node .demo-build/scripts/render-sounds.js

更多类似作品