1
0
Fork
You've already forked kvv
0
Transitous-powered departure board
  • JavaScript 64.4%
  • CSS 21.5%
  • HTML 14.1%
Linus Benjamin Warnatz 7b346373cd allow localizing the clock and departure times
I did not get Hackatime minutes from Textastic, and will not ship this
anyway.
2026年04月22日 10:56:43 +02:00
assets allow localizing the clock and departure times 2026年04月22日 10:56:43 +02:00
.gitignore Get the lines from my new, special API. 2026年01月10日 18:10:47 +01:00
autocomplete.js added i18n and converted scripts to modules 2026年03月17日 17:03:08 +01:00
deno.jsonc Improve line shapes and fix handling of unknown lines 2026年01月11日 13:43:20 +01:00
deno.lock added i18n and converted scripts to modules 2026年03月17日 17:03:08 +01:00
i18n.js allow localizing the clock and departure times 2026年04月22日 10:56:43 +02:00
index.html allow localizing the clock and departure times 2026年04月22日 10:56:43 +02:00
motis-api.js added i18n and converted scripts to modules 2026年03月17日 17:03:08 +01:00
populateTable.js allow localizing the clock and departure times 2026年04月22日 10:56:43 +02:00
README.md update readme 2026年02月07日 17:25:04 +01:00
test.js Remove carriage list and add tests for line colors. 2026年01月11日 14:09:33 +01:00

libewa/kvv

A departure screen made to look like the departure boards in the Stadtbahntunnel in Karlsruhe.

Why?

A new justification could be: "Because THEY won't give it to us". A new tender demands the new departure boards have a public web view, but that it should not replace them, or even be able to.

The true story is, that I wanted a project to implement Transitous. And since, through multiple system errors, it has been apparent that the departure boards run Windows 10 (hopefully LTSC) and (削除) Google Chrome (削除ここまで) Microsoft Edge, I thought: Why not? Why shouldn't I implement a departure board in HTML, CSS and JavaScript?

Architecture overview

  • index.html: The UI is implemented with HTML table and template

  • assets/css/: All styling files are located here.

    • style.css: The main stylesheet, containing the overall layout and styling of the departure board.
    • autocomplete.css: The stylesheet for the autocomplete dropdown.
    • line-icon.css: Styles icons according to the line data from Träwelling ([line-colors-api])
      Note that circle and pill are the same.
  • motis-api.js: Contains two functions: getDepartures(stopId, n) and getAutocomplete(input). Both return a promise resolving to an array of the corresponding Transitous API types. This could reeeally benefit from some TypeScript.

  • populateTable.js: This could be considered the main AJAX script. It uses (削除) a timer (削除ここまで) an interval to update the clock and the departures once every minute. For this, it contains the important function insertRow(line, dest, departure, isRealTime). This function expects:

    1. A Träwelling line row. This object is currently constructed inside of update() as a JSON literal
    2. A string containing the expected transport's headsign (e.g. "Wolfartsweier über Hbf")
    3. A Date instance to the expected departure, real-time if available
    4. A boolean whether the departure time is real-time (true) or as scheduled (false). In the real-world source, relative time is only used in the last 10 minutes and only using real-time data.

    insertRow does not return anything, but immediately inserts the row into the body of the #departures table.

    update(), as mentioned, constructs the line object and also clears the table before calling both insertRow and updateClock. It is directly registered as the interval callback.

  • autocomplete.js: This handles entry into the search field, adding autocompletion and handling the selection of an autocomplete entry.