// 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.
"""
% kiosk_constants.root_url
)
+
f.write(f'<BODY BGCOLOR="#{bgcolor}">')
f.write(
"""
- <TABLE style="height:100%; width:100%" BORDER=0>
+ <TABLE style="width:100%" BORDER=0>
<TR HEIGHT=30>
<TD ALIGN="left">
<DIV id="date"> </DIV>
<DIV id="time"> </DIV>
</TD>
</TR>
- <TR STYLE="vertical-align:top">
- <TD COLSPAN=3>
- <DIV ID="content" STYLE="zoom: 1; visibility: hidden;">
- <!-- BEGIN main page contents. -->
+ </TABLE>
+ <DIV ID="content" STYLE="flex: 1; width: 100%; visibility: hidden;">
+ <!-- BEGIN main page contents. -->
"""
)
f.write(f'<!--#include virtual="{filename}"-->')
f.write(
"""
- <!-- END main page contents. -->
- </DIV>
- <BR>
- <DIV STYLE="position: absolute; top:1030px; width:99%">
- <P ALIGN="right">
+ <!-- END main page contents. -->
+ </DIV>
+ <DIV STYLE="position: absolute; bottom: 0; width: 100%; left: 0;">
+ <!-- <DIV STYLE="position: absolute; top:1030px; width:99%"> -->
+ <P ALIGN="right" STYLE="margin: 0 10px 2px 0;">
"""
)
- f.write(f"<FONT SIZE=2 COLOR=#bbbbbb>{pageid} @ {age} ago.</FONT>")
+ f.write(
+ '<span style="font-size: 0.6rem; color: #888888; font-family: monospace;">'
+ f'{pageid} @ {age} ago.</span>'
+ )
f.write(
"""
- </P>
- <HR id="countdown" STYLE="width:0px;
- text-align:left;
- margin:0;
- border:none;
- border-width:0;
- height:5px;
- visibility:hidden;
- background-color:#ffffff;">
- </DIV>
- </TD>
- </TR>
- </TABLE>
+ </P>
+ <HR id="countdown" STYLE="width: 0px;
+ text-align: left;
+ margin: 0;
+ border: none;
+ height: 5px;
+ visibility: hidden;
+ background-color: maroon;">
+ </DIV>
</BODY>"""
)
# 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: