diff --git a/about.html b/about.html index 300c57f..15f69e2 100644 --- a/about.html +++ b/about.html @@ -6,12 +6,7 @@ content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> - - - - - - hvvstuhl.de | Was ist das? + Barrierefreie Aufzugs-Liste | Was ist das?

Barrierefreie Aufzugs-Liste

@@ -30,19 +25,18 @@
-
-

Worum geht's hier?

-

- Diese Seite ermöglicht einen barrierefreien Zugang zu den Aufzugs-Informationen im HVV. - Der HVV selbst zeigt diese Informationen nur auf einer (vor allem ohne Ortskenntnis) schwer zu navigierenden - Karte an: - HVV Webseite zu Aufzügen -

-

- Dieses Projekt wurde unter der AGPL-3 Lizenz entwickelt und ist hier zu finden: - git.kritzl.dev -

-
+
+

Worum geht's hier?

+

+ Diese Seite ermöglicht einen barrierefreien Zugang zu den Aufzugs informationen im HVV. + Der HVV selbst zeigt diese Informationen nur auf einer (vor allem ohne Ortskenntnis) schwer zu navigierenden Karte an: + HVV Webseite zu Aufzügen +

+

+ Dieses Projekt wurde unter AGPL-3 entwickelt und ist hier zu finden: + git.kritzl.dev +

