Skip to content

Jackywxsz/Jacky-motion

jacky-motion2-0

Verified

Jacky Motion 2.2 Hybrid:把中文口播稿变成可录屏的信息动画单文件 HTML。可选纯 HTML 手动推进(16:9 或 3:4)或配合 SRT 自动播放(16:9,含 B-roll 录屏画框)。流程为审稿、分镜、锁风格、装配与视觉验收;七种重点风格共享同一套版式、动效与质量门禁。

FileKindSize
SKILL.mdskill md9.0 KB
agents/openai.yamlconfig299 B
assets/base-template-portrait.htmlother15.5 KB
assets/base-template-srt.htmlother23.3 KB
assets/base-template.htmlother14.4 KB
assets/creator-ai-course.jpgbinary186.4 KB
assets/styles/apple-light-blue-glass.cssother3.3 KB
assets/styles/apple-tech-gradient.cssother2.9 KB
assets/styles/editorial-magazine.cssother2.8 KB
assets/styles/finance-studio-cards.cssother2.9 KB
assets/styles/ink-framework.cssother3.6 KB
assets/styles/manifesto-poster.cssother2.9 KB
assets/styles/newspaper-evidence.cssother3.5 KB
assets/styles/paper-collage.cssother3.8 KB
assets/styles/paper-craft-studio.cssother4.9 KB
assets/styles/sketch-note.cssother3.5 KB
references/beat-contract.mdmarkdown4.8 KB
references/html-production.mdmarkdown9.8 KB
references/hybrid-quality-gate.mdmarkdown7.5 KB
references/information-primitives.mdmarkdown2.3 KB
references/layout-skeletons-portrait.mdmarkdown11.6 KB
references/layout-skeletons.mdmarkdown17.4 KB
references/motion-language.mdmarkdown9.4 KB
references/portrait-adaptation.mdmarkdown4.9 KB
references/quality-check.mdmarkdown6.3 KB
references/script-audit.mdmarkdown1.9 KB
references/srt-autoplay.mdmarkdown4.6 KB
references/srt-beat-contract.mdmarkdown1.3 KB
references/srt-production.mdmarkdown2.2 KB
references/srt-quality-check.mdmarkdown1.6 KB
references/storyboard.mdmarkdown6.6 KB
scripts/check-layout-browser-srt.mjsexecutablescript6.2 KB
scripts/check-layout-browser.mjsexecutablescript8.6 KB
scripts/parse-srt.mjsexecutablescript2.2 KB
scripts/validate-motion-html-srt.mjsexecutablescript11.6 KB
scripts/validate-motion-html.mjsexecutablescript10.2 KB

scripts/check-layout-browser.mjs

View on GitHub
#!/usr/bin/env node
import fs from "node:fs";
import path from "node:path";
import { pathToFileURL } from "node:url";

const input = process.argv[2];
const outDir = process.argv[3] || "";

if (!input) {
  console.error("Usage: node check-layout-browser.mjs path/to/output.html [screenshot-dir]");
  process.exit(2);
}

let chromium;
try {
  ({ chromium } = await import("playwright"));
} catch {
  console.warn("SKIP Playwright is not available. Browser layout check is optional; use agent/browser screenshot review or manual screenshot review.");
  process.exit(0);
}

const fileUrl = pathToFileURL(path.resolve(input)).href;
const failures = [];
const warnings = [];
const SAFE_GAP = 48;

function overlapRatio(a, b) {
  const x = Math.max(0, Math.min(a.right, b.right) - Math.max(a.left, b.left));
  const y = Math.max(0, Math.min(a.bottom, b.bottom) - Math.max(a.top, b.top));
  const area = x * y;
  const minArea = Math.min(a.width * a.height, b.width * b.height);
  return minArea ? area / minArea : 0;
}

function overlapArea(a, b) {
  const x = Math.max(0, Math.min(a.right, b.right) - Math.max(a.left, b.left));
  const y = Math.max(0, Math.min(a.bottom, b.bottom) - Math.max(a.top, b.top));
  return x * y;
}

