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

Style Improvements #9

Merged
merged 13 commits into from
Dec 5, 2016
Binary file added .github/preview-Berlin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/preview-London.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/preview-NewYork.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 68 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

This module display the next local transport connection between an origin and destination.

![Sonos Module](https://github.com/CFenner/MagicMirror-LocalTransport-Module/blob/master/.github/preview.png)
![preview](https://github.com/GHLasse/MagicMirror-LocalTransport-Module/blob/master/.github/preview-Berlin.png)

## Installation

Expand Down Expand Up @@ -40,9 +40,74 @@ Add module configuration to config.js.
|`apiKey`|The API key, which can be obtained [here](https://developers.google.com/maps/documentation/directions/).<br><br>This value is **REQUIRED**|
|`origin`|The start location.<br><br>**Example:** `Mannheim HBF`<br>This value is **REQUIRED**|
|`destination`|The target location.<br><br>**Example:** `Frankfurt HBF`<br>This value is **REQUIRED**|
|`maxConnections`|How many connections should be displayed?<br><br>**Default value:** `3`|
|`updateInterval`|How often does the content needs to be fetched? (Minutes)<br><br>**Default value:** `5`|
|`maximumEntries`|Maximum number of routes to display. Less routes will be shown if less are returned by Google. Routes will be sorted by arrival time. This option should take an integer value between `1` and `5`.<br><br>**Default value:** `3`|
|`updateInterval`|How often does the content need to be fetched? (Minutes) Note that the module refreshes every 15 seconds to always display an accurate estimate when you need to leave.<br><br>**Default value:** `5`|
|`animationSpeed`|Speed of the update animation. (Seconds)<br><br>**Default value:** `1`|
|`displayStationLength`|Number of characters of the departure station for each transport mode to display. <br>`0` means display all, <br>`-1` means don't show the departure station<br><br>**Default value:** `0`|
|`displayArrival`|Boolean if the arrival time should be shown in the header for each option.<br><br>**Default value:** `true`|
|`displayWalkType`|String how detailed the walking segments should be shown. <br> `'none'` means to not display anything,<br> `'short'` means to display the symbol, the time and the short version of the unit or <br> `'long'` means that a symbol, the time and the long string for the unit is displayed. This options is default if an invalid string is supplied.<br><br>**Default value:** `'short'`|
|`maxWalkTime`|Maximum time you are willing to walk between stations in minutes<br><br>**Default value:** `10`|
|`maxModuleWidth`|Maximum width of the module in pixel. Unlimited when set to `0`. This option can be used to make the module shorter in case of very long lines for directions. <br><br>**Default value:** `0`|
|`fade`|Boolean if a fade should be applied - same as for calendar module<br><br>**Default value:** `true`|
|`fadePoint`|Percentage, where the fade should start. This should be a value between 0 and 1 - same as for calendar module<br><br>**Default value:** `0.1`|
|`language`|Language to display information in - german `de` or english `en`<br><br>**Default value** `is same as defined in the main config file`|
|`units`|Units to use - `metric` or `imperial`<br><br>**Default value** `is same as defined in the main config file`|
|`timeFormat`|`24` or `12` hour clock for displaying the arrival time<br><br>**Default value** `is same as defined in the main config file`|

## Preview of various settings

```
{
module: 'localtransport',
header: 'to Victoriy Coach Station',
position: 'top_left',
config: {
api_key: 'MYG00GLEAP1KEY',
origin: 'Waterloo Station, London, United Kingdom',
destination: 'Victoria Coach Station, London, United Kingdom',
maximumEntries: 4,
maxWalkTime: 15,
displayWalkType: 'full',
maxModuleWidth: 400
}
},
```
![London - left long block](https://github.com/GHLasse/MagicMirror-LocalTransport-Module/blob/master/.github/preview-London.png)
```
{
module: 'localtransport',
header: 'nach Berlin',
position: 'top_right',
config: {
api_key: 'MYG00GLEAP1KEY',
origin: 'Bahnhof Hamburg Altona, Hamburg, Germany',
destination: 'Berlin Hauptbahnhof, Berlin, Germany',
maximumEntries: 6,
maxWalkTime: 15,
displayStationLength: -1,
displayWalkType: 'none',
displayArrival: false,
language: 'de'
}
},
```
![Berlin - right short](https://github.com/GHLasse/MagicMirror-LocalTransport-Module/blob/master/.github/preview-Berlin.png)
```
{
module: 'localtransport',
header: 'to Museum of Art',
position: 'top_left',
config: {
api_key: 'MYG00GLEAP1KEY',
origin: 'MetLife Stadium, 1 MetLife Stadium Drive, East Rutherford, NJ 07073, US',
destination: '1000 5th Ave, New York, NY 10028, US',
maximumEntries: 3,
maxWalkTime: 30,
displayStationLength: 10
}
},
```
![New York - left](https://github.com/GHLasse/MagicMirror-LocalTransport-Module/blob/master/.github/preview-NewYork.png)

## Special Thanks

Expand Down
10 changes: 9 additions & 1 deletion i18n/de.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
{
"LOADING_CONNECTIONS": "Lade Verbindungen ..."
"LOADING_CONNECTIONS": "Lade Verbindungen ...",
"ARRIVAL": "Ankunft",
"MINUTE_PL": "Minuten",
"MINUTE_SL": "Minute",
"SECOND_PL": "Sekunden",
"MINUTE_PS": "min",
"MINUTE_SS": "min",
"SECOND_PS": "sek",
"FROM": "von"
}
11 changes: 11 additions & 0 deletions i18n/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"LOADING_CONNECTIONS": "Loading ...",
"ARRIVAL": "arriving",
"MINUTE_PL": "minutes",
"MINUTE_SL": "minute",
"SECOND_PL": "seconds",
"MINUTE_PS": "min",
"MINUTE_SS": "min",
"SECOND_PS": "sec",
"FROM": "from"
}
4 changes: 4 additions & 0 deletions localtransport.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
}
.localtransport ul li img {
margin: 0 .25em 0 .5em;
max-height: 15px;
max-width: 15px;
height: 15px;
width: 15px;
}
.localtransport ul li div {
margin-left: .5em;
Expand Down
Loading