Index of every page on this site: llms.txt
All skills
johnpolacek avatar

/animaxxing

@8ddf542
Run it yourself

Build GSAP motion without restyling, as single effects or the full treatment: for "we're animaxxing", every element enters from a blank page, rests, and leaves. Text: split, scramble, glitch, typewriter, and speak-in entrances, scattering headlines, letter waves, text on a path, count-ups, odometers. Scroll: reveals, scrubbing, parallax, pinned scenes, stacking cards, zoom-through, horizontal runs, waypoints, smooth scroll, paging. Pointer: magnetic, tilt, spotlights, directional fills, press ripples, shakes, cursor followers, image trails, proximity, label rolls, underlines, weight hovers. Drag: throw tracks, endless loops, card stacks, sortable lists, swipe to dismiss. Also page covers, print effects, Flip morphs, menus, dialogs, tabs, state buttons, media and SVG effects, marquees, CustomEase, sound, confetti, particles, and hover stuck on touch. Also finds a feel: premium, calm, playful. Pair with the matching GSAP framework skill. Not for visual redesign, routing, or GSAP API questions.

Use this Skill: https://skilld.dev/gh/johnpolacek/animaxxing-skills/animaxxing

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesrecipesblast-off.md

≈1.6k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Recipe: blast off

A hero outro from a pressed call to action: headline letters fly away from the button, subhead words drop, the button flares out while the others collapse, and the page rocks. The timeline is reversible.

Lifecycle: the framework controller calls blastOff as the outro before navigation, paired with the pressed button's particle blast(). Partial setup rolls back per effect restoration.

Dependencies: gsap, gsap/SplitText.

Setup: apply stable typography before splitting; check revert with the cleanup checks.

import gsap from "gsap";
import { SplitText } from "gsap/SplitText";

gsap.registerPlugin(SplitText);

/* Swap for the project's helper if it has one. */
function prefersReducedMotion(): boolean {
  if (typeof window === "undefined") return true;
  const choice = document.documentElement.dataset.motion;
  if (choice === "reduced") return true;
  if (choice === "full") return false;
  return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
}

/** Runs setup in its own GSAP context; on throw, reverts what it created and rethrows. */
function guarded<T>(setup: () => T, onFail?: () => void): T {
  const ctx = gsap.context(() => {});
  let result: T | undefined;
  let failure: { error: unknown } | undefined;
  // Catch inside add: GSAP restores its current context only when add returns.
  ctx.add(() => {
    try {
      result = setup();
    } catch (error) {
      failure = { error };
    }
  });
  if (failure) {
    onFail?.();
    ctx.revert();
    throw failure.error;
  }
  return result as T;
}

const rnd = gsap.utils.random;
/** Fast is the point. */
const LETTER_TIME: [number, number] = [0.4, 0.6];
const WORD_TIME: [number, number] = [0.32, 0.5];

export type BlastOffOptions = {
  /** The hero container: it gets the shake. */
  root: HTMLElement;
  heading: HTMLElement;
  /** The subhead's words, already split by speakIn; they are animated in place. */
  words: HTMLElement[];
  pressed: HTMLElement;
  others: HTMLElement[];
};

export type BlastOff = {
  timeline: gsap.core.Timeline;
  /** Puts the headline markup back. Call once the timeline is done with, either way. */
  revert: () => void;
};

function centre(el: Element): { x: number; y: number } {
  const r = el.getBoundingClientRect();
  return { x: r.left + r.width / 2, y: r.top + r.height / 2 };
}

/** repeatRefresh can change a tween's recorded start; preserve the authored values separately. */
function snapshotStyles(elements: HTMLElement[]): () => void {
  const props = ["transform", "translate", "rotate", "scale", "opacity", "visibility", "filter"];
  const saved = elements.map((element) => props.map((prop) =>
    [element.style.getPropertyValue(prop), element.style.getPropertyPriority(prop)] as const));
  return () => elements.forEach((element, i) => {
    gsap.set(element, { clearProps: props.join(",") });
    props.forEach((prop, j) => {
      const [value, priority] = saved[i]?.[j] ?? ["", ""];
      if (value) element.style.setProperty(prop, value, priority);
      else element.style.removeProperty(prop);
    });
  });
}

