Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major API refactor and additional features/fixes #9

Merged
merged 10 commits into from
Jan 29, 2018
70 changes: 70 additions & 0 deletions MMM-MBTA.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
.MMM-MBTA .red {
color: #cd2230;
}

.MMM-MBTA .blue {
color: #0064c8;
}

.MMM-MBTA .orange {
color: #ff8200;
}

.MMM-MBTA .green {
color: #428608;
}

.MMM-MBTA .commuter {
color: #a00a78;
}

.MMM-MBTA .bus {
color: #ffce0c;
}

.MMM-MBTA .boat {
color: #5da9e8;
}

.alerts {
margin-top: 6px;
}

.MMM-MBTA .alert {
display: inline-block;
position: relative;
width: 100%;
height: 100%;
margin: 0;
text-align: left;
white-space: nowrap;
/* Starting position */
-moz-transform:translateX(100%);
-webkit-transform:translateX(100%);
transform:translateX(100%);
/* Apply animation to this element */
-moz-animation: td 17s linear infinite;
-webkit-animation: td 17s linear infinite;
animation: td 17s linear infinite;
}
/* Move it (define the animation) */
@-moz-keyframes td {
0% { -moz-transform: translateX(100%); }
100% { -moz-transform: translateX(-100%); }
}
@-webkit-keyframes td {
0% { -webkit-transform: translateX(100%); }
100% { -webkit-transform: translateX(-100%); }
}
@keyframes td {
0% {
-moz-transform: translateX(100%); /* Firefox bug fix */
-webkit-transform: translateX(100%); /* Firefox bug fix */
transform: translateX(100%);
}
100% {
-moz-transform: translateX(-100%); /* Firefox bug fix */
-webkit-transform: translateX(-100%); /* Firefox bug fix */
transform: translateX(-100%);
}
}
639 changes: 434 additions & 205 deletions MMM-MBTA.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Option|Description
`updateInterval`|Time between updates, in seconds. To protect API abuse, this module automatically limits this value to a minimum of `10`.<br/>**Expected Value type:** `int`.
`baseUrl`|The base url of the MBTA api. You shouldn't change this unless the MBTA moved the api to the new location, and the update hasn't been reflected in this module.<br/>**Expected Value type:** `String`.
`stations`|This is an array of stations that you wish to display. Currently, only one max station is allowed. For a list of station names, please refer to `stations-formatted.json`. Make sure to use the common name!<br/>Example: `stations: [ "Airport" ]`.<br/>**Expected Value type:** `[String, String, ...]`.
`predictedTimes`|Use MBTA predicted times or scheduled times. Default is predicted times (true).<br/>**Expected Value type:** `boolean`.
`doAnimation`|Whether or not to do an animation when updating.<br/>**Expected Value type:** `boolean`.
`animationSpeed`|How long the update animation lasts. <br/>**Expected Value type:** `int`.
`formatETA`|Show ETA time in MM:SS instead of just seconds.<br/>**Expected Value type:** `boolean`.
Expand All @@ -58,11 +59,14 @@ Option|Description
`maxEntries`|The maximum entries allowed. Default is `8`.<br/>**Expected Value type:** `int`.
`maxTime`|The maximum ETA time the modules should list, in minutes. Default is to show all. <br/>**Expected Value type:** `int`.
`showArrivalTime`|Show MBTA's predicted arrival time of the transportation vehicle.<br/>**Expected Value type:** `boolean`.
`showDepartTime`|Show MBTA's predicted departure time of the transportation vehicle.<br/>**Expected Value type:** `boolean`.
`showETATime`|Show MBTA's predicted ETA for the vehicle.<br/>**Expected Value type:** `boolean`.
`fade`|Whether or not to fade the module.<br/>**Expected Value type:** `boolean`.
`fadePoint`|At what point to start fading. <br/>**Expected Value type:** `float`. Value range is from 0 to 1.
`showFullName`|Display the full name instead of the short name. Due to the length the text, it is strongly recommended that the postition of this module is set to `top_bar`, `bottom_bar`, or any location where it can expand to the entire width when this is set to `true`.<br/>**Expected Value type:** `boolean`.
`colorIcons`|Display the vehicle icons in their respective color.<br/>**Expected Value type:** `boolean`.
`showAlerts`|Shows alerts near the specified station.<br/>**Expected Value type:** `boolean`.<br/>**WARNING**: Alerts are only properly shown when in a full-width position, such as `top_bar`, `middle_center` or `lower_third`.
`hideEmptyAlerts`|Automatically hide the alerts section when there are no alerts.<br/>**Expected Value type:** `boolean`.

More options will be added as this module becomes feature-rich.

Expand Down
Loading