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; }