Package Exports
- electron-acrylic-window
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (electron-acrylic-window) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
electron-acrylic-window

Simply add vibrancy effect to Electron application on Windows.
Works only on Windows 10.
Inspired from electron-vibrancy
.
Download
npm i electron-acrylic-window --save
Screenshots
Usage
setVibrancy
setVibrancy(win);
Enables Vibrancy to window.
There is no return value. If it fails to set vibrancy, it throws error.win
should be frameLess, and transparent.
Errors
- NOT_MATCHING_PLATFORM
Error that occurs when os is not Windows 10. - WINDOW_NOT_GIVEN
Error that occurs whenwin
parameter is not passed. - NOT_VALID_WINDOW
Error that occurs whenwin
parameter is not valid Electron window. - FAIL_LOAD_DLL
Error that occurs when fails to load SetWindowCompositionAttribute from user32.dll - UNKNOWN
Unknown error.
disableVibrancy
disableVibrancy(win);
Disables Vibrancy to window.
There is no return value. If it fails to disable vibrancy, it throws error.win
should be frameLess, and transparent.
Errors
- NOT_MATCHING_PLATFORM
Error that occurs when os is not Windows 10. - WINDOW_NOT_GIVEN
Error that occurs whenwin
parameter is not passed. - NOT_VALID_WINDOW
Error that occurs whenwin
parameter is not valid Electron window. - UNKNOWN
Unknown error.
Example
const vibrancy = require('electron-acrylic-window');
const {app, BrowserWindow} = require('electron');
let win;
function createWindow() {
win = new BrowserWindow({
width: 800,
height: 600,
frame: false,
transparent: true
});
win.loadURL(`file://${__dirname}/index.html`);
vibrancy.setVibrancy(win);
}
app.on('ready', createWindow);