Communitygithub.com

MengTo/Skills

Erstelle einen Scroll-Animation-Trigger mit IntersectionObserver, Tailwind-freundlichen Animationsklassen und Keyframes. Verwende dies bei Anfragen nach Scroll-Reveal, Animate-on-Scroll oder sequenziellen Elementanimationen beim Eintritt in den Viewport.

Was ist Skills?

Dieser Skill bietet eine sofort einsatzbereite Lösung für Animationen beim Scrollen, die auf dem Intersection-Trigger mit dem IntersectionObserver basiert. Er kombiniert Tailwind-freundliche Keyframes und ein schlankes JavaScript-Snippet, sodass Elemente beim Betreten des Viewports animiert werden – einmalig oder wiederholbar. Entwickler können Parameter wie Schwellwert (threshold), rootMargin, Dauer, Verzögerung und Bewegungsstil (z. B. Einblenden, Verschieben, Weichzeichnen) direkt anpassen. Der Skill ist für moderne Webentwicklung optimiert und funktioniert mit jedem Framework, das Tailwind CSS verwendet (z. B. Hugo, Astro, Next.js, Laravel). Der Workflow umfasst die Bestätigung des Animationsstils, die Bereitstellung von Keyframes plus Observer-Code und die einfache Integration über eine einzige CSS-Klasse (`animate-on-scroll`) und eine Tailwind-Utility-Klasse für die Animation. Typische Fehler wie fehlende Keyframes oder falsche Animationsnamen werden durch eine Checkliste abgedeckt.

Funktioniert mit~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/MengTo/Skills/tree/HEAD/agent-skills/web-design/animation-on-scroll

In Ihrer bevorzugten KI fragen

Öffnet einen neuen Chat, in dem dieser Agent-Skill bereits geladen ist.

Dokumentation

Fähigkeit: Animation beim Scrollen

Arbeitsablauf

  1. Animationsstil, Timing und ob Animationen einmal oder wiederholt ablaufen sollen, bestätigen.
  2. Die Keyframes + das JS-Observer-Snippet sowie die genaue Tailwind-Klasse bereitstellen.
  3. Gezielte Anpassungen nur bei Schwellwert, rootMargin, Dauer, Verzögerung, Transform-/Blur-Werten anbieten.

Verwendungs-Checkliste

  • Füge das JS-Snippet im <head> nach den Keyframes ein.
  • Füge die Animationsklasse und animate-on-scroll zu den Elementen hinzu.
  • Stelle sicher, dass der Name deiner Keyframes mit der Tailwind-Animation-Referenz übereinstimmt.

IntersectionObserver-Trigger

<script>
  /*
    Sequenz-Animation beim Scrollen, sobald sichtbar. Erfordert Animation Keyframe. Verwendung:

    1) Füge diesen Code im <head> zusammen mit dem Animation-Keyframe-Code ein.

    2) Füge zu Tailwind-Klassen hinzu: [animation:animationIn_0.8s_ease-out_0.1s_both] animate-on-scroll
  */
  (function () {
    // CSS für angehaltene/laufende Zustände einfügen
    const style = document.createElement("style");
    style.textContent = `
      /* Standard: angehalten */
      .animate-on-scroll { animation-play-state: paused !important; }
      /* Aktiviert von JS */
      .animate-on-scroll.animate { animation-play-state: running !important; }
    `;
    document.head.appendChild(style);

    const once = true;

    if (!window.__inViewIO) {
      window.__inViewIO = new IntersectionObserver((entries) => {
        entries.forEach((entry) => {
          if (entry.isIntersecting) {
            entry.target.classList.add("animate");
            if (once) window.__inViewIO.unobserve(entry.target);
          }
        });
      }, { threshold: 0.2, rootMargin: "0px 0px -10% 0px" });
    }

    window.initInViewAnimations = function (selector = ".animate-on-scroll") {
      document.querySelectorAll(selector).forEach((el) => {
        window.__inViewIO.observe(el); // zweimaliges Beobachten ist ein Null-Vorgang
      });
    };

    document.addEventListener("DOMContentLoaded", () => initInViewAnimations());
  })();
</script>

Keyframes

