diff --git a/simulator/static/style.css b/simulator/static/style.css
index 68a082a..2626d8a 100644
--- a/simulator/static/style.css
+++ b/simulator/static/style.css
@@ -268,3 +268,27 @@ nav button {
font-size: 1rem;
color: #ccc;
}
+
+
+.sleep-overlay {
+ position: fixed;
+ inset: 0;
+ background: #000;
+ color: #777;
+ z-index: 10000;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ font-size: 2rem;
+}
+
+.sleep-overlay.hidden {
+ display: none;
+}
+
+.sleep-overlay small {
+ margin-top: 10px;
+ font-size: 1rem;
+ color: #555;
+}
diff --git a/simulator/templates/index.html b/simulator/templates/index.html
index 8276763..20d256b 100644
--- a/simulator/templates/index.html
+++ b/simulator/templates/index.html
@@ -14,6 +14,11 @@
+
+
Screen Off
+
Tap to wake
+
+
@@ -129,6 +134,7 @@
let relayState = {};
let activeAlarmKey = null;
let acknowledgedAlarms = new Set();
+let screenWakeTimeout = null;
let alarmConfig = {
rear_seat_warning: 85,
@@ -289,6 +295,7 @@ async function loadStatus() {
document.getElementById('sysWifi').textContent = data.network.wifi_enabled ? 'Enabled' : 'Disabled';
document.getElementById('sysWifiOverride').textContent = data.network.wifi_override_active ? 'Active' : 'Inactive';
document.getElementById('sysIgnition').textContent = data.vehicle.ignition_on ? 'ON' : 'OFF';
+ updateSleepOverlay(data.vehicle.ignition_on);
checkAlarms(data);
}
@@ -303,6 +310,33 @@ async function toggleRelay(name) {
loadStatus();
}
+function updateSleepOverlay(ignitionOn) {
+ const overlay = document.getElementById('sleepOverlay');
+
+ if (ignitionOn) {
+ overlay.classList.add('hidden');
+ return;
+ }
+
+ if (!screenWakeTimeout) {
+ overlay.classList.remove('hidden');
+ }
+}
+
+function wakeScreen() {
+ const overlay = document.getElementById('sleepOverlay');
+ overlay.classList.add('hidden');
+
+ if (screenWakeTimeout) {
+ clearTimeout(screenWakeTimeout);
+ }
+
+ screenWakeTimeout = setTimeout(() => {
+ screenWakeTimeout = null;
+ overlay.classList.remove('hidden');
+ }, 10000);
+}
+
async function toggleIgnition() {
await fetch('/vehicle/ignition', {
method: 'POST',