function expandBox(box, gap) {
  return {
    ...box,
    left: box.left - gap,
    top: box.top - gap,
    right: box.right + gap,
    bottom: box.bottom + gap,
    width: box.width + gap * 2,
    height: box.height + gap * 2
  };
}

let browser;
try {
  browser = await chromium.launch({ headless: true });
} catch {
  console.warn("SKIP Playwright browser executable is unavailable. Use the agent browser or manual screenshots; do not install a browser only for this check.");
  process.exit(0);
}
const page = await browser.newPage({ viewport: { width: 1200, height: 1200 }, deviceScaleFactor: 1 });
await page.goto(fileUrl);
await page.waitForTimeout(600);

const stageSize = await page.evaluate(() => {
  const stage = document.querySelector("#stage");
  if (!stage) return null;
  const style = getComputedStyle(stage);
  return { width: Math.round(parseFloat(style.width)), height: Math.round(parseFloat(style.height)) };
});
if (stageSize && stageSize.width >= 320 && stageSize.height >= 320) {
  await page.setViewportSize(stageSize);
  await page.reload();
  await page.waitForTimeout(600);
}

const beatCount = await page.locator(".beat").count();
if (beatCount === 0) failures.push("No .beat sections found.");

if (outDir) fs.mkdirSync(outDir, { recursive: true });

