From 575d75d1fc579abdb07686ba62c1bbbc3542566f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Bene=C5=A1?= Date: Fri, 1 Dec 2023 12:18:17 +0100 Subject: [PATCH] ... --- views/index.ejs | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/views/index.ejs b/views/index.ejs index b39c7a5..e7a641b 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -400,13 +400,13 @@ var currentTimestamp = new Date(); var timeDifferenceInSeconds = (currentTimestamp - timestamp) / 1000; if (timeDifferenceInSeconds < 60) { - timestampBackgroundColor = 'green'; + timestampBackgroundColor = 'rgba(0, 128, 0, 0.7)'; } else if (timeDifferenceInSeconds >= 60 && timeDifferenceInSeconds <= 300) { - timestampBackgroundColor = 'orange'; + timestampBackgroundColor = 'rgba(255, 165, 0, 0.7)'; } else { - timestampBackgroundColor = 'red'; + timestampBackgroundColor = 'rgba(255, 0, 0, 0.7)'; } - document.getElementById('cdpHb').textContent = timestamp.toLocaleString() + ", Time difference: " + timeDifferenceInSeconds; + document.getElementById('cdpHb').textContent = timestamp.toLocaleString() + ", (-" + timeDifferenceInSeconds + "s)"; document.getElementById('cdpHb').style.backgroundColor = timestampBackgroundColor; } @@ -416,13 +416,13 @@ var currentTimestamp = new Date(); var timeDifferenceInSeconds = (currentTimestamp - timestamp) / 1000; if (timeDifferenceInSeconds < 60) { - timestampBackgroundColor = 'green'; + timestampBackgroundColor = 'rgba(0, 128, 0, 0.7)'; } else if (timeDifferenceInSeconds >= 60 && timeDifferenceInSeconds <= 300) { - timestampBackgroundColor = 'orange'; + timestampBackgroundColor = 'rgba(255, 165, 0, 0.7)'; } else { - timestampBackgroundColor = 'red'; + timestampBackgroundColor = 'rgba(255, 0, 0, 0.7)'; } - document.getElementById('car1Hb').textContent = timestamp.toLocaleString() + ", Time difference: " + timeDifferenceInSeconds; + document.getElementById('car1Hb').textContent = timestamp.toLocaleString() + ", (-" + timeDifferenceInSeconds + "s)"; document.getElementById('car1Hb').style.backgroundColor = timestampBackgroundColor; } @@ -432,13 +432,13 @@ var currentTimestamp = new Date(); var timeDifferenceInSeconds = (currentTimestamp - timestamp) / 1000; if (timeDifferenceInSeconds < 60) { - timestampBackgroundColor = 'green'; + timestampBackgroundColor = 'rgba(0, 128, 0, 0.7)'; } else if (timeDifferenceInSeconds >= 60 && timeDifferenceInSeconds <= 300) { - timestampBackgroundColor = 'orange'; + timestampBackgroundColor = 'rgba(255, 165, 0, 0.7)'; } else { - timestampBackgroundColor = 'red'; + timestampBackgroundColor = 'rgba(255, 0, 0, 0.7)'; } - document.getElementById('car2Hb').textContent = timestamp.toLocaleString() + ", Time difference: " + timeDifferenceInSeconds; + document.getElementById('car2Hb').textContent = timestamp.toLocaleString() + ", (-" + timeDifferenceInSeconds + "s)"; document.getElementById('car2Hb').style.backgroundColor = timestampBackgroundColor; } function updateStaticTableWithcar3Hb(HbData) { @@ -447,13 +447,13 @@ var currentTimestamp = new Date(); var timeDifferenceInSeconds = (currentTimestamp - timestamp) / 1000; if (timeDifferenceInSeconds < 60) { - timestampBackgroundColor = 'green'; + timestampBackgroundColor = 'rgba(0, 128, 0, 0.7)'; } else if (timeDifferenceInSeconds >= 60 && timeDifferenceInSeconds <= 300) { - timestampBackgroundColor = 'orange'; + timestampBackgroundColor = 'rgba(255, 165, 0, 0.7)'; } else { - timestampBackgroundColor = 'red'; + timestampBackgroundColor = 'rgba(255, 0, 0, 0.7)'; } - document.getElementById('car3Hb').textContent = timestamp.toLocaleString() + ", Time difference: " + timeDifferenceInSeconds; + document.getElementById('car3Hb').textContent = timestamp.toLocaleString() + ", (-" + timeDifferenceInSeconds + "s)"; document.getElementById('car3Hb').style.backgroundColor = timestampBackgroundColor; } function updateStaticTableWithldpHb(HbData) { @@ -462,13 +462,13 @@ var currentTimestamp = new Date(); var timeDifferenceInSeconds = (currentTimestamp - timestamp) / 1000; if (timeDifferenceInSeconds < 60) { - timestampBackgroundColor = 'green'; + timestampBackgroundColor = 'rgba(0, 128, 0, 0.7)'; } else if (timeDifferenceInSeconds >= 60 && timeDifferenceInSeconds <= 300) { - timestampBackgroundColor = 'orange'; + timestampBackgroundColor = 'rgba(255, 165, 0, 0.7)'; } else { - timestampBackgroundColor = 'red'; + timestampBackgroundColor = 'rgba(255, 0, 0, 0.7)'; } - document.getElementById('ldpHb').textContent = timestamp.toLocaleString() + ", Time difference: " + timeDifferenceInSeconds; + document.getElementById('ldpHb').textContent = timestamp.toLocaleString() + ", (-" + timeDifferenceInSeconds + "s)"; document.getElementById('ldpHb').style.backgroundColor = timestampBackgroundColor; }