Skip to content

majiayu000/spellbook / skills/hud-interface

hud-interface

Verified

游戏 HUD 式界面:黑白纸墨加一个薄荷强调色,斜切黑标签、空心巨型数字、粗黑汉字标题、环形转动文字、歪着摆的纸卡片、黑色底栏大斜体计数和条形表,背后是流动的液体大理石着色器;可选用 HTML-in-Canvas 把真实 DOM 面板画进 WebGL 再做玻璃折射和色散(Chrome 实验开关,不支持时自动退回普通 DOM)。带噪音档位 quiet / normal / loud,默认 quiet。适合拆解台、零件清单、机器人或任务控制台这类要有「仪表感」的页面。当用户说「游戏 HUD 风格」「做成仪表板那种酷炫界面」「HTML-in-Canvas」「把 DOM 画进 WebGL」「液体大理石背景」「斜切标签 / 巨型数字 / 环形文字」时使用。只在明确请求时触发,忽略顺带提及。

FileKindSize
SKILL.mdskill md6.7 KB
assets/demo.htmlother13.5 KB
assets/hud.cssother8.5 KB
assets/hud.jsscript11.4 KB
scripts/check.mjsscript6.2 KB
scripts/lib/env.mjsscript3.5 KB
scripts/package.jsonmanifest289 B

scripts/lib/env.mjs

View on GitHub
// Find a Chromium and an ffmpeg that already exist on this machine, so the
// scripts run without `npx playwright install` or a PATH tweak.
import { existsSync, readdirSync } from 'node:fs';
import { join } from 'node:path';
import { homedir, platform } from 'node:os';
import { execFileSync } from 'node:child_process';
import { createRequire } from 'node:module';

const require = createRequire(import.meta.url);

function cacheDirs() {
  const h = homedir();
  return [
    process.env.PLAYWRIGHT_BROWSERS_PATH,
    platform() === 'darwin' && join(h, 'Library/Caches/ms-playwright'),
    platform() === 'linux' && join(h, '.cache/ms-playwright'),
    platform() === 'win32' && join(h, 'AppData/Local/ms-playwright'),
  ].filter(Boolean);
}

// Relative paths of the executable inside a ms-playwright browser folder.
const EXES = [
  'chrome-headless-shell-mac-arm64/chrome-headless-shell',
  'chrome-headless-shell-mac-x64/chrome-headless-shell',
  'chrome-headless-shell-linux64/chrome-headless-shell',
  'chrome-headless-shell-win64/chrome-headless-shell.exe',
  'chrome-mac-arm64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing',
  'chrome-mac-x64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing',
  'chrome-linux64/chrome',
  'chrome-mac/Chromium.app/Contents/MacOS/Chromium',
  'chrome-mac-arm64/Chromium.app/Contents/MacOS/Chromium',
  'chrome-linux/chrome',
  'chrome-win/chrome.exe',
];
const SYSTEM = [
  '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
  '/Applications/Chromium.app/Contents/MacOS/Chromium',
  '/usr/bin/chromium', '/usr/bin/chromium-browser', '/usr/bin/google-chrome',
];

export function findChromium() {
  if (process.env.CHROMIUM_PATH && existsSync(process.env.CHROMIUM_PATH)) return { path: process.env.CHROMIUM_PATH, from: 'CHROMIUM_PATH' };
  // What the installed playwright expects, if it is there.
  try {
    const p = require('playwright').chromium.executablePath();
    if (p && existsSync(p)) return { path: p, from: 'playwright default' };
  } catch {}
  // Newest cached build of any version: headless shell first, then full chromium.
  for (const dir of cacheDirs()) {
    if (!existsSync(dir)) continue;
    const names = readdirSync(dir).filter(n => /^chromium(_headless_shell)?-\d+$/.test(n))
      .sort((a, b) => (b.includes('headless') - a.includes('headless')) || (+b.split('-')[1] - +a.split('-')[1]));
    for (const n of names) for (const e of EXES) {
      const p = join(dir, n, e);
      if (existsSync(p)) return { path: p, from: `cache ${n}` };
    }
  }
  for (const p of SYSTEM) if (existsSync(p)) return { path: p, from: 'system browser' };
  return null;
}

export function findFfmpeg() {
  const cands = [process.env.FFMPEG_PATH, 'ffmpeg', '/opt/homebrew/bin/ffmpeg', '/usr/local/bin/ffmpeg', '/usr/bin/ffmpeg'].filter(Boolean);
  for (const c of cands) {
    try { execFileSync(c, ['-version'], { stdio: 'ignore' }); return { path: c, from: c === 'ffmpeg' ? 'PATH' : c }; } catch {}
  }
  // Playwright ships an ffmpeg for video recording, but without libx264, so it is only a last resort.
  return null;
}

export async function launch(opts = {}) {
  let chromium;
  try { ({ chromium } = require('playwright')); }
  catch { throw new Error('playwright is not installed: run `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm install` in ' + new URL("..", import.meta.url).pathname); }
  const c = findChromium();
  if (!c) throw new Error('no Chromium found: run `npx playwright install chromium-headless-shell` or set CHROMIUM_PATH');
  return chromium.launch({ executablePath: c.path, ...opts });
}
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall