Compare commits
2 Commits
0be71f3a24
...
57205dd2cf
| Author | SHA1 | Date | |
|---|---|---|---|
| 57205dd2cf | |||
| 9b930cc694 |
@ -1,15 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<search/>
|
<img alt="Vue logo" src="./assets/logo.png">
|
||||||
|
<routing/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import search from './components/search.vue'
|
import routing from './components/routing.vue'
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'App',
|
name: 'App',
|
||||||
components: {
|
components: {
|
||||||
search
|
routing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,32 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
||||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
||||||
viewBox="0 0 220.4 200" style="enable-background:new 0 0 220.4 200;" xml:space="preserve">
|
|
||||||
<style type="text/css">
|
|
||||||
.st0{fill:none;}
|
|
||||||
.st1{fill:#FFFFFF;}
|
|
||||||
.st2{fill:#F0D722;}
|
|
||||||
.st3{fill:#252424;}
|
|
||||||
</style>
|
|
||||||
<g id="BoundingBox">
|
|
||||||
<rect x="-31.5" y="-29" class="st0" width="283.5" height="258"/>
|
|
||||||
</g>
|
|
||||||
<g id="Logo">
|
|
||||||
<g>
|
|
||||||
<path class="st1" d="M110.2,27.8C124.3,13,136.8,0,158.4,0c33.5,0,59.5,26.5,61.8,59.2c1.4,20.3-4.9,36.9-19.8,52.1
|
|
||||||
c-24.9,25.3-69.5,70.5-84.6,85.8c-0.7,0.7-3.1,2.9-5.5,2.9c-2.5,0-4.9-2.2-5.5-2.9c-15.1-15.3-59.8-60.6-84.6-85.8
|
|
||||||
C5.1,96.1-1.2,79.5,0.2,59.2C2.5,26.5,28.5,0,62,0C83.6,0,96,13,110.2,27.8z"/>
|
|
||||||
<path class="st2" d="M110.2,27.8C124.3,13,136.8,0,158.4,0c33.5,0,59.5,26.5,61.8,59.2c1.4,20.3-4.9,36.9-19.8,52.1
|
|
||||||
c-24.9,25.3-69.5,70.5-84.6,85.8c-0.7,0.7-3.1,2.9-5.5,2.9c-2.5,0-4.9-2.2-5.5-2.9c-15.1-15.3-59.8-60.6-84.6-85.8
|
|
||||||
C5.1,96.1-1.2,79.5,0.2,59.2C2.5,26.5,28.5,0,62,0C83.6,0,96,13,110.2,27.8z"/>
|
|
||||||
<path class="st3" d="M73.9,110.3h-9.1c-2.3,0-4-0.8-4-3.4V63.6c0-2.1,1.7-3.8,4-3.8h9.9c11.9,0,13.7,6.1,13.7,12.7
|
|
||||||
c0,5.3-1.7,10-8.3,11.4c7.2,0.4,9.7,6.1,9.7,11.2C89.7,103.1,86.8,110.3,73.9,110.3z M73.2,66.7h-2.8v14.2h2.3
|
|
||||||
c6.4,0,6.6-4,6.6-7.2C79.3,68.6,78.5,66.7,73.2,66.7z M73,87.5h-2.7v15.9h3.4c5.5,0,6.1-3.8,6.1-8C79.8,90.9,79.3,87.5,73,87.5z
|
|
||||||
M117.2,104.6c-0.9,4.2-3.2,6.3-7,6.3c-4.4,0-6.3-2.1-7.2-5.9l-9.3-38.5c-0.9-3.8,0.8-7,4.4-7c2.3,0,4.3,1.1,4.9,4.4l6.1,28.4
|
|
||||||
c0.6,2.7,1,5.9,1.1,8c0.2-2.1,0.7-5.3,1.1-8l5.5-28.4c0.6-2.8,2.3-4.4,4.7-4.4c3,0,5.2,2.5,4.4,6.4L117.2,104.6z M148.1,110.8
|
|
||||||
c-15,0-18.4-8.3-18.4-25.6c0-18.2,7.6-26,19.3-26c2.5,0,8.2,0.6,11,2.8c0.6,0.6,1.3,1.5,1.3,3c0,2.3-1.9,4-4,4
|
|
||||||
c-2.1,0-4.2-1.5-8.5-1.5c-5.7,0-9.5,3.4-9.5,18.4c0,14,3.2,17.2,9.9,17.2c1.7,0,2.7-0.2,3.2-0.4V88.3h-2.8c-2.5,0-4-1.3-4-3.6
|
|
||||||
c0-2.5,1.3-3.8,4-3.8h8.3c2.8,0,3.8,1.3,3.8,4.4v15C161.7,107.6,157.4,110.8,148.1,110.8z"/>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.1 KiB |
@ -1,20 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div class="search">
|
||||||
|
<input type="text" v-model="from.name">
|
||||||
|
<button @click="searchStationFrom()">search</button>
|
||||||
|
<br/>
|
||||||
|
<input type="text" v-model="to.name">
|
||||||
|
<button @click="searchStationTo()">search</button>
|
||||||
|
<br/>
|
||||||
|
<button @click="searchConnection()">find connection</button>
|
||||||
|
</div>
|
||||||
<div class="results">
|
<div class="results">
|
||||||
<li class="journey" v-for="connection in this.connections" :key="connections.indexOf(connection)">
|
<li class="journey" v-for="connection in this.connections" :key="connections.indexOf(connection)">
|
||||||
<h2>{{ toTime(connection.legs[0].departure) }} - {{ toTime(connection.legs[connection.legs.length -1].arrival) }}</h2>
|
<h2>{{ toTime(connection.legs[0].departure) }} - {{ toTime(connection.legs[connection.legs.length -1].arrival) }}</h2>
|
||||||
<div class="leg" v-for="leg in connection.legs" :key="connection.legs.indexOf(leg)" :class="leg.walking ? 'walking' : null" :style="{backgroundColor:getTimeColor(leg.arrival), background:getGradient(leg.departure, leg.arrival)}" >
|
<div class="leg" v-for="leg in connection.legs" :key="connection.legs.indexOf(leg)" :class="leg.walking ? 'walking' : null" :style="{backgroundColor:getTimeColor(leg.arrival), background:getGradient(leg.departure, leg.arrival)}" >
|
||||||
<div class="linename" >
|
<div class="station" >{{ leg.origin.name }}<br/>{{ toTime(leg.departure) }}<br/> Gleis {{ leg.departurePlatform }}</div>
|
||||||
<div class="linenameinner" :style="{backgroundColor:getLineColors(leg.line)[1], color:getLineColors(leg.line)[0]}">{{ leg.line?.name }}</div>
|
|
||||||
<div class="linenameinner" :style="{backgroundColor:getLineColors(leg.line)[1], color:getLineColors(leg.line)[0]}">{{ leg.direction }}</div>
|
|
||||||
</div>
|
|
||||||
<div class="lineinfo">
|
|
||||||
<div class="station" v-if="leg.departurePlatform">{{ leg.origin.name }}<br/>{{ toTime(leg.departure) }}<br/> Gleis {{ leg.departurePlatform }}</div>
|
|
||||||
<div class="line">
|
<div class="line">
|
||||||
|
{{ leg.line?.product }}<br/>
|
||||||
|
<div class="linename" :style="{backgroundColor:getLineColors(leg.line)[1], color:getLineColors(leg.line)[0]}">{{ leg.line?.name }}</div>
|
||||||
<p class="operator" v-if="!getOperatorLogo(leg.line?.operator)">{{ leg.line?.operator?.name }}</p>
|
<p class="operator" v-if="!getOperatorLogo(leg.line?.operator)">{{ leg.line?.operator?.name }}</p>
|
||||||
<img class="operator-logo" :src="getOperatorLogo(leg.line?.operator)" v-if="getOperatorLogo(leg.line?.operator)">
|
<img class="operator-logo" :src="getOperatorLogo(leg.line?.operator)" v-if="getOperatorLogo(leg.line?.operator)">
|
||||||
</div>
|
</div>
|
||||||
<div class="station" v-if="leg.arrivalPlatform">{{ leg.destination.name }}<br/>{{ toTime(leg.arrival) }}<br/> Gleis {{ leg.arrivalPlatform }}</div>
|
<div class="station" >{{ leg.destination.name }}<br/>{{ toTime(leg.arrival) }}<br/> Gleis {{ leg.arrivalPlatform }}</div>
|
||||||
</div>
|
|
||||||
<hr/>
|
<hr/>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
@ -22,42 +27,281 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import timefunctions from '@/lib/time.js'
|
import axios from 'axios';
|
||||||
import routefunctions from '@/lib/routes.js'
|
|
||||||
import operatorfunctions from '@/lib/operators.js'
|
|
||||||
|
|
||||||
|
const client = axios.create({
|
||||||
|
baseURL: process.env.VUE_APP_BASE_URL
|
||||||
|
});
|
||||||
|
const timecolors = [
|
||||||
|
{r:147, g:147, b:147, h:0},
|
||||||
|
{r:156, g:151, b:146, h:1},
|
||||||
|
{r:166, g:155, b:145, h:2},
|
||||||
|
{r:175, g:163, b:149, h:3},
|
||||||
|
{r:201, g:177, b:153, h:4},
|
||||||
|
{r:235, g:212, b:165, h:5},
|
||||||
|
{r:249, g:230, b:176, h:6},
|
||||||
|
{r:250, g:249, b:196, h:7},
|
||||||
|
{r:248, g:255, b:208, h:8},
|
||||||
|
{r:237, g:255, b:226, h:9},
|
||||||
|
{r:239, g:255, b:242, h:10},
|
||||||
|
{r:231, g:255, b:251, h:11},
|
||||||
|
{r:220, g:249, b:255, h:12},
|
||||||
|
{r:220, g:236, b:255, h:13},
|
||||||
|
{r:224, g:219, b:254, h:14},
|
||||||
|
{r:243, g:209, b:254, h:15},
|
||||||
|
{r:247, g:190, b:236, h:16},
|
||||||
|
{r:243, g:175, b:203, h:17},
|
||||||
|
{r:234, g:163, b:183, h:18},
|
||||||
|
{r:226, g:163, b:190, h:19},
|
||||||
|
{r:206, g:160, b:200, h:20},
|
||||||
|
{r:178, g:153, b:190, h:21},
|
||||||
|
{r:159, g:152, b:178, h:22},
|
||||||
|
{r:146, g:146, b:167, h:23}]
|
||||||
export default {
|
export default {
|
||||||
name: 'RoutingBahn',
|
name: 'HelloWorld',
|
||||||
props: {
|
props: {
|
||||||
connections: Array
|
msg: String
|
||||||
},
|
|
||||||
components: {
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
from: {name:"", id:null},
|
from: {name:"", id:null},
|
||||||
to: {name:"", id:null},
|
to: {name:"", id:null},
|
||||||
|
connections: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
searchStationFrom() {
|
||||||
|
console.log(process.env.VUE_APP_BASE_URL)
|
||||||
|
client.get("/searchStation", {params: {text: this.from.name}}).then(res => this.from = {name: res.data.name, id: res.data.id});
|
||||||
|
},
|
||||||
|
searchStationTo() {
|
||||||
|
client.get("/searchStation", {params: {text: this.to.name}}).then(res => this.to = {name: res.data.name, id: res.data.id});
|
||||||
|
},
|
||||||
|
searchConnection() {
|
||||||
|
if (this.from.id && this.to.id){
|
||||||
|
client.get("/searchConnection", {params: {from: this.from.id, to:this.to.id}}).then(res => {this.connections = res.data;console.log(this.connections)});
|
||||||
|
}
|
||||||
|
},
|
||||||
toDate(string){
|
toDate(string){
|
||||||
return new Date(string).toLocaleDateString("de-DE");
|
return new Date(string).toLocaleDateString("de-DE");
|
||||||
},
|
},
|
||||||
toTime(string){
|
toTime(string){
|
||||||
return new Date(string).toLocaleTimeString("de-DE", {timeStyle: 'short'});
|
return new Date(string).toLocaleTimeString("de-DE", {timeStyle: 'short'});
|
||||||
},
|
},
|
||||||
getGradient(time1, time2){
|
|
||||||
return "linear-gradient(0deg,"+timefunctions.getTimeColor(time2)+","+timefunctions.getTimeColor(time1)+")";
|
|
||||||
},
|
|
||||||
getTimeColor(string){
|
getTimeColor(string){
|
||||||
timefunctions.getTimeColor(string)
|
let date = new Date(string);
|
||||||
|
let color1;
|
||||||
|
let color2;
|
||||||
|
let minutes;
|
||||||
|
|
||||||
|
let i = 0;
|
||||||
|
color1 = timecolors[i];
|
||||||
|
color2 = timecolors[i+1];
|
||||||
|
while (color1.h < date.getHours() && i+1 < timecolors.length){
|
||||||
|
i++;
|
||||||
|
color1 = timecolors[i];
|
||||||
|
if (i+2 < timecolors.length) {
|
||||||
|
color2 = timecolors[i+1];
|
||||||
|
} else {
|
||||||
|
color2 = timecolors[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
minutes = (date.getHours()-color1.h) * 60 + date.getMinutes();
|
||||||
|
let maxMinutes = color2.h == 0 ? (24 - color1.h)*60 : (color2.h - color1.h)*60
|
||||||
|
let r = (color2.r * minutes + color1.r * (maxMinutes-minutes))/maxMinutes;
|
||||||
|
let g = (color2.g * minutes + color1.g * (maxMinutes-minutes))/maxMinutes;
|
||||||
|
let b = (color2.r * minutes + color1.b * (maxMinutes-minutes))/maxMinutes;
|
||||||
|
let color = "rgb("+r+","+g+","+b+")"
|
||||||
|
return color;
|
||||||
|
},
|
||||||
|
getGradient(time1, time2){
|
||||||
|
return "linear-gradient(0deg,"+this.getTimeColor(time2)+","+this.getTimeColor(time1)+")";
|
||||||
},
|
},
|
||||||
getLineColors(line){
|
getLineColors(line){
|
||||||
return routefunctions.getLineColors(line)
|
if (!line){
|
||||||
},
|
return (['black', 'white']);
|
||||||
getOperatorLogo(line){
|
} else if (line.productName === "STB"){
|
||||||
return operatorfunctions.getOperatorLogo(line)
|
return (['white', 'blue']);
|
||||||
|
} else if (line.productName === "S"){
|
||||||
|
return (['white', 'green']);
|
||||||
|
} else if (line.productName === "RE" || line.productName === "RB"){
|
||||||
|
return (['white', 'red']);
|
||||||
|
} else if (line.productName === "IC" || line.productName === "ICE"){
|
||||||
|
return (['red', 'white']);
|
||||||
|
} else if (line.productName === "EC" || line.productName === "ECE"){
|
||||||
|
return (['blue', 'white']);
|
||||||
|
} else if (line.productName === "MEX"){
|
||||||
|
return (['black', 'yellow']);
|
||||||
|
} else {
|
||||||
|
return (['black', 'white']);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
getOperatorLogo(operator){
|
||||||
|
if (!operator){
|
||||||
|
return (null);
|
||||||
|
} else if (operator.id.startsWith("db-regio") || operator.id === "regionalverkehr-alb-bodensee"){
|
||||||
|
return new URL('../assets/logos/dbregio.svg', import.meta.url);
|
||||||
|
} else if (operator.id.startsWith("db-")){
|
||||||
|
return new URL('../assets/logos/db.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "national-express"){
|
||||||
|
return new URL('../assets/logos/nationalexpress.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "eurobahn"){
|
||||||
|
return new URL('../assets/logos/eurobahn.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "schweizerische-bundesbahnen" || operator.id === "sbb-gmbh"){
|
||||||
|
return new URL('../assets/logos/sbb.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "verkehrsbetriebe-zurich"){
|
||||||
|
return new URL('../assets/logos/vbz.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "thurbo"){
|
||||||
|
return new URL('../assets/logos/thurbo.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "arverio-baden-wurttemberg"){
|
||||||
|
return new URL('../assets/logos/avi-bw.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "arverio-bayern"){
|
||||||
|
return new URL('../assets/logos/avi-by.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "euskotren"){
|
||||||
|
return new URL('../assets/logos/euskotren.svg', import.meta.url);
|
||||||
|
} else if (operator.id.startsWith("arriva")){
|
||||||
|
return new URL('../assets/logos/arriva.svg', import.meta.url);
|
||||||
|
} else if (operator.id.startsWith("abellio")){
|
||||||
|
return new URL('../assets/logos/abellio.png', import.meta.url);
|
||||||
|
} else if (operator.id === "nederlandse-spoorwegen"){
|
||||||
|
return new URL('../assets/logos/ns.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "blauwnet"){
|
||||||
|
return new URL('../assets/logos/blauwnet.png', import.meta.url);
|
||||||
|
} else if (operator.id === "waldbahn-die-landerbahn-gmbh-dlb"){
|
||||||
|
return new URL('../assets/logos/waldbahn.png', import.meta.url);
|
||||||
|
} else if (operator.id === "ostdeutsche-eisenbahn-gmbh"){
|
||||||
|
return new URL('../assets/logos/odeg.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "trenitalia"){
|
||||||
|
return new URL('../assets/logos/trenitalia.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "osterreichische-bundesbahnen"){
|
||||||
|
return new URL('../assets/logos/oebb.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "sj"){
|
||||||
|
return new URL('../assets/logos/sj.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "vy"){
|
||||||
|
return new URL('../assets/logos/vy.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "danische-staatsbahnen"){
|
||||||
|
return new URL('../assets/logos/dsb.png', import.meta.url);
|
||||||
|
} else if (operator.id === "skanetrafiken-oresundstag"){
|
||||||
|
return new URL('../assets/logos/oresundtag.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "schweizerische-sudostbahn-sob"){
|
||||||
|
return new URL('../assets/logos/sob.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "sncf"){
|
||||||
|
return new URL('../assets/logos/sncf.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "mitteldeutsche-regiobahn"){
|
||||||
|
return new URL('../assets/logos/mrb.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "cp"){
|
||||||
|
return new URL('../assets/logos/cp-pt.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "renfe"){
|
||||||
|
return new URL('../assets/logos/renfe.svg', import.meta.url);
|
||||||
|
} else if (operator.id.startsWith("sncf-voyages")){
|
||||||
|
return new URL('../assets/logos/sncf-voyageurs.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "pkp-intercity"){
|
||||||
|
return new URL('../assets/logos/pkp-i.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "bayerische-regiobahn"){
|
||||||
|
return new URL('../assets/logos/brb.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "postauto-schweiz"){
|
||||||
|
return new URL('../assets/logos/postauto.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "lner-london-north-eastern-railway"){
|
||||||
|
return new URL('../assets/logos/lner.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "eurostar"){
|
||||||
|
return new URL('../assets/logos/eurostar.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "european-sleeper"){
|
||||||
|
return new URL('../assets/logos/europesleep.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "ceske-drahy"){
|
||||||
|
return new URL('../assets/logos/cd.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "mav"){
|
||||||
|
return new URL('../assets/logos/mav.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "serbische-eisenbahnen-zeleznice-srbije"){
|
||||||
|
return new URL('../assets/logos/zsrbije.png', import.meta.url);
|
||||||
|
} else if (operator.id === "sncb"){
|
||||||
|
return new URL('../assets/logos/sncb.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "cfl"){
|
||||||
|
return new URL('../assets/logos/cfl.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "s-bahn-berlin"){
|
||||||
|
return new URL('../assets/logos/sbahnberlin.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "rhatische-bahn"){
|
||||||
|
return new URL('../assets/logos/rhb.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "matterhorn-gotthard-bahn-bvz"){
|
||||||
|
return new URL('../assets/logos/mgb.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "s-bahn-hamburg"){
|
||||||
|
return new URL('../assets/logos/sbahnhamburg.png', import.meta.url);
|
||||||
|
} else if (operator.id === "akn-eisenbahn-gmbh"){
|
||||||
|
return new URL('../assets/logos/akn.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "wurttembergische-eisenbahn-gesellschaft-mbh"){
|
||||||
|
return new URL('../assets/logos/weg.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "wynental-und-suhrental-bahn" || operator.id === "bdwm-transport"){
|
||||||
|
return new URL('../assets/logos/ava.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "appenzeller-bahnen"){
|
||||||
|
return new URL('../assets/logos/ab.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "agilis"){
|
||||||
|
return new URL('../assets/logos/agilis.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "hzpp"){
|
||||||
|
return new URL('../assets/logos/hzpp.png', import.meta.url);
|
||||||
|
} else if (operator.id === "obb-postbus"){
|
||||||
|
return new URL('../assets/logos/oebb-postbus.png', import.meta.url);
|
||||||
|
} else if (operator.id === "snalltaget"){
|
||||||
|
return new URL('../assets/logos/snalltaget.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "schwabische-alb-bahn"){
|
||||||
|
return new URL('../assets/logos/sab.svg', import.meta.url);
|
||||||
|
} else if (operator.id.startsWith("sweg-bahn")){
|
||||||
|
return new URL('../assets/logos/sweg.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "ferrocarils-de-la-generalitat-de-catalunya"){
|
||||||
|
return new URL('../assets/logos/fgc.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "albtal-verkehrs-gesellschaft-mbh"){
|
||||||
|
return new URL('../assets/logos/avg.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "westfalenbahn"){
|
||||||
|
return new URL('../assets/logos/wfb.png', import.meta.url);
|
||||||
|
} else if (operator.id === "coras-iompair-eireann"){
|
||||||
|
return new URL('../assets/logos/cie.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "avanti-west-coast"){
|
||||||
|
return new URL('../assets/logos/avantiwc.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "koleje-dolnoslaskie"){
|
||||||
|
return new URL('../assets/logos/kolejed.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "trilex-express-die-landerbahn-gmbh-dlb"){
|
||||||
|
return new URL('../assets/logos/trilex.png', import.meta.url);
|
||||||
|
} else if (operator.id === "polregio"){
|
||||||
|
return new URL('../assets/logos/polregio.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "bayerische-zugspitzbahn"){
|
||||||
|
return new URL('../assets/logos/zugspitze.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "rigi-bahnen"){
|
||||||
|
return new URL('../assets/logos/rigi.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "regionalverkehr-bern-solothurn"){
|
||||||
|
return new URL('../assets/logos/rbs.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "zentralbahn"){
|
||||||
|
return new URL('../assets/logos/zb.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "bls-ag"){
|
||||||
|
return new URL('../assets/logos/bernmobil.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "westbahn"){
|
||||||
|
return new URL('../assets/logos/westbahn.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "northern"){
|
||||||
|
return new URL('../assets/logos/northern.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "south-eastern"){
|
||||||
|
return new URL('../assets/logos/southeastern.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "hull-trains"){
|
||||||
|
return new URL('../assets/logos/hulltrains.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "schweizerische-bodensee-schiffahrtsgesellschaft"){
|
||||||
|
return new URL('../assets/logos/bodenseech.png', import.meta.url);
|
||||||
|
} else if (operator.id === "bodensee-schiffsbetriebe"){
|
||||||
|
return new URL('../assets/logos/bsb.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "regiojet"){
|
||||||
|
return new URL('../assets/logos/regiojet.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "edzards-reisen"){
|
||||||
|
return new URL('../assets/logos/edzards.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "vlexx"){
|
||||||
|
return new URL('../assets/logos/vlexx.png', import.meta.url);
|
||||||
|
} else if (operator.id === "nordwestbahn"){
|
||||||
|
return new URL('../assets/logos/nordwestbahn.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "caledonian-macbrayne-ferries"){
|
||||||
|
return new URL('../assets/logos/caledonian-macbrayne.svg', import.meta.url);
|
||||||
|
} else if (operator.id === "caledonian-sleeper"){
|
||||||
|
return new URL('../assets/logos/caledonian-sleeper.png', import.meta.url);
|
||||||
|
} else if (operator.id === "mecklenburgische-baderbahn-molli"){
|
||||||
|
return new URL('../assets/logos/molli.svg', import.meta.url);
|
||||||
|
} else {
|
||||||
|
console.log(operator.id);
|
||||||
|
return (null);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -99,13 +343,8 @@
|
|||||||
width:100px;
|
width:100px;
|
||||||
font-family:"Raveo-display-bold";
|
font-family:"Raveo-display-bold";
|
||||||
align-content: center;
|
align-content: center;
|
||||||
display:inline-flex;
|
margin-top:10px;
|
||||||
width:max-content;
|
margin-bottom:10px
|
||||||
}
|
|
||||||
.linenameinner {
|
|
||||||
padding-left: 10px;
|
|
||||||
padding-right: 10px;
|
|
||||||
margin: 15px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.operator {
|
.operator {
|
||||||
|
|||||||
@ -1,270 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="search">
|
|
||||||
<v-select
|
|
||||||
v-model="selectedService"
|
|
||||||
prepend-icon="fa-regular fa-calendar"
|
|
||||||
:items="services"
|
|
||||||
item-title="name"
|
|
||||||
item-value="id"
|
|
||||||
density="compact"
|
|
||||||
label="Service"
|
|
||||||
class="inputTextField"
|
|
||||||
></v-select>
|
|
||||||
<v-text-field
|
|
||||||
v-model="date.value"
|
|
||||||
:active="date.menu"
|
|
||||||
label="date"
|
|
||||||
prepend-icon="fa-regular fa-calendar"
|
|
||||||
readonly
|
|
||||||
class="inputTextField"
|
|
||||||
>
|
|
||||||
<v-menu
|
|
||||||
v-model="date.menu"
|
|
||||||
:close-on-content-click="false"
|
|
||||||
activator="parent"
|
|
||||||
transition="scale-transition"
|
|
||||||
>
|
|
||||||
<v-date-picker
|
|
||||||
color="green-lighten-1"
|
|
||||||
format="24hr"
|
|
||||||
v-if="date.menu"
|
|
||||||
v-model="date.value"
|
|
||||||
full-width
|
|
||||||
></v-date-picker>
|
|
||||||
</v-menu>
|
|
||||||
</v-text-field>
|
|
||||||
<v-text-field
|
|
||||||
v-model="time.value"
|
|
||||||
:active="time.menu"
|
|
||||||
label="time"
|
|
||||||
prepend-icon="fa-regular fa-clock"
|
|
||||||
readonly
|
|
||||||
class="inputTextField"
|
|
||||||
>
|
|
||||||
<v-menu
|
|
||||||
v-model="time.menu"
|
|
||||||
:close-on-content-click="false"
|
|
||||||
activator="parent"
|
|
||||||
transition="scale-transition"
|
|
||||||
>
|
|
||||||
<v-time-picker
|
|
||||||
color="green-lighten-1"
|
|
||||||
format="24hr"
|
|
||||||
v-if="time.menu"
|
|
||||||
v-model="time.value"
|
|
||||||
full-width
|
|
||||||
></v-time-picker>
|
|
||||||
</v-menu>
|
|
||||||
</v-text-field>
|
|
||||||
<v-text-field
|
|
||||||
prepend-icon="fa-regular fa-circle-play"
|
|
||||||
:active="from.menu"
|
|
||||||
label="from"
|
|
||||||
type="text"
|
|
||||||
v-model="fromName"
|
|
||||||
class="inputTextField"
|
|
||||||
@change="loadChoicesFrom()"
|
|
||||||
>
|
|
||||||
<v-menu
|
|
||||||
v-model="from.menu"
|
|
||||||
:close-on-content-click="false"
|
|
||||||
activator="parent"
|
|
||||||
transition="scale-transition"
|
|
||||||
>
|
|
||||||
<div v-if="from.menu">
|
|
||||||
<div v-for="choice in from.choices" :key="from.choices.indexOf(choice)" @click="chooseFrom(choice)">
|
|
||||||
{{ choice.name }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</v-menu>
|
|
||||||
</v-text-field>
|
|
||||||
<v-text-field
|
|
||||||
prepend-icon="fa-solid fa-bullseye"
|
|
||||||
:active="to.menu"
|
|
||||||
label="to"
|
|
||||||
type="text"
|
|
||||||
v-model="toName"
|
|
||||||
class="inputTextField"
|
|
||||||
>
|
|
||||||
<v-menu
|
|
||||||
v-model="to.menu"
|
|
||||||
:close-on-content-click="false"
|
|
||||||
activator="parent"
|
|
||||||
transition="scale-transition"
|
|
||||||
>
|
|
||||||
<div v-if="to.menu">
|
|
||||||
<div v-for="choice in to.choices" :key="to.choices.indexOf(choice)" @click="chooseTo(choice)">
|
|
||||||
{{ choice.name }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</v-menu>
|
|
||||||
</v-text-field>
|
|
||||||
<v-btn @click="searchConnection()">find connection</v-btn>
|
|
||||||
</div>
|
|
||||||
<routing v-if="showRouting" :connections="connections"></routing>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import routing from './routing';
|
|
||||||
import axios from 'axios';
|
|
||||||
import { VTimePicker } from 'vuetify/labs/VTimePicker';
|
|
||||||
import { VDatePicker } from 'vuetify/components/VDatePicker';
|
|
||||||
|
|
||||||
const client = axios.create({
|
|
||||||
baseURL: process.env.VUE_APP_BASE_URL
|
|
||||||
});
|
|
||||||
const services = [
|
|
||||||
{id:"db", name:"Deutsche Bahn"},
|
|
||||||
{id:"vbb", name:"Verkehrsverbund Berlin-Brandenburg"},
|
|
||||||
{id:"pkp", name:"Polskie Koleje Państwowe"},
|
|
||||||
{id:"irish", name:"Iarnród Éireann"},
|
|
||||||
{id:"oebb", name:"Österreichische Bundesbahnen"},
|
|
||||||
{id:"lu", name:"Mobilitéitszentral (Luxembourg)"},
|
|
||||||
]
|
|
||||||
export default {
|
|
||||||
name: 'SearchBahn',
|
|
||||||
props: {
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
routing,
|
|
||||||
VTimePicker,
|
|
||||||
VDatePicker
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
from: {name:"", id:null, choices:[], menu:false, update:null},
|
|
||||||
to: {name:"", id:null, choices:[], menu:false, update:null},
|
|
||||||
fromName : "",
|
|
||||||
toName : "",
|
|
||||||
connections: [],
|
|
||||||
showRouting: false,
|
|
||||||
time: {value:new Date().toLocaleTimeString(), menu:false},
|
|
||||||
date: {value:new Date(), menu:false},
|
|
||||||
services: services,
|
|
||||||
selectedService: services[0].id,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
searchStationFrom() {
|
|
||||||
client.get("/searchStation", {params: {text: this.fromName, service:this.selectedService}}).then(res => this.from = {name: res.data.name, id: res.data.id});
|
|
||||||
},
|
|
||||||
searchStationTo() {
|
|
||||||
client.get("/searchStation", {params: {text: this.toName, service:this.selectedService}}).then(res => this.to = {name: res.data.name, id: res.data.id});
|
|
||||||
},
|
|
||||||
searchConnection() {
|
|
||||||
if (this.from.id && this.to.id){
|
|
||||||
client.get("/searchConnection", {params: {from: this.from.id, to:this.to.id, service:this.selectedService, date:this.getSelectedDate()}}).then(res => {this.connections = res.data;console.log(this.connections)});
|
|
||||||
this.showRouting = true;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getSelectedDate(){
|
|
||||||
let timeArray = this.time.value.split(":");
|
|
||||||
if (timeArray.length <= 1){
|
|
||||||
return new Date(this.date.value.getFullYear(), this.date.value.getMonth(), this.date.value.getDate())
|
|
||||||
}
|
|
||||||
console.log(this.date.value.getFullYear()+" "+this.date.value.getMonth()+" "+this.date.value.getDate()+" "+timeArray[0]+" "+timeArray[1])
|
|
||||||
console.log(new Date(this.date.value.getFullYear(), this.date.value.getMonth(), this.date.value.getDate(), timeArray[0], timeArray[1]))
|
|
||||||
return new Date(this.date.value.getFullYear(), this.date.value.getMonth(), this.date.value.getDate(), timeArray[0], timeArray[1])
|
|
||||||
},
|
|
||||||
timeLoadChoicesFrom(){
|
|
||||||
if (this.from.menu){
|
|
||||||
let time = Date.now()
|
|
||||||
this.from.update = time;
|
|
||||||
console.log("timeLoadChoicesFrom")
|
|
||||||
let timer = setInterval(() => {
|
|
||||||
if (time == this.from.update){
|
|
||||||
this.loadChoicesFrom();
|
|
||||||
} else {
|
|
||||||
console.log("nicht laden")
|
|
||||||
}
|
|
||||||
clearInterval(timer);
|
|
||||||
}, 500);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
timeLoadChoicesTo(){
|
|
||||||
if (this.to.menu){
|
|
||||||
let time = Date.now()
|
|
||||||
this.to.update = time;
|
|
||||||
console.log("timeLoadChoicesTo")
|
|
||||||
let timer = setInterval(() => {
|
|
||||||
if (time == this.to.update){
|
|
||||||
this.loadChoicesTo();
|
|
||||||
} else {
|
|
||||||
console.log("nicht laden")
|
|
||||||
}
|
|
||||||
clearInterval(timer);
|
|
||||||
}, 500);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
loadChoicesFrom(){
|
|
||||||
client.get("/searchStations", {params: {text: this.fromName, service: this.selectedService}}).then(res => this.from.choices = res.data);
|
|
||||||
},
|
|
||||||
loadChoicesTo(){
|
|
||||||
client.get("/searchStations", {params: {text: this.toName, service: this.selectedService}}).then(res => this.to.choices = res.data);
|
|
||||||
},
|
|
||||||
chooseFrom(choice){
|
|
||||||
this.fromName = choice.name;
|
|
||||||
this.from.id = choice.id;
|
|
||||||
this.from.menu = false;
|
|
||||||
},
|
|
||||||
chooseTo(choice){
|
|
||||||
this.toName = choice.name;
|
|
||||||
this.to.id = choice.id;
|
|
||||||
this.to.menu = false;
|
|
||||||
},
|
|
||||||
testAlert(){
|
|
||||||
alert("testAlert")
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
fromName: function() {
|
|
||||||
this.timeLoadChoicesFrom();
|
|
||||||
},
|
|
||||||
toName: function() {
|
|
||||||
this.timeLoadChoicesTo();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
|
||||||
<style scoped>
|
|
||||||
h3 {
|
|
||||||
margin: 40px 0 0;
|
|
||||||
}
|
|
||||||
ul {
|
|
||||||
list-style-type: none;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
li {
|
|
||||||
display: inline-block;
|
|
||||||
margin: 0 10px;
|
|
||||||
}
|
|
||||||
a {
|
|
||||||
color: #42b983;
|
|
||||||
}
|
|
||||||
.search {
|
|
||||||
display: inline-flex;
|
|
||||||
vertical-align:middle;
|
|
||||||
bottom: 0;
|
|
||||||
}
|
|
||||||
.search > * {
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
div {
|
|
||||||
font-family:"Raveo-display-medium";
|
|
||||||
}
|
|
||||||
.walking > div {
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
.inputTextField{
|
|
||||||
width: 300pt;
|
|
||||||
}
|
|
||||||
@font-face {
|
|
||||||
font-family: "Raveo-display-bold";
|
|
||||||
src: url("../assets/Raveo Display Bold.woff2") format("opentype");
|
|
||||||
}
|
|
||||||
@font-face {
|
|
||||||
font-family: "Raveo-display-medium";
|
|
||||||
src: url("../assets/Raveo Display Medium.woff2") format("opentype");
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,171 +0,0 @@
|
|||||||
let operatorfunctions = {
|
|
||||||
getOperatorLogo(operator){
|
|
||||||
if (!operator){
|
|
||||||
return (null);
|
|
||||||
} else if (operator.id.startsWith("db-regio") || operator.id === "regionalverkehr-alb-bodensee"){
|
|
||||||
return new URL('../assets/logos/dbregio.svg', import.meta.url);
|
|
||||||
} else if (operator.id.startsWith("db-")){
|
|
||||||
return new URL('../assets/logos/db.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "national-express"){
|
|
||||||
return new URL('../assets/logos/nationalexpress.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "eurobahn"){
|
|
||||||
return new URL('../assets/logos/eurobahn.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "schweizerische-bundesbahnen" || operator.id === "sbb-gmbh"){
|
|
||||||
return new URL('../assets/logos/sbb.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "verkehrsbetriebe-zurich"){
|
|
||||||
return new URL('../assets/logos/vbz.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "thurbo"){
|
|
||||||
return new URL('../assets/logos/thurbo.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "arverio-baden-wurttemberg"){
|
|
||||||
return new URL('../assets/logos/avi-bw.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "arverio-bayern"){
|
|
||||||
return new URL('../assets/logos/avi-by.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "euskotren"){
|
|
||||||
return new URL('../assets/logos/euskotren.svg', import.meta.url);
|
|
||||||
} else if (operator.id.startsWith("arriva")){
|
|
||||||
return new URL('../assets/logos/arriva.svg', import.meta.url);
|
|
||||||
} else if (operator.id.startsWith("abellio")){
|
|
||||||
return new URL('../assets/logos/abellio.png', import.meta.url);
|
|
||||||
} else if (operator.id === "nederlandse-spoorwegen"){
|
|
||||||
return new URL('../assets/logos/ns.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "blauwnet"){
|
|
||||||
return new URL('../assets/logos/blauwnet.png', import.meta.url);
|
|
||||||
} else if (operator.id === "waldbahn-die-landerbahn-gmbh-dlb"){
|
|
||||||
return new URL('../assets/logos/waldbahn.png', import.meta.url);
|
|
||||||
} else if (operator.id === "ostdeutsche-eisenbahn-gmbh"){
|
|
||||||
return new URL('../assets/logos/odeg.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "trenitalia"){
|
|
||||||
return new URL('../assets/logos/trenitalia.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "osterreichische-bundesbahnen"){
|
|
||||||
return new URL('../assets/logos/oebb.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "sj"){
|
|
||||||
return new URL('../assets/logos/sj.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "vy"){
|
|
||||||
return new URL('../assets/logos/vy.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "danische-staatsbahnen"){
|
|
||||||
return new URL('../assets/logos/dsb.png', import.meta.url);
|
|
||||||
} else if (operator.id === "skanetrafiken-oresundstag"){
|
|
||||||
return new URL('../assets/logos/oresundtag.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "schweizerische-sudostbahn-sob"){
|
|
||||||
return new URL('../assets/logos/sob.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "sncf"){
|
|
||||||
return new URL('../assets/logos/sncf.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "mitteldeutsche-regiobahn"){
|
|
||||||
return new URL('../assets/logos/mrb.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "cp"){
|
|
||||||
return new URL('../assets/logos/cp-pt.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "renfe"){
|
|
||||||
return new URL('../assets/logos/renfe.svg', import.meta.url);
|
|
||||||
} else if (operator.id.startsWith("sncf-voyages")){
|
|
||||||
return new URL('../assets/logos/sncf-voyageurs.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "pkp-intercity"){
|
|
||||||
return new URL('../assets/logos/pkp-i.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "bayerische-regiobahn"){
|
|
||||||
return new URL('../assets/logos/brb.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "postauto-schweiz"){
|
|
||||||
return new URL('../assets/logos/postauto.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "lner-london-north-eastern-railway"){
|
|
||||||
return new URL('../assets/logos/lner.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "eurostar"){
|
|
||||||
return new URL('../assets/logos/eurostar.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "european-sleeper"){
|
|
||||||
return new URL('../assets/logos/europesleep.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "ceske-drahy"){
|
|
||||||
return new URL('../assets/logos/cd.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "mav"){
|
|
||||||
return new URL('../assets/logos/mav.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "serbische-eisenbahnen-zeleznice-srbije"){
|
|
||||||
return new URL('../assets/logos/zsrbije.png', import.meta.url);
|
|
||||||
} else if (operator.id === "sncb"){
|
|
||||||
return new URL('../assets/logos/sncb.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "cfl"){
|
|
||||||
return new URL('../assets/logos/cfl.svg', import.meta.url);
|
|
||||||
} else if (operator.id.startsWith("s-bahn-berlin")){
|
|
||||||
return new URL('../assets/logos/sbahnberlin.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "rhatische-bahn"){
|
|
||||||
return new URL('../assets/logos/rhb.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "matterhorn-gotthard-bahn-bvz"){
|
|
||||||
return new URL('../assets/logos/mgb.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "s-bahn-hamburg"){
|
|
||||||
return new URL('../assets/logos/sbahnhamburg.png', import.meta.url);
|
|
||||||
} else if (operator.id === "akn-eisenbahn-gmbh"){
|
|
||||||
return new URL('../assets/logos/akn.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "wurttembergische-eisenbahn-gesellschaft-mbh"){
|
|
||||||
return new URL('../assets/logos/weg.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "wynental-und-suhrental-bahn" || operator.id === "bdwm-transport"){
|
|
||||||
return new URL('../assets/logos/ava.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "appenzeller-bahnen"){
|
|
||||||
return new URL('../assets/logos/ab.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "agilis"){
|
|
||||||
return new URL('../assets/logos/agilis.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "hzpp"){
|
|
||||||
return new URL('../assets/logos/hzpp.png', import.meta.url);
|
|
||||||
} else if (operator.id === "obb-postbus"){
|
|
||||||
return new URL('../assets/logos/oebb-postbus.png', import.meta.url);
|
|
||||||
} else if (operator.id === "snalltaget"){
|
|
||||||
return new URL('../assets/logos/snalltaget.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "schwabische-alb-bahn"){
|
|
||||||
return new URL('../assets/logos/sab.svg', import.meta.url);
|
|
||||||
} else if (operator.id.startsWith("sweg-bahn")){
|
|
||||||
return new URL('../assets/logos/sweg.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "ferrocarils-de-la-generalitat-de-catalunya"){
|
|
||||||
return new URL('../assets/logos/fgc.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "albtal-verkehrs-gesellschaft-mbh"){
|
|
||||||
return new URL('../assets/logos/avg.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "westfalenbahn"){
|
|
||||||
return new URL('../assets/logos/wfb.png', import.meta.url);
|
|
||||||
} else if (operator.id === "coras-iompair-eireann"){
|
|
||||||
return new URL('../assets/logos/cie.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "avanti-west-coast"){
|
|
||||||
return new URL('../assets/logos/avantiwc.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "koleje-dolnoslaskie"){
|
|
||||||
return new URL('../assets/logos/kolejed.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "trilex-express-die-landerbahn-gmbh-dlb"){
|
|
||||||
return new URL('../assets/logos/trilex.png', import.meta.url);
|
|
||||||
} else if (operator.id === "polregio"){
|
|
||||||
return new URL('../assets/logos/polregio.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "bayerische-zugspitzbahn"){
|
|
||||||
return new URL('../assets/logos/zugspitze.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "rigi-bahnen"){
|
|
||||||
return new URL('../assets/logos/rigi.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "regionalverkehr-bern-solothurn"){
|
|
||||||
return new URL('../assets/logos/rbs.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "zentralbahn"){
|
|
||||||
return new URL('../assets/logos/zb.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "bls-ag"){
|
|
||||||
return new URL('../assets/logos/bernmobil.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "westbahn"){
|
|
||||||
return new URL('../assets/logos/westbahn.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "northern"){
|
|
||||||
return new URL('../assets/logos/northern.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "south-eastern"){
|
|
||||||
return new URL('../assets/logos/southeastern.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "hull-trains"){
|
|
||||||
return new URL('../assets/logos/hulltrains.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "schweizerische-bodensee-schiffahrtsgesellschaft"){
|
|
||||||
return new URL('../assets/logos/bodenseech.png', import.meta.url);
|
|
||||||
} else if (operator.id === "bodensee-schiffsbetriebe"){
|
|
||||||
return new URL('../assets/logos/bsb.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "regiojet"){
|
|
||||||
return new URL('../assets/logos/regiojet.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "edzards-reisen"){
|
|
||||||
return new URL('../assets/logos/edzards.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "vlexx"){
|
|
||||||
return new URL('../assets/logos/vlexx.png', import.meta.url);
|
|
||||||
} else if (operator.id === "nordwestbahn"){
|
|
||||||
return new URL('../assets/logos/nordwestbahn.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "caledonian-macbrayne-ferries"){
|
|
||||||
return new URL('../assets/logos/caledonian-macbrayne.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "caledonian-sleeper"){
|
|
||||||
return new URL('../assets/logos/caledonian-sleeper.png', import.meta.url);
|
|
||||||
} else if (operator.id === "mecklenburgische-baderbahn-molli"){
|
|
||||||
return new URL('../assets/logos/molli.svg', import.meta.url);
|
|
||||||
} else if (operator.id === "berliner-verkehrsbetriebe"){
|
|
||||||
return new URL('../assets/logos/bvg_berlin.svg', import.meta.url);
|
|
||||||
} else {
|
|
||||||
console.log(operator.id);
|
|
||||||
return (null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
export default operatorfunctions;
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
let routefunctions = {
|
|
||||||
getLineColors(line){
|
|
||||||
if (!line){
|
|
||||||
return (['black', 'white']);
|
|
||||||
} else if (line.productName === "STB"){
|
|
||||||
return (['white', 'blue']);
|
|
||||||
} else if (line.productName === "S"){
|
|
||||||
return (['white', 'green']);
|
|
||||||
} else if (line.productName === "RE" || line.productName === "RB"){
|
|
||||||
return (['white', 'red']);
|
|
||||||
} else if (line.productName === "IC" || line.productName === "ICE"){
|
|
||||||
return (['red', 'white']);
|
|
||||||
} else if (line.productName === "EC" || line.productName === "ECE"){
|
|
||||||
return (['blue', 'white']);
|
|
||||||
} else if (line.productName === "MEX"){
|
|
||||||
return (['black', 'yellow']);
|
|
||||||
} else {
|
|
||||||
return (['black', 'white']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
export default routefunctions;
|
|
||||||
@ -1,55 +0,0 @@
|
|||||||
const timecolors = [
|
|
||||||
{r:147, g:147, b:147, h:0},
|
|
||||||
{r:156, g:151, b:146, h:1},
|
|
||||||
{r:166, g:155, b:145, h:2},
|
|
||||||
{r:175, g:163, b:149, h:3},
|
|
||||||
{r:201, g:177, b:153, h:4},
|
|
||||||
{r:235, g:212, b:165, h:5},
|
|
||||||
{r:249, g:230, b:176, h:6},
|
|
||||||
{r:250, g:249, b:196, h:7},
|
|
||||||
{r:248, g:255, b:208, h:8},
|
|
||||||
{r:237, g:255, b:226, h:9},
|
|
||||||
{r:239, g:255, b:242, h:10},
|
|
||||||
{r:231, g:255, b:251, h:11},
|
|
||||||
{r:220, g:249, b:255, h:12},
|
|
||||||
{r:220, g:236, b:255, h:13},
|
|
||||||
{r:224, g:219, b:254, h:14},
|
|
||||||
{r:243, g:209, b:254, h:15},
|
|
||||||
{r:247, g:190, b:236, h:16},
|
|
||||||
{r:243, g:175, b:203, h:17},
|
|
||||||
{r:234, g:163, b:183, h:18},
|
|
||||||
{r:226, g:163, b:190, h:19},
|
|
||||||
{r:206, g:160, b:200, h:20},
|
|
||||||
{r:178, g:153, b:190, h:21},
|
|
||||||
{r:159, g:152, b:178, h:22},
|
|
||||||
{r:146, g:146, b:167, h:23}]
|
|
||||||
|
|
||||||
let timefunctions = {
|
|
||||||
getTimeColor(string){
|
|
||||||
let date = new Date(string);
|
|
||||||
let color1;
|
|
||||||
let color2;
|
|
||||||
let minutes;
|
|
||||||
|
|
||||||
let i = 0;
|
|
||||||
color1 = timecolors[i];
|
|
||||||
color2 = timecolors[i+1];
|
|
||||||
while (color1.h < date.getHours() && i+1 < timecolors.length){
|
|
||||||
i++;
|
|
||||||
color1 = timecolors[i];
|
|
||||||
if (i+2 < timecolors.length) {
|
|
||||||
color2 = timecolors[i+1];
|
|
||||||
} else {
|
|
||||||
color2 = timecolors[0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
minutes = (date.getHours()-color1.h) * 60 + date.getMinutes();
|
|
||||||
let maxMinutes = color2.h == 0 ? (24 - color1.h)*60 : (color2.h - color1.h)*60
|
|
||||||
let r = (color2.r * minutes + color1.r * (maxMinutes-minutes))/maxMinutes;
|
|
||||||
let g = (color2.g * minutes + color1.g * (maxMinutes-minutes))/maxMinutes;
|
|
||||||
let b = (color2.r * minutes + color1.b * (maxMinutes-minutes))/maxMinutes;
|
|
||||||
let color = "rgb("+r+","+g+","+b+")"
|
|
||||||
return color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
export default timefunctions;
|
|
||||||
@ -1,35 +1,4 @@
|
|||||||
import { createApp } from 'vue'
|
import { createApp } from 'vue'
|
||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
|
|
||||||
|
createApp(App).mount('#app')
|
||||||
// Vuetify
|
|
||||||
import 'vuetify/styles'
|
|
||||||
import { createVuetify } from 'vuetify'
|
|
||||||
import * as components from 'vuetify/components'
|
|
||||||
import * as directives from 'vuetify/directives'
|
|
||||||
//import '@fortawesome/fontawesome-free/css/all.css' // Ensure your project is capable of handling css files
|
|
||||||
//import { aliases, fa } from 'vuetify/iconsets/fa-svg'
|
|
||||||
//import { library } from '@fortawesome/fontawesome-svg-core'
|
|
||||||
//import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
|
|
||||||
//import { fas } from '@fortawesome/free-solid-svg-icons'
|
|
||||||
//import { far } from '@fortawesome/free-regular-svg-icons'
|
|
||||||
|
|
||||||
const app = createApp(App)
|
|
||||||
|
|
||||||
//app.component('font-awesome-icon', FontAwesomeIcon) // Register component globally
|
|
||||||
//library.add(fas) // Include needed solid icons
|
|
||||||
//library.add(far) // Include needed regular icons
|
|
||||||
|
|
||||||
const vuetify = createVuetify({
|
|
||||||
components,
|
|
||||||
directives,
|
|
||||||
// icons: {
|
|
||||||
// defaultSet: 'fa',
|
|
||||||
// aliases,
|
|
||||||
// sets: {
|
|
||||||
// fa,
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
})
|
|
||||||
|
|
||||||
app.use(vuetify).mount('#app')
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user