Skip to content

Commit 7fff8ad

Browse files
Implement customer display screensaver
1 parent d0ace1d commit 7fff8ad

2 files changed

Lines changed: 38 additions & 1 deletion

File tree

frontend/src/pages/display.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,14 @@ pub fn DisplayPage() -> impl IntoView {
159159

160160
view! {
161161
<div class="display-page">
162-
<Show when=move || active.get() fallback=|| ()>
162+
<Show
163+
when=move || active.get()
164+
fallback=|| view! {
165+
<div class="screensaver">
166+
<img class="screensaver-logo" src="/logo_site.png" alt="" />
167+
</div>
168+
}
169+
>
163170
<div class="display-items">
164171
<For each=move || items.get() key=|item| (item.id, item.quantity) let:item>
165172
<div class="display-item-row">

frontend/style/main.css

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2781,6 +2781,36 @@ button:focus-visible {
27812781
font-family: 'DotMatrix', 'Consolas', 'Courier New', monospace;
27822782
}
27832783

2784+
/* Screensaver shown when no transaction is active: bouncing logo */
2785+
.screensaver {
2786+
position: relative;
2787+
flex: 1;
2788+
overflow: hidden;
2789+
background: var(--vfd-bg);
2790+
}
2791+
2792+
.screensaver-logo {
2793+
position: absolute;
2794+
top: 0;
2795+
left: 0;
2796+
width: 240px;
2797+
height: 240px;
2798+
object-fit: contain;
2799+
filter: drop-shadow(0 0 14px var(--vfd-glow));
2800+
animation: ss-bounce-x 29s linear infinite alternate,
2801+
ss-bounce-y 18s linear infinite alternate;
2802+
}
2803+
2804+
@keyframes ss-bounce-x {
2805+
from { left: 0; }
2806+
to { left: calc(100% - 240px); }
2807+
}
2808+
2809+
@keyframes ss-bounce-y {
2810+
from { top: 0; }
2811+
to { top: calc(100% - 240px); }
2812+
}
2813+
27842814
.display-items {
27852815
flex: 1;
27862816
overflow-y: auto;

0 commit comments

Comments
 (0)