From e2b2838c65bf5a4cd85b0f534e8126450f1fbc55 Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Tue, 06 Dec 2016 21:27:53 +0000
Subject: [PATCH] Feature delayed and "at stop" entries

---
 index.js   |   16 +++++++++++-----
 index.html |    9 +++++++++
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/index.html b/index.html
index 57e0c62..c7be53f 100644
--- a/index.html
+++ b/index.html
@@ -22,6 +22,15 @@
 			.input-group-btn:first-child {
 				width: 50%;
 			}
+			@keyframes blink {
+				50% { color: transparent; }
+			}
+			.status-boarding {
+				animation: blink 1s linear infinite;
+			}
+			.status-delayed {
+				font-weight: bold;
+			}
 		</style>
 	</head>
 	<body>
diff --git a/index.js b/index.js
index 2e4dc3e..f6c900c 100644
--- a/index.js
+++ b/index.js
@@ -170,13 +170,19 @@
 			addCellWithText(tr, data.actual[i].patternText);
 			addCellWithText(tr, data.actual[i].direction);
 			var status = parseStatus(data.actual[i]);
-			addCellWithText(tr, status);
+			var status_cell = addCellWithText(tr, status);
 			var delay = parseDelay(data.actual[i]);
-			addCellWithText(tr, delay);
+			var delay_cell = addCellWithText(tr, delay);
 			
-			if(status == parseStatusBoarding) tr.className = 'success';
-			else if(parseInt(delay) > 9) tr.className = 'danger';
-			else if(parseInt(delay) > 3) tr.className = 'warning';
+			if(status == parseStatusBoarding) {
+				tr.className = 'success';
+				status_cell.className = 'status-boarding';
+			} else if(parseInt(delay) > 9) {
+				tr.className = 'danger';
+				delay_cell.className = 'status-delayed';
+			} else if(parseInt(delay) > 3) {
+				tr.className = 'warning';
+			}
 			times_table.appendChild(tr);
 		}
 		

--
Gitblit v1.9.1