Socket
Book a DemoInstallSign in
Socket

progressive-acrylic

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

progressive-acrylic

Advanced layered acrylic glass effects for web elements. Create iOS/Windows-style acrylic blur overlays with multiple customizable layers: blur, luminosity, tint, and noise.

latest
Source
npmnpm
Version
2.0.2
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

logo

Progressive Acrylic

🎨 Advanced layered acrylic glass and progressive (guassian) blur effects for web elements. Create iOS/Windows-style acrylic blur overlays with multiple customizable layers: blur, luminosity, tint, and noise.

License Version

Progressive Acrylic Editor | Docs

I created an interactive editor since it might be challenging for beginners to use the library directly.

🎯 Project Purpose

Progressive Acrylic aims to bring sophisticated acrylic glass and progressive blur effects to web interfaces, inspired by both iOS and Windows design languages. The library provides a powerful yet easy-to-use solution for creating layered blur effects that can enhance the visual hierarchy and depth of web applications.

Progressive Acrylic Demo Progressive Acrylic Demo

The project focuses on:

  • Creating natural, iOS-style progressive blur transitions
  • Implementing Windows Acrylic material design principles
  • Providing granular control over each visual layer
  • Maintaining high performance through CSS optimizations

📖 Project Background

This project started as an iOS-style progressive blur implementation, inspired by projects like Glur which creates beautiful progressive blur effects in SwiftUI.

Progressive blur creates a natural feathering effect where the blur intensity gradually increases, mimicking the depth of field effect seen in iOS interfaces.

iOS Progressive Blur Layers

Multiple progressive blur layers working together

Later, the project evolved to implement Microsoft Windows Acrylic design language, following the official Windows Acrylic Material guidelines. The Windows acrylic system uses a sophisticated 4-layer approach that combines blur, luminosity adjustments, color tinting, and noise texture to create the distinctive frosted glass appearance.

Acrylic Layer System

The Windows Acrylic layer system: Desktop background → Gaussian blur → Luminosity blend → Tint/Color blend → Noise texture

The layer architecture directly follows Microsoft's design specifications, implementing the same background source, blur effects, exclusion blending, color tinting, and noise patterns that make Windows Acrylic so distinctive and visually appealing.

✨ Features

  • 🔥 4-Layer System - Blur, Luminosity, Tint, and Noise layers
  • 🎨 Advanced Tint System - Solid colors or linear gradients with individual opacity
  • 🎯 Custom Cubic-Bezier Curves - Full curve customization for feathering
  • 💡 Luminosity Layer - Brightness, contrast, saturation adjustments
  • 🎪 Noise Layer - Grain effects like Windows Acrylic
  • High Performance - Uses CSS backdrop-filter and mask
  • 🧩 Unified API - Single function handles all layers

🚀 Quick Start

Installation

npm install progressive-acrylic

Basic Usage

<div class="image-container">
  <div class="blur-overlay" id="myBlur"></div>
</div>

<script src="./progressive-acrylic.js"></script>
<script>
  progressiveAcrylic(document.getElementById('myBlur'), {
    blur: {
      enabled: true,
      direction: 'bottom',
      height: '50%',
      maxBlur: 200
    },
    tint: {
      enabled: true,
      color: '#ffffff',
      opacity: 0.1
    }
    ...
  });
</script>

📋 API Reference

progressiveAcrylic(target, options)

The main function for creating layered acrylic effects.

Parameters

ParameterTypeDefaultDescription
targetHTMLElement-Target DOM element for blur overlay
optionsObject{}Configuration options

Options Object Structure

{
  blur: { /* Blur layer settings */ },
  luminosity: { /* Luminosity layer settings */ },
  tint: { /* Tint layer settings */ },
  noise: { /* Noise layer settings */ }
}

🎯 Layer Configuration

Blur Layer Options

OptionTypeDefaultRange/ValuesDescription
enabledBooleantruetrue/falseEnable/disable blur layer
directionString'bottom''top', 'bottom', 'left', 'right'Blur fade direction
heightString'60%''10%' - '100%'Height of blur area
layersNumber83 - 20Number of blur layers (more = smoother)
maxBlurNumber400 - 1000Maximum blur amount in pixels
startOpacityNumber00 - 1Starting opacity of gradient
endOpacityNumber10 - 1Ending opacity of gradient
positionString'bottom''top', 'bottom'Vertical position of blur area
curveArray[0.25, 0.46, 0.45, 0.94]Cubic-bezier values, 'linear', 'ease-in', 'ease-out', 'ease-in-out'Distribution curve for layers

Luminosity Layer Options

OptionTypeDefaultRange/ValuesDescription
enabledBooleanfalsetrue/falseEnable/disable luminosity layer
brightnessNumber1.10 - 2Brightness adjustment
contrastNumber1.050 - 2Contrast adjustment
saturateNumber1.20 - 3Saturation adjustment
opacityNumber0.80 - 1Layer opacity
blendModeString'normal'CSS blend modesMix blend mode

Tint Layer Options

