gsap-observer

Implements unified gesture detection for wheel, touch, pointer, and scroll events using the GSAP Observer plugin.

52|3|Updated Aug 20, 2026
Ready to run
npx skills add https://github.com/Wayn-Git/Amethyst --skill gsap-observer-wayn-git
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: gsap-observer
Source: https://github.com/Wayn-Git/Amethyst/tree/main/agents/skills/gsap-observer
Command: npx skills add https://github.com/Wayn-Git/Amethyst --skill gsap-observer-wayn-git

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gsap.

What problem does it solve? Handling wheel, touch, pointer, and scroll events consistently across devices requires writing separate listeners and reconciling different event models. This Skill provides patterns for the GSAP Observer plugin, which unifies gesture detection into a single API with direction callbacks, velocity data, and drag handling. ## Core Features & Use Cases - Unified Gesture Detection: Create observers that respond to wheel, touch, pointer, and scroll events with directional callbacks like onUp, onDown, onLeft, and onRight. - Drag and Velocity Tracking: Access deltaX, deltaY, velocityX, and velocityY values to build momentum-based interactions and swipe detection. - Configuration Controls: Tune tolerance, dragMinimum, wheelSpeed, debounce, preventDefault, and ignore selectors to control when and where gestures trigger. - Use Case: Build a full-screen slider where wheel scrolls and touch swipes both navigate between slides, with a tolerance threshold preventing accidental triggers and momentum physics on drag release. ## Quick Start Use the gsap-observer skill to create an Observer that navigates between slides when the user scrolls or swipes up and down.

Frequently Asked Questions about gsap-observer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect swipe direction in JavaScript with GSAP?▼

Use Observer.create with type 'wheel,touch' and define onUp, onDown, onLeft, and onRight callbacks. Each callback receives a self object containing deltaX, deltaY, velocityX, and velocityY values for the gesture.

How to build a scroll-based slider with GSAP Observer?▼

Create an Observer targeting window with type 'wheel,touch' and a tolerance around 50. In onUp and onDown callbacks, update the current slide index and animate the slides container with gsap.to using a percentage x offset.

What is the difference between wheel, touch, pointer, and scroll event types in GSAP Observer?▼

Wheel covers mouse wheel and trackpad input, touch covers touch swipes on any device, pointer covers mouse or pointer drags while pressed, and scroll covers scrollbar dragging. You can combine them in the type string or use only the ones you need.

How do I prevent GSAP Observer from blocking scrolling on inner elements?▼

Use the ignore option with a selector like '.scrollable-content, textarea' so the Observer skips those elements. Avoid setting preventDefault globally; instead call self.event.preventDefault() conditionally inside callbacks.

Why does my GSAP Observer fire too many times during scrolling?▼

Scroll and wheel events fire continuously, so expensive callbacks run on every tick. Set the debounce option to a millisecond value or wrap the callback in gsap.utils.throttle to limit execution frequency.