for (let index = 0; index < beatCount; index += 1) {
  await page.evaluate((activeIndex) => {
    if (typeof window.enterBeat === "function") {
      window.enterBeat(activeIndex, true);
      return;
    }

    document.querySelectorAll(".beat").forEach((beat, i) => {
      const active = i === activeIndex;
      beat.classList.toggle("active", active);
      beat.style.display = active ? "block" : "none";
      beat.style.opacity = "1";
      beat.style.visibility = "visible";
      if (!active) return;
      const finalStep = Math.max(1, Number(beat.dataset.steps || 1));
      beat.dataset.currentStep = finalStep;
      beat.querySelectorAll("[data-step]").forEach((el) => {
        el.classList.toggle("on", Number(el.dataset.step) <= finalStep);
      });
      beat.querySelectorAll("[data-dim-at]").forEach((el) => {
        el.classList.toggle("dim", Number(el.dataset.dimAt) <= finalStep);
      });
    });
  }, index);
  await page.waitForTimeout(500);

  const result = await page.evaluate(() => {
    const beat = document.querySelector(".beat.active");
    const beatName = beat?.id || beat?.dataset.layout || `beat-${[...document.querySelectorAll(".beat")].indexOf(beat) + 1}`;
    const stage = document.querySelector("#stage");
    const nav = document.querySelector("#nav,.nav,[data-nav],.hud");
    const elements = [...document.querySelectorAll(".beat.active [data-safe-box]")].map((el, i) => {
      const rect = el.getBoundingClientRect();
      return {
        label: el.getAttribute("data-safe-box") || el.id || el.className || `safe-box-${i + 1}`,
        left: rect.left,
        top: rect.top,
        right: rect.right,
        bottom: rect.bottom,
        width: rect.width,
        height: rect.height,
        allowOverlap: el.getAttribute("data-safe-overlap") === "true"
      };
    }).filter((box) => box.width > 0 && box.height > 0);
    const navBox = nav ? (() => {
      const rect = nav.getBoundingClientRect();
      return { left: rect.left, top: rect.top, right: rect.right, bottom: rect.bottom, width: rect.width, height: rect.height };
    })() : null;
    const stageBox = stage ? (() => {
      const rect = stage.getBoundingClientRect();
      return { left: rect.left, top: rect.top, right: rect.right, bottom: rect.bottom, width: rect.width, height: rect.height };
    })() : null;
    return {
      beatName,
      layout: beat?.dataset.layout || "",
      primitive: beat?.dataset.primitive || "",
      portraitAiry: beat?.dataset.portraitAiry === "true",
      elements,
      navBox,
      stageBox
    };
  });

  if (result.elements.length === 0) {
    failures.push(`${result.beatName}: no [data-safe-box] elements found; browser overlap check cannot verify layout.`);
  }

  for (let a = 0; a < result.elements.length; a += 1) {
    for (let b = a + 1; b < result.elements.length; b += 1) {
      if (result.elements[a].allowOverlap || result.elements[b].allowOverlap) continue;
      const ratio = overlapRatio(result.elements[a], result.elements[b]);
      const area = overlapArea(result.elements[a], result.elements[b]);
      if (ratio > 0.01 || area > 16) {
        failures.push(`${result.beatName}: ${result.elements[a].label} overlaps ${result.elements[b].label} (${Math.round(ratio * 100)}%).`);
        continue;
      }
      const expandedA = expandBox(result.elements[a], SAFE_GAP / 2);
      const expandedB = expandBox(result.elements[b], SAFE_GAP / 2);
      if (overlapArea(expandedA, expandedB) > 0) {
        failures.push(`${result.beatName}: ${result.elements[a].label} is too close to ${result.elements[b].label}; keep at least ${SAFE_GAP}px safe gap.`);
      }
    }
  }

  if (result.navBox) {
    for (const box of result.elements) {
      const ratio = overlapRatio(box, result.navBox);
      if (ratio > 0) failures.push(`${result.beatName}: ${box.label} collides with nav.`);
      if (result.stageBox && box.bottom > result.stageBox.bottom - 96) {
        failures.push(`${result.beatName}: ${box.label} enters 96px bottom nav safe zone.`);
      }
    }
  }

  const isPortrait = Boolean(result.stageBox && result.stageBox.height > result.stageBox.width);
  if (isPortrait && result.stageBox && result.elements.length) {
    const top = Math.min(...result.elements.map((box) => box.top));
    const bottom = Math.max(...result.elements.map((box) => box.bottom));
    const left = Math.min(...result.elements.map((box) => box.left));
    const right = Math.max(...result.elements.map((box) => box.right));
    const verticalSpan = (bottom - top) / result.stageBox.height;
    const horizontalSpan = (right - left) / result.stageBox.width;
    const bottomGap = (result.stageBox.bottom - bottom) / result.stageBox.height;
    const minSpan = result.portraitAiry ? 0.46 : 0.62;

    if (verticalSpan < minSpan) {
      failures.push(`${result.beatName}: portrait safe-box span is ${Math.round(verticalSpan * 100)}%; require at least ${Math.round(minSpan * 100)}% to avoid center clustering.`);
    }
    if (!result.portraitAiry && bottomGap > 0.26) {
      failures.push(`${result.beatName}: portrait bottom whitespace is ${Math.round(bottomGap * 100)}%; add a meaningful lower anchor/lock or recompose.`);
    }
    if (horizontalSpan < 0.58 && !/^(V02|V07)$/.test(result.layout)) {
      warnings.push(`${result.beatName}: portrait content spans only ${Math.round(horizontalSpan * 100)}% of stage width. Check for a narrow centered stack.`);
    }

    const shot = result.elements.find((box) => /(^|[-_])(shot|evidence-main)($|[-_])/i.test(box.label));
    if (shot && shot.height / result.stageBox.height < 0.42) {
      failures.push(`${result.beatName}: portrait screenshot/evidence uses only ${Math.round((shot.height / result.stageBox.height) * 100)}% of stage height; target 45%-65%.`);
    }
  }

  if (outDir) {
    await page.screenshot({ path: path.join(outDir, `beat-${String(index + 1).padStart(2, "0")}.png`) });
  }
}

await browser.close();

for (const message of failures) console.error(`FAIL ${message}`);
for (const message of warnings) console.warn(`WARN ${message}`);

if (failures.length) process.exit(1);
console.log(`PASS ${input}`);
if (warnings.length) console.log(`${warnings.length} warning(s). Review screenshots manually.`);
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