Optimize web animations

From akillness/jeo-skills · View interactive version

Optimize web animations is an AI agent skill from the GitHub repository akillness/jeo-skills. Profile, audit, and optimize frontend page performance with emphasis on animation work, memory-leak risks, long-session slowdowns, CSS animations, canvas/WebGL requestAnimationFrame loops, marquees, skeletons, GSAP/Three/Matter effects, timers, listeners, and observers. Use when the user asks to mak

How to use this skill

Skill file

Optimize Web Animations

When to use this skill

Core Rule

Measure the real page before editing. The goal is not to remove motion; it is to make offscreen work stop, visible motion resume correctly, and route/unmount cleanup release long-lived resources.

Use Codex Browser when available, especially for localhost pages. Do not use Chrome unless the user explicitly asks for it.

Workflow

  1. Inspect repo context.
  1. Capture a baseline in the browser.
  1. Patch the smallest owner that controls the motion.
main > section.is-offscreen .expensive-animation,
.expensive-animation.is-offscreen {
  animation-play-state: paused !important;
}
  1. Verify behavior, not just builds.
  1. Run local checks.
git diff --check
npm run lint
npm run build
  1. Commit narrowly when requested by repo/user instructions.
TMP_DIR="$(mktemp -d)"
GIT_INDEX_FILE="$TMP_DIR/index" git read-tree HEAD
# Apply only the intended hunks to the temporary index.
GIT_INDEX_FILE="$TMP_DIR/index" git diff --cached --check
GIT_INDEX_FILE="$TMP_DIR/index" git commit -m "Pause offscreen <page> animations"
unlink "$TMP_DIR/index" && rmdir "$TMP_DIR"
git restore --staged <files> 2>/dev/null || true
  1. Report with evidence.

Good Fix Patterns

Avoid

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.