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

@profpowell/screen-saver

v1.1.1

Published

A vanilla JavaScript web component that displays retro screen saver effects after idle timeout

Readme

<screen-saver>

A vanilla JavaScript web component that displays retro screen saver effects after idle timeout.

Features

  • Zero dependencies - pure vanilla JavaScript
  • Three built-in effects: bounce3d, matrix, ascii-glitch
  • Automatic idle detection with configurable timeout
  • Custom effect registration API
  • Full CSS custom property support
  • Respects prefers-reduced-motion
  • TypeScript definitions included

Installation

npm install @profpowell/screen-saver

Or use via CDN:

<script type="module" src="https://unpkg.com/@profpowell/screen-saver/dist/screen-saver.js"></script>

Usage

<screen-saver timeout="180" effect="bounce3d">
  Your Text Here
</screen-saver>

Attributes

| Attribute | Type | Default | Description | |-----------|------|---------|-------------| | timeout | number | 180 | Idle delay in seconds | | effect | string | "bounce3d" | Effect name | | speed | number | 1 | Animation speed multiplier | | background | string | - | Background color or image URL | | palette | string | "rainbow" | Palette mode: rainbow keeps built-in colors; theme cycles through VB tokens |

Available Effects

bounce3d (default)

Classic bouncing 3D extruded text with color cycling on edge bounces.

matrix

Matrix-style falling character rain with your text glowing in the center.

ascii-glitch

Glitchy ASCII effect with random character corruption and chromatic aberration.

bauhaus

Primitive shapes (circle, square, triangle) drifting in primary colors. Designed for the VB bauhaus theme.

memphis

Squiggles, dots, zigzags, and confetti triangles drifting and spinning. No text required. Designed for the VB memphis theme.

art-deco

Symmetrical radiating arcs with slow inhale/exhale scaling. Designed for the VB art-deco theme.

brutalist

Loud blocks of monospace text snapping into grid cells, occasional inverted blocks. Designed for the VB brutalist theme.

kawaii

Pastel sprites (hearts, stars, sparkles, clouds) floating upward and fading. No text required. Designed for the VB kawaii theme.

API

const el = document.querySelector('screen-saver');

// Programmatic control
el.activate();    // Start the screen saver
el.deactivate();  // Stop the screen saver
el.isActive;      // Check if active (readonly)

// Properties
el.timeout = 300;        // Set timeout
el.effect = 'matrix';    // Change effect
el.speed = 1.5;          // Adjust speed

Events

el.addEventListener('screensaver-activate', () => {
  console.log('Screen saver started');
});

el.addEventListener('screensaver-deactivate', (e) => {
  console.log(`Active for ${e.detail.duration}ms`);
});

CSS Custom Properties

screen-saver {
  --screen-saver-bg: rgba(0, 0, 0, 0.95);
  --screen-saver-text-color: #00ff00;
  --screen-saver-font-family: 'Arial Black', sans-serif;
  --screen-saver-font-size: 4rem;
  --screen-saver-z-index: 999999;
}

Using with Vanilla Breeze

<screen-saver> reads Vanilla Breeze design tokens (--color-primary, --color-text, --font-sans, etc.) when no --screen-saver-* override is set. Apply a VB theme to the page and the screensaver inherits it:

<html data-theme="bauhaus">
  <screen-saver effect="bauhaus">Hello</screen-saver>
</html>

To make JS-driven palette effects (bounce3d, fireworks, bubbles, pipes, mystify, plasma) cycle through VB tokens instead of their built-in rainbow palettes, opt in with palette="theme":

<screen-saver effect="bounce3d" palette="theme">Hello</screen-saver>

For the full integration contract — tokens consumed, recommended theme pairings, reduced-motion contract — see admin/handoffs/screen-saver-integration.md in the Vanilla Breeze repo.

Custom Effects

import { ScreenSaver, Effect } from 'screen-saver';

class MyEffect extends Effect {
  start() {
    // Create your effect in this.container
    // Use this.text for the slot content
    // Use this.speed for animation speed
    // Check this.reducedMotion for accessibility
  }

  stop() {
    super.stop(); // Cancels requestAnimationFrame
  }

  destroy() {
    super.destroy(); // Full cleanup
  }
}

ScreenSaver.registerEffect('my-effect', MyEffect);

Development

npm install          # Install dependencies
npm run dev          # Start dev server
npm run build        # Build for production
npm run test         # Run tests

License

MIT