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

Barrierefreie Aufzugs-Liste

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

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 -

-
+
+

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 +

+
\ No newline at end of file diff --git a/elevators.js b/elevators.js index 068a1b3..4908cfb 100644 --- a/elevators.js +++ b/elevators.js @@ -6,11 +6,6 @@ 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 = [ { @@ -87,14 +82,6 @@ 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', { @@ -203,12 +190,6 @@ 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) { @@ -251,7 +232,8 @@ async function loadOsmData() { if (!internalData.stations[stationIndex].hasOwnProperty('coordinates')) { const substitute = substituteData.filter(subs => subs.name === internalData.stations[stationIndex].name) - if (substitute.length && substitute.hasOwnProperty('coordinates')) { + console.log(substitute) + if (substitute.length && substitute[0].hasOwnProperty('coordinates')) { internalData.stations[stationIndex]['coordinates'] = substitute[0].coordinates; } } @@ -335,9 +317,23 @@ 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; // ignore upper and lowercase - const distanceB = stationB.distance; // ignore upper and lowercase + const distanceA = stationA.distance ?? 0; // ignore upper and lowercase + const distanceB = stationB.distance ?? 0; // ignore upper and lowercase if (distanceA < distanceB) { return -1; } @@ -434,7 +430,9 @@ function renderData(location = null) { } } - stations = stations.sort(sortStationsByDistance); + if (sortByDistance) { + stations = stations.sort(sortStationsByDistance); + } for (const stationIndex in stations) { const station = stations[stationIndex]; @@ -497,7 +495,7 @@ function renderData(location = null) { osmTemplate += `
Beschreibung
${node.tags['description']}
`; } if (node.tags.hasOwnProperty('level')) { - osmTemplate += `
Ebenen
${node.tags['level'].split(';').sort().join(', ')}
`; + osmTemplate += `
Ebenen
${node.tags['level'].split(';').sort(sortInt).join(', ')}
`; } if (node.tags.hasOwnProperty('wheelchair')) { osmTemplate += `
Rollstühle
${node.tags['wheelchair'] === 'yes' ? 'Ja' : 'Nein'}
`; @@ -570,7 +568,11 @@ function renderData(location = null) {
${station.types.sort().map(t => `${t}`).join('')}
- ${typeof station.distance !== 'undefined' ? `
${Math.round(station.distance / 100) / 10}
km
` : ''} + ${sortByDistance + ? typeof station.distance !== 'undefined' + ? `
${Math.round(station.distance / 100) / 10}
km
` + : '
? km
' + : ''}

${station.name}

@@ -665,12 +667,13 @@ 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 { @@ -726,21 +729,6 @@ 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 new file mode 100644 index 0000000..a329713 Binary files /dev/null and b/icons/192.png differ diff --git a/icons/512-maskable.png b/icons/512-maskable.png new file mode 100644 index 0000000..6122f35 Binary files /dev/null and b/icons/512-maskable.png differ diff --git a/icons/512-transparent.png b/icons/512-transparent.png new file mode 100644 index 0000000..c6eed8c Binary files /dev/null and b/icons/512-transparent.png differ diff --git a/icons/512.png b/icons/512.png new file mode 100644 index 0000000..79acdc4 Binary files /dev/null and b/icons/512.png differ diff --git a/icons/favicon-maskable.svg b/icons/favicon-maskable.svg new file mode 100644 index 0000000..cb8cda2 --- /dev/null +++ b/icons/favicon-maskable.svg @@ -0,0 +1,58 @@ + + + + diff --git a/icons/favicon-transparent.svg b/icons/favicon-transparent.svg new file mode 100644 index 0000000..dcea345 --- /dev/null +++ b/icons/favicon-transparent.svg @@ -0,0 +1,55 @@ + + + + diff --git a/icons/favicon.ico b/icons/favicon.ico new file mode 100644 index 0000000..29e9f5e Binary files /dev/null and b/icons/favicon.ico differ diff --git a/icons/favicon.svg b/icons/favicon.svg new file mode 100644 index 0000000..4222b18 --- /dev/null +++ b/icons/favicon.svg @@ -0,0 +1,58 @@ + + + + diff --git a/icons/favicon_source.svg b/icons/favicon_source.svg new file mode 100644 index 0000000..028ef75 --- /dev/null +++ b/icons/favicon_source.svg @@ -0,0 +1,85 @@ + + + + diff --git a/images/screenshot-desktop.png b/images/screenshot-desktop.png new file mode 100644 index 0000000..4856c04 Binary files /dev/null and b/images/screenshot-desktop.png differ diff --git a/images/screenshot-mobile.png b/images/screenshot-mobile.png new file mode 100644 index 0000000..2856686 Binary files /dev/null and b/images/screenshot-mobile.png differ diff --git a/index.html b/index.html index 4af499c..2099374 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,12 @@ content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> - Barrierefreie Aufzugs-Liste + + + + + + hvvstuhl.de

Barrierefreie Aufzugs-Liste

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