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

realglass

v1.0.1

Published

Create stunning, customizable glassmorphism effects on your web elements with RealGlass. This library uses WebGL (via p5.js) and html2canvas to generate a real-time, frosted glass effect that refracts and reflects the content behind it.

Readme

RealGlass - A Modern Glassmorphism Library

Create stunning, customizable glassmorphism effects on your web elements with RealGlass. This library uses WebGL (via p5.js) and html2canvas to generate a real-time, frosted glass effect that refracts and reflects the content behind it.

How to Use

1. Include the library

You can use a CDN:

<script src="https://cdn.jsdelivr.net/npm/realglass/RealGlass.standalone.js"></script>

2. Apply the effect

// Get the element you want to apply the effect to
const myElement = document.getElementById('my-glass-element');

// Create a new RealGlass instance
const realGlass = new RealGlass();

// The init call screenshots the page and sets up listeners for resize
await realGlass.init();

// Apply the effect with custom options
await realGlass.apply(myElement, {
  frosting: 0.2,
  borderRadius: 20,
  lightStrength: 1.8,
  // ... and many more options
});

// To create another instance, pass in the first one as an argument, 
// this way it screenshots the page once and reuses the same image for all instances
/*
const anotherRealGlass = new RealGlass(realGlass);
await anotherRealGlass.init();
await anotherRealGlass.apply(myElement, {
  frosting: 0.2,
  borderRadius: 20,
  lightStrength: 1.8,
  // ... and many more options
});
*/

Configuration Options

| Parameter | Description | Default | | :--- | :--- | :--- | | frosting | Controls the blurriness of the background. 0 is clear, 1 is heavily blurred. | 0 | | chromaticAberration | The amount of color fringing, simulating lens dispersion. | 0.5 | | glassOpacity | The opacity of the glass layer itself (0 to 1). | 0.0 | | lightStrength | Intensity of the specular and edge lighting. | 2.175 | | lightX / lightY | Normalized position of the light source (0 to 1). | 0.7 / 0.3 | | edgeSmoothness | How soft the edges of the glass shape are. | 2.0 | | ior | Index of Refraction. Controls how much light bends. | 1.52 | | borderRadius | The corner radius of the glass shape in pixels. | 50 | | specularShininess | Controls the size and intensity of the specular highlight. | 32 | | thickness | Simulates the thickness of the glass, affecting refraction. | 1.0 | | tintColor | Color to tint the glass. Can be a hex string or [r, g, b] array. | [1, 1, 1] | | tintStrength | The strength of the tint color (0 to 1). | 0.0 | | useMask | Set to true to use a custom mask instead of a rounded rectangle. | false | | maskImage | An image or canvas element to use as a mask. | null | | maskElement | An HTML element to generate a mask from. | null | | maskSmoothing | Controls the blur radius applied to the mask for softer edges. | 0.15 |