0.1.0 • Published 3 years ago

electron-vibrancy-windows v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Electron Vibrancy for Windows

Build Dependencies

This module uses native API calls to achieve the blur effect on an Electron app.

npm.io

Installation

You will need Python, Visual Studio or Visual C++ build tools to install this. An easy way to install them can be found here.

yarn add DrunkWinter/electron-vibrancy-windows

or

npm install DrunkWinter/electron-vibrancy-windows

Important

Don't forget to specify a transparent backgroundColor!

{ backgroundColor: '#00000000' } 

Although it might work, it is not recommended using this module on a machine older than Windows 10.

How to use

const vibrancy = require('electron-vibrancy');

function createWindow() {
    // Create the browser window.
    const mainWindow = new BrowserWindow({
        title: 'My App',
        width: 1200,
        height: 760,
        frame: false,
        backgroundColor: '#00000000',
        webPreferences: {
            nodeIntegration: true
        }
    });

    vibrancy.EnableVibrancy(mainWindow);

    mainWindow.loadFile(path.join(__dirname, 'index.html'));
};

app.on('ready', createWindow);

API

EnableVibrancy(window)

Returns Integer.

  • window BrowserWindow instance

DisableVibrancy(window)

Returns Integer. Disables Vibrancy.

  • window BrowserWindow instance

Platform notices

The addon uses SetWindowCompositionAttribute, which is an undocumented Windows API, which means it can be changed by Microsoft any time and break the functionality.

License

This project is under MIT. See LICENSE

0.1.0

3 years ago

1.0.0

3 years ago