From: Scott Gasch
Date: Tue, 7 Apr 2026 04:02:39 +0000 (-0700)
Subject: Some layout improvements.
X-Git-Url: https://git.acknak.org/gitweb/?a=commitdiff_plain;h=712d0164e58c58b6463cb8237c53edb6969b96ae;p=kiosk.git
Some layout improvements.
---
diff --git a/kiosk.py b/kiosk.py
index fe9e174..55b1492 100755
--- a/kiosk.py
+++ b/kiosk.py
@@ -402,32 +402,29 @@ def emit_wrapped(
// Zoom the 'contents' div to fit without scrollbars and then make
// it visible.
function zoomScreen() {
- z = 285;
+ var content = document.getElementById("content");
+
+ // If we are on the photo page, skip zooming and show immediately
+ if (document.querySelector('.kiosk-container')) {
+ content.style.zoom = "100%";
+ content.style.visibility = "visible";
+ return;
+ }
+
+ // Legacy zoom logic for other pages
+ var z = 285;
do {
- document.getElementById("content").style.zoom = z+"%";
+ content.style.zoom = z + "%";
var body = document.body;
var html = document.documentElement;
- var height = Math.max(body.scrollHeight,
- body.offsetHeight,
- html.clientHeight,
- html.scrollHeight,
- html.offsetHeight);
- var windowHeight = window.innerHeight;
- var width = Math.max(body.scrollWidth,
- body.offsetWidth,
- html.clientWidth,
- html.scrollWidth,
- html.offsetWidth);
- var windowWidth = window.innerWidth;
- var heightRatio = height / windowHeight;
- var widthRatio = width / windowWidth;
-
- if (heightRatio <= 1.0 && widthRatio <= 1.0) {
+ var height = Math.max(body.scrollHeight, html.clientHeight);
+ var width = Math.max(body.scrollWidth, html.clientWidth);
+ if (height <= window.innerHeight && width <= window.innerWidth) {
break;
}
z -= 4;
} while(z >= 70);
- document.getElementById("content").style.visibility = "visible";
+ content.style.visibility = "visible";
}
// Load IMG tags with DATA-SRC attributes late.
@@ -552,10 +549,11 @@ def emit_wrapped(
"""
% kiosk_constants.root_url
)
+
f.write(f'')
f.write(
"""
-
+
|
@@ -567,38 +565,36 @@ def emit_wrapped(
|
-
- |
-
-
+ |
+
+
"""
)
f.write(f'')
f.write(
"""
-
-
-
-
+
+
+
"""
)
- f.write(f"{pageid} @ {age} ago.")
+ f.write(
+ ''
+ f'{pageid} @ {age} ago.'
+ )
f.write(
"""
-
-
-
-
-
-
+
+
+
"""
)
@@ -731,14 +727,14 @@ def main() -> None:
# point number within [0, 1]. A higher sensitivity
# reduces the miss rate at the cost of increased false
# alarm rate.
- sensitivities = [0.4] * len(keyword_paths)
- listener = listen.HotwordListener(
- command_queue,
- keyword_paths,
- sensitivities,
- )
- hotword_thread = Thread(target=listener.listen_forever, args=())
- hotword_thread.start()
+ #sensitivities = [0.4] * len(keyword_paths)
+ #listener = listen.HotwordListener(
+ # command_queue,
+ # keyword_paths,
+ # sensitivities,
+ #)
+ #hotword_thread = Thread(target=listener.listen_forever, args=())
+ #hotword_thread.start()
if changer_thread is None or not changer_thread.is_alive():
if changer_thread is None:
diff --git a/ratago_renderer.py b/ratago_renderer.py
index ef89765..59ebaae 100644
--- a/ratago_renderer.py
+++ b/ratago_renderer.py
@@ -73,8 +73,7 @@ class ratago_renderer(renderer.abstaining_renderer):
def update_page(self) -> bool:
with file_writer.file_writer(kiosk_constants.ratago_pagename) as f:
f.write(
- f"""
-Garage Door Status
+ f"""Garage Door Status