export function blastOff({ root, heading, words, pressed, others }: BlastOffOptions): BlastOff {
  const restore = snapshotStyles([root, heading, ...words, pressed, ...others]);
  let effect: BlastOff;
  try {
    if (prefersReducedMotion()) {
      const timeline = gsap.timeline().set([heading, ...words, pressed, ...others], { autoAlpha: 0 });
      effect = { timeline, revert: () => { timeline.revert(); } };
    } else effect = guarded(() => throwApart({ root, heading, words, pressed, others }));
  } catch (error) {
    restore();
    throw error;
  }
  let done = false;
  return { timeline: effect.timeline, revert() {
    if (done) return;
    done = true;
    try { effect.revert(); } finally { restore(); }
  } };
}

function throwApart({ root, heading, words, pressed, others }: BlastOffOptions): BlastOff {
  const origin = centre(pressed);
  const split = SplitText.create(heading, { type: "chars,words" });
  const chars = split.chars as HTMLElement[];
  const timeline = gsap.timeline({ defaults: { overwrite: "auto" } });

  // The page rocks the instant the button is pressed.
  timeline
    .to(root, { x: () => rnd(-8, 8), y: () => rnd(-5, 5), duration: 0.04, repeat: 7, yoyo: true, repeatRefresh: true, ease: "none" }, 0)
    .set(root, { x: 0, y: 0 }, ">");

  // The pressed button flares and burns out; the others fold in on themselves.
  timeline.to(pressed, { scale: 1.35, autoAlpha: 0, filter: "blur(14px)", duration: 0.28, ease: "power4.out" }, 0);
  if (others.length > 0) {
    timeline.to(others, { scale: 0, rotation: () => rnd(-200, 200), autoAlpha: 0, duration: 0.32, ease: "back.in(2.5)" }, 0.02);
  }

  // Letters are thrown straight away from the pressed button, each tumbling on its own.
  gsap.set(chars, { willChange: "transform, opacity" });
  for (const char of chars) {
    const c = centre(char);
    const angle = Math.atan2(c.y - origin.y, c.x - origin.x) + rnd(-0.45, 0.45);
    const distance = rnd(340, 820);
    timeline.to(
      char,
      {
        x: Math.cos(angle) * distance,
        y: Math.sin(angle) * distance,
        rotation: rnd(-720, 720),
        scale: rnd(0.3, 2.4),
        autoAlpha: 0,
        duration: rnd(LETTER_TIME[0], LETTER_TIME[1]),
        ease: "expo.out",
      },
      rnd(0, 0.1),
    );
  }

  // Words lose their footing and drop off the bottom, spinning.
  for (const word of words) {
    timeline.to(
      word,
      { x: rnd(-360, 360), y: rnd(260, 620), rotation: `+=${rnd(-240, 240)}`, autoAlpha: 0, duration: rnd(WORD_TIME[0], WORD_TIME[1]), ease: "power2.in" },
      rnd(0, 0.14),
    );
  }

  return {
    timeline,
    revert: () => {
      // revert() puts every target back exactly as it was, including the words' resting tilts.
      timeline.revert();
      split.revert();
    },
  };
}

Controller contract

blastOff returns { timeline, revert }. Before calling it, stop the wave and particle effects on the same targets; keep speak-in's words unreverted until the blast is done. The controller awaits the timeline, owns navigation and cancellation, and calls revert once the split is no longer needed.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    The skill is a comprehensive library of TypeScript and GSAP-based animation recipes. It provides reusable code for text, scroll, pointer, layout, and particle effects. Analysis of the code and instructions reveals no malicious behavior, data exfiltration, or prompt injection attempts. All network operations and DOM manipulations are consistent with the skill's stated purpose of providing UI animations.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

Signed by skilld at 8ddf542. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 weeks ago.

Activeupdated 2 months ago
Other metadata
metadata
{
  "short-description": "Reusable GSAP text, scroll, pointer, layout, SVG, and particle motion for any brand"
}

README badge

README badge for johnpolacek/animaxxing-skills/animaxxing