mirror of
https://codeberg.org/armin/noiz.git
synced 2026-09-01 05:50:52 +02:00
remove noiz.py - we have https://codeberg.org/armin/noizapp (yes, Electron, I know...) for that now instead.
This commit is contained in:
parent
f11181232e
commit
e15c26ba9e
1 changed files with 0 additions and 26 deletions
26
noiz.py
26
noiz.py
|
|
@ -1,26 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
import webview
|
||||
def inject_zoom_shortcuts(window):
|
||||
window.evaluate_js(
|
||||
"""
|
||||
document.addEventListener('keydown', function(e) {
|
||||
if (!e.ctrlKey) return;
|
||||
var key = e.key;
|
||||
if (key === '=' || key === '+' || key === '-') {
|
||||
e.preventDefault();
|
||||
var cur = parseFloat(document.body.style.zoom) || 1;
|
||||
if (key === '-') {
|
||||
document.body.style.zoom = Math.max(0.25, +(cur - 0.1).toFixed(2));
|
||||
} else {
|
||||
document.body.style.zoom = Math.min(3, +(cur + 0.1).toFixed(2));
|
||||
}
|
||||
} else if (key === '0') {
|
||||
e.preventDefault();
|
||||
document.body.style.zoom = 1;
|
||||
}
|
||||
});
|
||||
"""
|
||||
)
|
||||
window = webview.create_window("noiz://", "https://bsd.pm/noiz/", zoomable=True)
|
||||
webview.start(inject_zoom_shortcuts, window)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue