ChromaticBlur.js Plugin Demo

This page demonstrates the ChromaticBlur.js plugin โ€” a modern, vanilla JavaScript solution for creating chromatic aberration blur effects (โ‰ˆ2.1 KB gzipped). The navigation bar above uses the plugin with default settings.

Try scrolling to see how the background texture interacts with the blur effect.

Live Controls

Subtle Effect

Low offset, minimal blur

const subtle = new ChromaticBlur('.card-1', {
  redOffset: 2,
  blueOffset: -2,
  blurAmount: 2
});

Medium Effect

Balanced settings

const medium = new ChromaticBlur('.card-2', {
  redOffset: 5,
  blueOffset: -5,
  blurAmount: 4
});

Intense Effect

High offset, maximum blur

const intense = new ChromaticBlur('.card-3', {
  redOffset: 12,
  blueOffset: -12,
  blurAmount: 8,
  displacementScale: 100
});

Usage Example

// Initialize with default settings
const blur = new ChromaticBlur('.navbar');

// Or with custom options
const blur2 = new ChromaticBlur('.navbar', {
  redOffset: 8,
  blueOffset: -8,
  blurAmount: 5,
  displacementScale: 75
});

// Update dynamically
blur.update({ redOffset: 10 });

// Cleanup
blur.destroy();

Key Features

๐ŸŽจ Beautiful chromatic aberration with color channel splitting

๐Ÿชถ Zero dependencies - pure vanilla JavaScript

โšก Lightweight and performant

๐Ÿ”ง Highly configurable with sensible defaults

๐Ÿ”— Method chaining support

๐Ÿงน Automatic cleanup and memory management

โ™ฟ Accessible (screen reader friendly)

๐Ÿ“ฆ Multiple module formats (ES6, CommonJS, AMD, Global)