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-tv-static

v1.0.3

Published

A WebGL-based TV static effect packaged as a modern web component. Create realistic CRT-style static noise for your web projects.

Downloads

5

Readme

TV Static WebGL

A WebGL-based TV static effect packaged as a modern web component. Create realistic CRT-style static noise for your web projects.

🚀 Quick Start (CDN)

Simply include the script and use the web component:

<!DOCTYPE html>
<html>
<head>
    <title>TV Static Demo</title>
</head>
<body>
    <!-- Include the TV Static component -->
    <script src="https://your-cdn.com/tv-static.umd.js"></script>
    
    <!-- Use the web component -->
    <tv-static auto-start lines="120" style="width: 100vw; height: 100vh;"></tv-static>
</body>
</html>

📦 Installation

CDN (Recommended)

<script src="https://your-cdn.com/tv-static.umd.js"></script>

ES Modules

<script type="module">
  import 'https://your-cdn.com/tv-static.es.js';
</script>

NPM (for bundlers)

npm install tv-static-webgl

🎮 Usage

Basic Usage

<tv-static auto-start></tv-static>

With Custom Settings

<tv-static 
  auto-start 
  lines="240" 
  style="width: 800px; height: 600px;">
</tv-static>

Programmatic Control

<tv-static id="static" lines="120"></tv-static>

<script>
  const staticElement = document.getElementById('static');
  
  // Wait for the component to be ready
  staticElement.addEventListener('tv-static-ready', () => {
    // Start the animation
    staticElement.start();
    
    // Change line density
    staticElement.setLines(180);
    
    // Stop the animation
    // staticElement.stop();
  });
  
  // Handle errors
  staticElement.addEventListener('tv-static-error', (event) => {
    console.error('TV Static error:', event.detail.error);
  });
</script>

🔧 API Reference

Attributes

| Attribute | Type | Default | Description | |-----------|------|---------|-------------| | lines | number | 120 | Number of vertical lines (affects resolution/detail) | | auto-start | boolean | false | Whether to start animation automatically |

Methods

| Method | Description | |--------|-------------| | start() | Start the static animation | | stop() | Stop the static animation | | setLines(number) | Change the number of vertical lines |

Events

| Event | Description | |-------|-------------| | tv-static-ready | Fired when the component is initialized and ready | | tv-static-error | Fired when there's an initialization error |

🎨 Styling

The component is designed to fill its container. Use CSS to control size and appearance:

tv-static {
  width: 100vw;
  height: 100vh;
  display: block;
}

/* Fullscreen background effect */
.tv-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
}

💡 Examples

Fullscreen Background

<tv-static 
  class="tv-background" 
  auto-start 
  lines="120">
</tv-static>

Retro TV Effect

<div style="width: 640px; height: 480px; border: 20px solid #333; border-radius: 10px;">
  <tv-static auto-start lines="240"></tv-static>
</div>

Interactive Control Panel

<tv-static id="interactive-static" lines="120"></tv-static>

<div>
  <button onclick="document.getElementById('interactive-static').start()">Start</button>
  <button onclick="document.getElementById('interactive-static').stop()">Stop</button>
  <input type="range" min="60" max="300" value="120" 
         onchange="document.getElementById('interactive-static').setLines(this.value)">
  <span>Lines: <span id="line-count">120</span></span>
</div>

🛠️ Development

Prerequisites

  • Node.js 16+
  • npm or yarn

Setup

# Clone the repository
git clone <repository-url>
cd tv-static

# Install dependencies
npm install

# Start development server
npm run dev

Build for Production

# Build library for CDN distribution
npm run build

# Output files:
# dist/tv-static.es.js    - ES module
# dist/tv-static.umd.js   - UMD bundle (for CDN)

Project Structure

src/
├── tv-static.js        # Core WebGL TV static class
├── webcomponent.js     # Web component wrapper
└── shaders/
    ├── vertex.glsl     # Vertex shader
    └── fragment.glsl   # Fragment shader

🎯 Browser Support

  • Chrome 51+
  • Firefox 52+
  • Safari 10+
  • Edge 79+

Requires WebGL support. The component will throw an error if WebGL is not available.

📝 License

MIT License - see LICENSE file for details.

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

🐛 Issues

Found a bug or have a feature request? Please open an issue on GitHub.