fix(display): cursor visible

This commit is contained in:
2026-01-10 01:06:29 +01:00
parent 6a65ac7e70
commit 438c64f055
+40 -37
View File
@@ -1,16 +1,15 @@
package web package web
templ indexTemplate() { templ indexTemplate() {
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<head> <meta charset="UTF-8"/>
<meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>PLG Connect Display</title>
<title>PLG Connect Display</title> <script src="/static/htmx.min.js"></script>
<script src="/static/htmx.min.js"></script> <script src="/static/htmx-ext-sse.min.js"></script>
<script src="/static/htmx-ext-sse.min.js"></script> <style>
<style>
:root { :root {
--background-color: black; --background-color: black;
--foreground-color: oklch(92.3% 0.003 48.717); --foreground-color: oklch(92.3% 0.003 48.717);
@@ -33,6 +32,7 @@ templ indexTemplate() {
background-color: var(--background-color); background-color: var(--background-color);
color: var(--foreground-color); color: var(--foreground-color);
font-family: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; font-family: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
cursor: none;
} }
video, video,
@@ -60,7 +60,7 @@ templ indexTemplate() {
padding-left: calc(var(--font-size)*1.5); padding-left: calc(var(--font-size)*1.5);
} }
</style> </style>
<script> <script>
document.addEventListener('keydown', function (event) { document.addEventListener('keydown', function (event) {
if (event.code === 'Space') { if (event.code === 'Space') {
event.preventDefault(); event.preventDefault();
@@ -75,46 +75,49 @@ templ indexTemplate() {
} }
}); });
</script> </script>
</head> </head>
<bod> <bod>
<div hx-get="/splash" hx-trigger="load"></div> <div hx-get="/splash" hx-trigger="load"></div>
<main hx-ext="sse" sse-connect="/sse" sse-swap="message"></main> <main hx-ext="sse" sse-connect="/sse" sse-swap="message"></main>
</bod> </bod>
</html>
</html>
} }
templ videoTemplate(path string) { templ videoTemplate(path string) {
<video autoplay> <video autoplay>
<source src={ "/api/file/" + path } type="video/mp4" /> <source src={ "/api/file/" + path } type="video/mp4"/>
</video> </video>
} }
templ imageTemplate(path string) { templ imageTemplate(path string) {
<img src={ "/api/file/" + path } /> <img src={ "/api/file/" + path }/>
} }
templ deviceInfoTemplate(ip string, mac string, showQR bool) { templ deviceInfoTemplate(ip string, mac string, showQR bool) {
<div style="width: 100vw; height: 100vh; display: flex; flex-direction: row; justify-content: space-between;"> <div style="width: 100vw; height: 100vh; display: flex; flex-direction: row; justify-content: space-between;">
<div <div
style="display: flex; flex-direction: column; gap: 1rem; justify-content: end; padding: 2rem; font-size: 4rem;"> style="display: flex; flex-direction: column; gap: 1rem; justify-content: end; padding: 2rem; font-size: 4rem;"
{ ip } >
<span style="text-transform: uppercase;">{ mac }</span> { ip }
</div> <span style="text-transform: uppercase;">{ mac }</span>
if showQR {
<div style="display: flex; justify-content: end; align-items: end; padding: 2rem;">
<div style="padding: 1rem; background-color: var(--foreground-color); border-radius: 1rem;">
<img style="height: 30vh; width: auto; image-rendering: pixelated; image-rendering: crisp-edges;"
src={ "/qr?data=http://" + ip + ":8080" } alt="QR-Code" />
</div> </div>
if showQR {
<div style="display: flex; justify-content: end; align-items: end; padding: 2rem;">
<div style="padding: 1rem; background-color: var(--foreground-color); border-radius: 1rem;">
<img
style="height: 30vh; width: auto; image-rendering: pixelated; image-rendering: crisp-edges;"
src={ "/qr?data=http://" + ip + ":8080" }
alt="QR-Code"
/>
</div>
</div>
}
</div> </div>
} <style>
</div>
<style>
:root { :root {
--splash-bg: transparent !important; --splash-bg: transparent !important;
--splash-fade-out-state: paused !important; --splash-fade-out-state: paused !important;
--background-color: oklch(21.6% 0.006 56.043); --background-color: oklch(21.6% 0.006 56.043);
} }
</style> </style>
} }