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 🙏

© 2025 – Pkg Stats / Ryan Hefner

cheryglsljs

v1.1.20

Published

A Three.js + GLSL-based wave effect library.

Downloads

76

Readme

cheryglsljs

A lightweight JavaScript library for beautiful, interactive image effects using Three.js, GLSL shaders, and GSAP. Easily add animated wave and transition effects to images in your web projects, with support for both CDN and npm/bundler workflows.


✨ Features

  • GPU-accelerated wave and transition effects for images
  • Highly customizable via parameters (speed, strength, hover, etc.)
  • Works with both CDN and npm/bundler setups
  • Built on top of Three.js and GSAP
  • Simple API for adding effects to your images

🏗️ What is it based on?

  • Three.js: For 3D rendering and WebGL abstraction
  • GLSL: For custom GPU-accelerated shader effects
  • GSAP: For smooth, performant animations and transitions

🚀 Installation

Using CDN

  1. Add Three.js and GSAP via CDN in your HTML:

    <script src="https://unpkg.com/cheryglsljs/dist/cherry.js"></script>
  2. The library will be available as a global variable: Cherryglsl.


Using npm (Bundler: Webpack, Vite, etc.)

  1. Install via npm:

    npm install cheryglsljs three gsap
  2. Import in your JavaScript:

    import * as Cherryglsl from 'cheryglsljs';
    // or import { CherryWave, ImageTransition1, ImageTransition2 } from 'cheryglsljs';

🛠️ Usage

1. Wave Effect on an Image (CherryWave)

HTML:

<div class="container" style="width: 400px; height: 400px;">
  <img class="cherry" src="your-image.jpg" style="width: 100%; height: 100%;" />
</div>

JavaScript:

import Cherryglsl from 'cheryglsljs';

const img = document.querySelector('.cherry');
const container = document.querySelector('.container');

Cherryglsl.CherryWave({
  image: img,                // HTMLImageElement (required)
  container: container,      // HTMLElement (required)
  speed: 0.04,               // (optional) wave animation speed
  strength: 8,               // (optional) wave strength
  hover: true,               // (optional) enable wave on hover
  light: false               // (optional) enable light effect
});

Parameters for CherryWave

  • image: HTMLImageElement (required) — The image to apply the wave effect to.
  • container: HTMLElement (required) — The container where the effect will be rendered.
  • speed: Number (optional, default: 0.05) — Speed of the wave animation.
  • strength: Number (optional, default: 8) — Strength/amplitude of the wave.
  • hover: Boolean (optional, default: false) — If true, wave animates on hover.
  • light: Boolean (optional, default: false) — If true, adds a light effect to the wave.

2. Image Transition Effect 1 (ImageTransition1)

HTML:

<div class="container" style="width: 400px; height: 400px;">
  <img src="image1.jpg" />
  <img src="image2.jpg" />
</div>

JavaScript:

import Cherryglsl from 'cheryglsljs';

const container = document.querySelector('.container');
Cherryglsl.ImageTransition1(container, {
  speed: 0.02,      // (optional) transition speed
  strength: 0.02,   // (optional) wave strength during transition
  radius: 0.02,     // (optional) radius of the transition circle
  hover: false,     // (optional) enable hover effect
  noise: 0.4,       // (optional) noise amount for edge
  p: 0.0            // (optional) camera z offset
});

Parameters for ImageTransition1

  • container: HTMLElement (required) — The container with at least two <img> elements.
  • speed: Number (optional, default: 0.02) — Speed of the transition animation.
  • strength: Number (optional, default: 0.02) — Strength of the wave during transition.
  • radius: Number (optional, default: 0.02) — Radius of the transition circle.
  • hover: Boolean (optional, default: false) — If true, enables hover-based transition.
  • noise: Number (optional, default: 0.4) — Amount of noise for the transition edge.
  • p: Number (optional, default: 0.0) — Camera z offset for perspective.

3. Image Transition Effect 2 (ImageTransition2)

HTML:

<div class="container" style="width: 400px; height: 400px;">
  <img src="image1.jpg" />
  <img src="image2.jpg" />
  <img src="image3.jpg" />
</div>

JavaScript:

import Cherryglsl from 'cheryglsljs';

const container = document.querySelector('.container');
Cherryglsl.ImageTransition2(container, {
  time: true,       // (optional) auto transition timing
  speed: 1.2,       // (optional) transition speed
  p: 0.0,           // (optional) camera z offset
  hover: false,     // (optional) enable hover effect
  ttype: 0          // (optional) transition type (future use)
});

Parameters for ImageTransition2

  • container: HTMLElement (required) — The container with at least two <img> elements.
  • time: Boolean (optional, default: true) — If true, transitions automatically.
  • speed: Number (optional, default: 1.2) — Speed of the transition.
  • p: Number (optional, default: 0.0) — Camera z offset for perspective.
  • hover: Boolean (optional, default: false) — If true, enables hover-based transition.
  • ttype: Number (optional, default: 0) — Transition type (for future extension).

📚 API Summary

  • CherryWave(options) — Adds a wave effect to a single image.
  • ImageTransition1(container, options) — Adds a circular transition effect between two images.
  • ImageTransition2(container, options) — Adds an animated transition effect between multiple images.

📝 License

MIT