<style>
  /*
    Sequenz-Animation-Intro. Verwendung:

    1) Füge diesen Code im <head> ein.

    2) Füge zu Tailwind-Klassen hinzu: [animation:animationIn_0.8s_ease-out_0.1s_both]
  */
  @keyframes animationIn {
    0% {
      opacity: 0;
      transform: translateY(30px);
      filter: blur(8px);
    }

    100% {
      opacity: 1;
      transform: translateY(0);
      filter: blur(0px);
    }
  }
</style>

Tailwind-Beispiel

<div class="animate-on-scroll [animation:animationIn_0.8s_ease-out_0.1s_both]">
  ...
</div>

Anpassungsmöglichkeiten

  • Auslöser: Passe threshold und rootMargin an, um Einblendungen früher oder später auszulösen.
  • Wiederholung: Setze once = false, um Wiederholungen beim erneuten Betreten zu ermöglichen.
  • Bewegung: Passe translateY und blur in den Keyframes an.
  • Timing: Ändere Dauer und Verzögerung im Tailwind-Animation-Wert.

Häufige Fallstricke

  • Vergessen, die Keyframes vor dem JS-Snippet einzufügen.
  • Verwenden eines anderen Keyframe-Namens als in der Tailwind-Animation.
  • Animationen laufen nicht, weil das Element bereits vor der Observer-Initialisierung im Viewport ist.

Fragen, wenn Angaben fehlen

  • Sollen Animationen einmal oder jedes Mal laufen, wenn das Element den Viewport erneut betritt?
  • Wie weit vor dem Eintritt in den Viewport sollen sie beginnen?
  • Welcher Bewegungsstil (Einblenden, Verschieben, Weichzeichnen, Skalieren) ist gewünscht?

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

MengTo/Skills

Create polished 60 fps 4:3 4K browser screen-recording style videos from Codex in-app browser captures, with browser-only crop, natural macOS cursor styling, deliberate click choreography, zoom-follow framing, ffprobe/thumbnail verification, and optional native recording compatibility checks. Use when the user asks to record or re-record browser actions, show cursor clicks and zooms, make Dribbble/UI inspiration or product demo recordings, or asks whether Codex, Playwright, or an MCP can produce a natural browser demo video.

MengTo/Skills

Generate ElevenLabs text-to-speech audio from scripts or inline text using local voice profiles. Use when the user asks for ElevenLabs, text-to-speech, TTS, narration, voiceover, speech audio, or voice generation; load voice names, voice ids, emails, owners, and account-specific defaults only from local config outside the skill.

MengTo/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 make animations performant, pause offscreen animations, look for memory leaks, profile pages that slow the computer over time, fix janky scrolling, reduce CPU/GPU use, or repeat the "only play in view" optimization on React/Vite/Next/frontend pages using Codex Browser.

MengTo/Skills

Turn a reference video into a super detailed recreation or inspiration prompt. Use when the user provides, mentions, uploads, links, or points to a video and asks to analyze the design, UI, animations, transitions, scroll interactions, typography, colors, assets, WebGL/Three.js, storytelling, section-by-section behavior, or to create a prompt/article that recreates the page, app, interaction, or motion system.

MengTo/Skills

Use when designing or implementing product-grade web motion like Stripe, Linear, Apple, and Vercel. Covers motion principles, easing/duration defaults, choreography patterns, scroll/hover interactions, performance, accessibility (reduced motion), and implementation guidance.

MengTo/Skills

Create premium cinematic web motion systems with GSAP, ScrollTrigger, and Lenis. Use for luxury editorial websites, creative studio portfolios, Awwwards-style interactions, smooth scroll reveals, staggered text, parallax, pinned sections, magnetic hover states, custom cursors, and mouse-reactive layered movement.

MengTo/Skills

Create cinematic scroll-driven landing pages with Lenis smooth scrolling, GSAP ScrollTrigger, scroll-linked progression, staggered text reveals, sticky card stacks, parallax backgrounds, scroll-scrubbed transitions, footer reveals, and immersive preloaders. Use when analyzing or building premium editorial scroll experiences, sticky project stacks, kinetic typography, or section-by-section storytelling.

MengTo/Skills

Use when designing or rewriting a high-converting SaaS pricing page (structure, plan design, copywriting, SEO/AEO, FAQs, layout patterns, experiments). Includes checklists, templates, and common pitfalls.

MengTo/Skills

Use when creating or refining WebGL-heavy landing pages and you need to steer toward a specific visual outcome (premium, technical, playful, cinematic) while balancing conversion clarity, performance, and implementation complexity.

Verwandte Skills