npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@webgl-scroll/effects

v0.3.1

Published

Built-in WebGL scroll effects for @webgl-scroll/core.

Downloads

16

Readme

@webgl-scroll/effects

Built-in visual effects for @webgl-scroll/core.

Use this package when you want ready-made function effects such as asset-layer, fade-title, glb-particles, and pixelated-wipe without writing a custom effect definition.

Install

npm install @webgl-scroll/core @webgl-scroll/effects three

Boundary

@webgl-scroll/effects may depend on @webgl-scroll/core and three. It must not depend on React or Next.js.

Register built-ins through the runtime:

import { builtinEffects } from "@webgl-scroll/effects";

createWebGLScrollRuntime({
  canvas,
  effects: [builtinEffects()]
});

Asset Layer

asset-layer lets a single DOM trigger render ordered image, video, and GLB assets in WebGL:

{
  type: "asset-layer",
  layer: "background",
  params: {
    assets: [
      { id: "image", kind: "image", src: "/images/backdrop.jpg", order: 0 },
      {
        id: "video",
        kind: "video",
        src: "/videos/motion.mp4",
        order: 1,
        placement: { x: 0.3, y: 0.55, width: 0.42, height: 0.52 },
        playback: { mode: "scroll-scrub", startTime: 0, endTime: 4 }
      },
      {
        id: "model",
        kind: "glb",
        src: "/models/object.glb",
        order: 2,
        placement: { x: 0.72, y: 0.46, width: 0.44, height: 0.5 },
        transform: { rotateY: ["scroll", 0, 6.283] }
      }
    ]
  }
}

The effect maps the trigger element's rect into the shared orthographic WebGL world, updates all assets from the same scroll progress, pauses video in reduced motion, and disposes textures/materials/geometries on teardown.

params.placement sets the shared anchor mapping. Each asset can add placement as a partial override, so one trigger can independently place image, video, and GLB layers without creating extra scroll triggers.

Asset loading is lifecycle-aware. Effect create() installs lightweight objects; image/GLB downloads and video src attachment happen during preload or active-entry fallback. If the runtime provides an assetResolver, assets ask it first with { effect: "asset-layer", id, kind, src } and fall back to src when unresolved.

GLB Particles

glb-particles samples a GLB into a particle texture during lifecycle preload, runs GPU ping-pong position/velocity simulation, and uses shared pointer state from @webgl-scroll/core for visible scatter/return interaction:

{
  type: "glb-particles",
  layer: "background",
  params: {
    src: "/models/human.glb",
    particleTextureSize: 32,
    placement: { anchor: "element", fit: "contain", x: 0.84, y: 0.72, width: 0.3, height: 0.52 },
    pointerRadius: 0.28,
    scatterForce: 3.2,
    returnForce: 0.78,
    damping: 0.92,
    transform: {
      rotation: { x: 0, y: -0.45, z: 0 },
      autoRotate: { axis: "y", speed: 0.18 },
      scale: 1
    }
  }
}

The runtime installs one shared pointer bridge and updates it before rendering. Do not add per-effect pointer listeners.

Use params.transform for object-level particle group adjustment. placement determines the DOM anchor and base size; transform applies static rotation, positive scalar scale, and optional autoRotate on top of that base. Ordinary object rotation should stay inside the effect params instead of becoming a separate transform effect.

If the router provides an assetResolver, glb-particles asks it first with { effect: "glb-particles", kind: "glb", src } and supports resolved arrayBuffer or blob values before falling back to src.

Asset Manifests

Use collectBuiltinEffectAssetRequests(effects) to derive app-owned preload requests from declarative built-in effect descriptors. This helper only returns { effect, id?, kind, src }; it does not fetch, cache, or create WebGL runtime objects.