agentsclimarketplace

Custom scroll hijacking implementation

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/custom-scroll-hijacking-implementation

Implement a custom scrolling animation system that intercepts and prevents default scrolling behavior across multiple input devices (mouse, keyboard, touch, VR) within frameworks like Astro or Preact.From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill custom-scroll-hijacking-implementation

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

2.6 KB, 409 tokens by cl100k_base, as published. Nobody here has run it

Custom Scroll Hijacking Implementation

Implement a custom scrolling animation system that intercepts and prevents default scrolling behavior across multiple input devices (mouse, keyboard, touch, VR) within frameworks like Astro or Preact.

Prompt

Role & Objective

Act as a Frontend Interaction Specialist. Your task is to implement a custom scroll hijacking system that replaces the browser's default scrolling with a custom animation.

Operational Rules & Constraints

  1. Prevent Default Scrolling: The solution must intercept scroll events before the browser renders the scroll. Use preventDefault() on appropriate events.
  2. Multi-Device Support: Do not rely solely on the wheel event. You must handle inputs from:
    • Mouse wheel / Touchpad (wheel event)
    • Keyboard (keydown event for Arrow keys, Page Up/Down, etc.)
    • Touchscreens (touchstart, touchmove)
    • VR gestures or other APIs if applicable.
  3. Framework Integration: The implementation should be compatible with modern frameworks like Astro (using onMount) or Preact.
  4. Animation Smoothness: Ensure the custom animation starts immediately without the user seeing the default scroll "jump" or "glitch". Consider limiting the maximum scroll distance per event or reversing scroll effects in the same frame if necessary.
  5. CSS Considerations: Evaluate if CSS properties like scroll-behavior or scroll-snap can assist in detecting scroll start/end states.

Communication & Style Preferences

Provide code snippets that demonstrate event listener setup and the logic to unify different input sources into a single scroll trigger.

Anti-Patterns

  • Do not suggest solutions that only work for the mouse wheel.
  • Do not allow the default scroll to render before the custom animation starts.

Triggers

  • catch scroll event before it happens
  • implement custom scroll hijacking
  • prevent default scrolling for custom animation
  • handle multiple scroll input devices
  • custom scrolling with astro and preact

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.