OptionTypeDefaultRange/ValuesDescription
enabledBooleanfalsetrue/falseEnable/disable tint layer
colorString'#ffffff'Hex colorSolid color (when no gradient)
gradientObjectnullGradient objectLinear gradient configuration
opacityNumber0.10 - 1Layer opacity
blendModeString'overlay'CSS blend modesMix blend mode

Gradient Object Structure

gradient: {
  direction: 'to bottom',  // CSS gradient direction
  colors: [
    { color: '#ffffff', stop: 0, opacity: 0.3 },
    { color: '#000000', stop: 100, opacity: 0.7 }
  ]
}

Noise Layer Options

OptionTypeDefaultRange/ValuesDescription
enabledBooleanfalsetrue/falseEnable/disable noise layer
opacityNumber0.30 - 1Layer opacity
blendModeString'multiply'CSS blend modesMix blend mode

📖 Usage Examples

iOS-Style Acrylic

progressiveAcrylic(element, {
  blur: {
    enabled: true,
    direction: 'top',
    height: '40%',
    layers: 6,
    maxBlur: 130,
    startOpacity: 0,
    endOpacity: 1,
    position: 'top',
    curve: [0.62, 0.123, 0.92, 0.002]
  },
  luminosity: {
      enabled: true,
      brightness: 1,
      contrast: 1.2,
      saturate: 1.3,
      opacity: 1,
      blendMode: 'normal'
  },
  tint: {
      enabled: true,
      color: '#000000',
      opacity: 0.75,
      blendMode: 'normal'
  },
  noise: {
      enabled: false,
      opacity: 0.3,
      blendMode: 'multiply'
  }
});

Windows Acrylic

progressiveAcrylic(element, {
  blur: {
    enabled: true,
    direction: 'bottom',
    height: '100%',
    layers: 4,
    maxBlur: 200,
    startOpacity: 1,
    endOpacity: 1,
    position: 'bottom',
    curve: 'linear'
  },
  luminosity: {
      enabled: true,
      brightness: 1.1,
      contrast: 1,
      saturate: 1.2,
      opacity: 1,
      blendMode: 'normal'
  },
  tint: {
      enabled: false,
      color: '#ffffff',
      opacity: 0.15,
      blendMode: 'normal'
  },
  noise: {
      enabled: true,
      opacity: 1,
      blendMode: 'overlay'
  }
});

Glass Morphism Effect

progressiveAcrylic(element, {
  blur: {
    enabled: true,
    direction: 'bottom',
    height: '33%',
    layers: 3,
    maxBlur: 300,
    curve: [0.09, 0.93, 0.7, 0.01]
  },
  luminosity: {
    enabled: false
  },
  tint: {
    enabled: false
  },
  noise: {
    enabled: false
  }
});

Gradient Tint Effect

progressiveAcrylic(element, {
  blur: {
    enabled: true,
    maxBlur: 150,
    height: '60%'
  },
  tint: {
    enabled: true,
    gradient: {
      direction: 'to bottom',
      colors: [
        { color: '#ffffff', stop: 0, opacity: 0.3 },
        { color: '#000000', stop: 50, opacity: 0.1 },
        { color: '#0066cc', stop: 100, opacity: 0.5 }
      ]
    },
    opacity: 1,
    blendMode: 'overlay'
  }
});

🎨 Curve Options

Control how blur layers are distributed using cubic-bezier curves.

Preset Curves

// iOS-style smooth animation
curve: [0.25, 0.46, 0.45, 0.94]

// Bounce effect
curve: [0.68, -0.55, 0.265, 1.55]

// Extreme ease-out
curve: [0.16, 1, 0.3, 1]

// Sharp start, smooth end
curve: [0.7, 0, 0.84, 0]

🔧 Advanced Usage

Update Method

const acrylic = progressiveAcrylic(element, initialOptions);

// Update settings
acrylic.update({
  blur: { maxBlur: 300 },
  tint: { opacity: 0.2 }
});

// Destroy effect
acrylic.destroy();

Multiple Blur Areas

// Header blur
progressiveAcrylic(headerElement, {
  blur: { direction: 'top', position: 'top', height: '30%' },
  tint: { enabled: true, color: '#000000', opacity: 0.3 }
});

// Footer blur
progressiveAcrylic(footerElement, {
  blur: { direction: 'bottom', position: 'bottom', height: '40%' },
  luminosity: { enabled: true, brightness: 1.2 }
});

🎨 CSS Setup

Ensure your HTML structure supports backdrop-filter:

.image-container {
  position: relative;
  background-image: url('your-image.jpg');
  background-size: cover;
  background-position: center;
  width: 100%;
  height: 400px;
}

.blur-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

🌐 Browser Support

BrowserChromeFirefoxSafariEdge
Version76+103+14+79+

Backdrop-filter is required for blur effects to work.

📄 License

MIT License - see LICENSE file for details.

🤝 Contributing

Contributions welcome!

🙏 Credits

Keywords

acrylic

FAQs

Package last updated on 05 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts