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)