Last active
February 1, 2023 19:15
-
-
Save kevinsawicki/9d05fabdee32105367969bbca259ab3e to your computer and use it in GitHub Desktop.
Electron Vibrancy Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Vibrancy Example</title> | |
<style> | |
* { | |
color: rgba(100, 100, 100, 0.9); | |
} | |
h1 { | |
color: rgba(0, 0, 0, 0.9); | |
} | |
</style> | |
</head> | |
<body> | |
<h1>Vibrancy Example</h1> | |
<p>You can specify the vibrancy by either passing a <code>vibrancy</code> option to <code>new BrowserWindow(options)</code> | |
or by calling <code>BrowserWindow.setVibrancy(vibrancyType)</code>. | |
</p> | |
<form> | |
<p><b>Vibrancy Type</b></p> | |
<input type="radio" name="vibrancy" onclick="require('electron').remote.getCurrentWindow().setVibrancy()" checked>None<br> | |
<input type="radio" name="vibrancy" onclick="require('electron').remote.getCurrentWindow().setVibrancy('light')">Light<br> | |
<input type="radio" name="vibrancy" onclick="require('electron').remote.getCurrentWindow().setVibrancy('medium-light')">Medium Light<br> | |
<input type="radio" name="vibrancy" onclick="require('electron').remote.getCurrentWindow().setVibrancy('dark')">Dark<br> | |
<input type="radio" name="vibrancy" onclick="require('electron').remote.getCurrentWindow().setVibrancy('ultra-dark')">Ultra Dark<br> | |
</form> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {app, BrowserWindow} = require('electron') | |
let window | |
app.on('ready', () => { | |
window = new BrowserWindow() | |
window.loadURL(`file://${__dirname}/index.html`) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
BrowserWindow needs these options for this example to work as of electron 11.2.0 and macos Catalina: