Merge pull request #25 from 0hAodha/earlynlate

red icon if train late, green if not
This commit is contained in:
2023-03-03 12:26:02 +00:00
committed by GitHub
10 changed files with 152 additions and 104 deletions

5
.idea/.gitignore generated vendored Normal file
View File

@ -0,0 +1,5 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/

8
.idea/modules.xml generated Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/traintracker.iml" filepath="$PROJECT_DIR$/.idea/traintracker.iml" />
</modules>
</component>
</project>

12
.idea/traintracker.iml generated Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

6
dist/index.html vendored
View File

@ -2,11 +2,11 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<link rel="icon" href="/assets/train-solid-e7249eb7.svg">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Irish Rail Tracker</title>
<script type="module" crossorigin src="/assets/index-a9090275.js"></script>
<link rel="stylesheet" href="/assets/index-1f27b1b8.css">
<script type="module" crossorigin src="/assets/index-ed2bec8f.js"></script>
<link rel="stylesheet" href="/assets/index-debbf736.css">
</head>
<body>
<div id="app"></div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -39,9 +39,10 @@
<template v-for="coordinate, i in coordinates" :position="inline-block">
<!-- overlay offset is the size of the image so that it is centered-->
<ol-overlay :position="coordinate" :positioning="center-center" :offset="[-16,-16]">
<ol-overlay :position="coordinate" :positioning="center-center" :offset="[-14,-16]">
<div class="overlay-content" @click="getSelectedTrain(i)">
<img src="../assets/train-solid.svg" class="trainMapIcon" alt="Train Icon">
<img v-if="isTrainLate(i)" src="../assets/red-train-solid.png" class="trainMapIcon" alt="Train Icon">
<img v-else src="../assets/green-train-solid.png" class="trainMapIcon" alt="Train Icon">
</div>
</ol-overlay>
@ -207,6 +208,22 @@ export default {
this.selectedDataMap["PublicMessage"] = this.allDataMap[i]["PublicMessage"][0];
},
// method to determine whether or not a selected train is late
isTrainLate(i) {
// check if the train is running
if (this.allDataMap[i]["TrainStatus"][0] == "R") {
let publicMessage = this.allDataMap[i]["PublicMessage"][0];
let startTimeStr = publicMessage.indexOf("(");
// checking if the train is late
if (publicMessage[startTimeStr+1] != "-" && publicMessage[startTimeStr+1] != "0") {
return true;
}
}
return false;
},
// ---------------- TESTING ----------------
postLiveTrainData() {
const functions = getFunctions(app);
@ -231,8 +248,8 @@ export default {
}
.trainMapIcon {
width: 28px;
height: 32px;
width: 32px;
}
.slideLeft-enter-active, .slideLeft-leave-active {