+
\ No newline at end of file diff --git a/elevators.js b/elevators.js index 4908cfb..068a1b3 100644 --- a/elevators.js +++ b/elevators.js @@ -6,6 +6,11 @@ let geolocationPermission = false; let geolocation = null; const openStations = new Set(); let sortByDistance = false; +const version = '0.5.2' +const minorVersion = version.split('.').splice(0, 2).join('.'); +const numberFormat = new Intl.NumberFormat('de-DE', { + maximumFractionDigits: 1 +}); const substituteData = [ { @@ -82,6 +87,14 @@ const substituteData = [ }, ] + +Object.defineProperty(String.prototype, 'capitalize', { + value: function () { + return this.charAt(0).toUpperCase() + this.toLowerCase().slice(1); + }, + enumerable: false +}); + async function loadElevators() { document.querySelector('#errorMessage').classList.add('hidden'); const res = await fetch('https://www.hvv.de/elevators', { @@ -190,6 +203,12 @@ async function loadElevators() { })); } +const dateTimeStyle = new Intl.DateTimeFormat('de-DE', { + dateStyle: 'medium', + timeStyle: 'medium', + timeZone: 'Europe/Berlin', +}) + async function loadOsmData() { const nodeIdList = []; for (const station of internalData.stations) { @@ -232,8 +251,7 @@ async function loadOsmData() { if (!internalData.stations[stationIndex].hasOwnProperty('coordinates')) { const substitute = substituteData.filter(subs => subs.name === internalData.stations[stationIndex].name) - console.log(substitute) - if (substitute.length && substitute[0].hasOwnProperty('coordinates')) { + if (substitute.length && substitute.hasOwnProperty('coordinates')) { internalData.stations[stationIndex]['coordinates'] = substitute[0].coordinates; } } @@ -317,23 +335,9 @@ function sortStations(stationA, stationB) { return 0; } -function sortInt(valueA, valueB) { - const a = parseInt(valueA) - const b = parseInt(valueB) - if (a < b) { - return -1; - } - if (a > b) { - return 1; - } - - // names must be equal - return 0; -} - function sortStationsByDistance(stationA, stationB) { - const distanceA = stationA.distance ?? 0; // ignore upper and lowercase - const distanceB = stationB.distance ?? 0; // ignore upper and lowercase + const distanceA = stationA.distance; // ignore upper and lowercase + const distanceB = stationB.distance; // ignore upper and lowercase if (distanceA < distanceB) { return -1; } @@ -430,9 +434,7 @@ function renderData(location = null) { } } - if (sortByDistance) { - stations = stations.sort(sortStationsByDistance); - } + stations = stations.sort(sortStationsByDistance); for (const stationIndex in stations) { const station = stations[stationIndex]; @@ -495,7 +497,7 @@ function renderData(location = null) { osmTemplate += `
Beschreibung
${node.tags['description']}
`; } if (node.tags.hasOwnProperty('level')) { - osmTemplate += `
Ebenen
${node.tags['level'].split(';').sort(sortInt).join(', ')}
`; + osmTemplate += `
Ebenen
${node.tags['level'].split(';').sort().join(', ')}
`; } if (node.tags.hasOwnProperty('wheelchair')) { osmTemplate += `
Rollstühle
${node.tags['wheelchair'] === 'yes' ? 'Ja' : 'Nein'}
`; @@ -568,11 +570,7 @@ function renderData(location = null) {
${station.types.sort().map(t => `${t}`).join('')}
- ${sortByDistance - ? typeof station.distance !== 'undefined' - ? `
${Math.round(station.distance / 100) / 10}
km
` - : '
? km
' - : ''} + ${typeof station.distance !== 'undefined' ? `
${Math.round(station.distance / 100) / 10}
km
` : ''}

${station.name}

@@ -667,13 +665,12 @@ document.querySelector('#stationsNearMe') if (geolocationPermission !== 'granted') { allowGeolocation(); } else { - sortByDistance = e.target.ariaPressed = true; - // If geolocation is already set. // If not the location watcher will re-render our data. if (geolocation !== null) { renderData(geolocation) } + sortByDistance = e.target.ariaPressed = true; } } } else { @@ -729,6 +726,21 @@ document.querySelectorAll('button.typeChip').forEach(e => { }) }) +function openDialog(selector) { + document.querySelector('body').classList.add('has-dialog') + document.querySelector('#dialog_layer').classList.add('active') + document.querySelector(selector).classList.remove('hidden') +} + +function closeDialog(selector) { + document.querySelector('body').classList.remove('has-dialog') + document.querySelector('#dialog_layer').classList.remove('active') + document.querySelector(selector).classList.add('hidden') +} + +// set version +document.querySelector('#version').innerHTML = `v${version}`; + // data api version check const check_internal = JSON.parse(localStorage.getItem("internal_data")); const check_osm = JSON.parse(localStorage.getItem("osm_data")); diff --git a/icons/192.png b/icons/192.png deleted file mode 100644 index a329713..0000000 Binary files a/icons/192.png and /dev/null differ diff --git a/icons/512-maskable.png b/icons/512-maskable.png deleted file mode 100644 index 6122f35..0000000 Binary files a/icons/512-maskable.png and /dev/null differ diff --git a/icons/512-transparent.png b/icons/512-transparent.png deleted file mode 100644 index c6eed8c..0000000 Binary files a/icons/512-transparent.png and /dev/null differ diff --git a/icons/512.png b/icons/512.png deleted file mode 100644 index 79acdc4..0000000 Binary files a/icons/512.png and /dev/null differ diff --git a/icons/favicon-maskable.svg b/icons/favicon-maskable.svg deleted file mode 100644 index cb8cda2..0000000 --- a/icons/favicon-maskable.svg +++ /dev/null @@ -1,58 +0,0 @@ - - - - diff --git a/icons/favicon-transparent.svg b/icons/favicon-transparent.svg deleted file mode 100644 index dcea345..0000000 --- a/icons/favicon-transparent.svg +++ /dev/null @@ -1,55 +0,0 @@ - - - - diff --git a/icons/favicon.ico b/icons/favicon.ico deleted file mode 100644 index 29e9f5e..0000000 Binary files a/icons/favicon.ico and /dev/null differ diff --git a/icons/favicon.svg b/icons/favicon.svg deleted file mode 100644 index 4222b18..0000000 --- a/icons/favicon.svg +++ /dev/null @@ -1,58 +0,0 @@ - - - - diff --git a/icons/favicon_source.svg b/icons/favicon_source.svg deleted file mode 100644 index 028ef75..0000000 --- a/icons/favicon_source.svg +++ /dev/null @@ -1,85 +0,0 @@ - - - - diff --git a/images/screenshot-desktop.png b/images/screenshot-desktop.png deleted file mode 100644 index 4856c04..0000000 Binary files a/images/screenshot-desktop.png and /dev/null differ diff --git a/images/screenshot-mobile.png b/images/screenshot-mobile.png deleted file mode 100644 index 2856686..0000000 Binary files a/images/screenshot-mobile.png and /dev/null differ diff --git a/index.html b/index.html index 2099374..4af499c 100644 --- a/index.html +++ b/index.html @@ -6,12 +6,7 @@ content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> - - - - - - hvvstuhl.de + Barrierefreie Aufzugs-Liste

Barrierefreie Aufzugs-Liste

@@ -37,14 +32,15 @@ +
+