Browse Source

add gitignore; add sound for switching

modals-to-spa
stingl 4 years ago
parent
commit
7e0fdc94c0
  1. 1
      .gitignore
  2. BIN
      assets/audio/whoosh.mp3
  3. 19
      js/app.js

1
.gitignore vendored

@ -0,0 +1 @@ @@ -0,0 +1 @@
/temp

BIN
assets/audio/whoosh.mp3

Binary file not shown.

19
js/app.js

@ -20,8 +20,8 @@ const TimeTrack = { @@ -20,8 +20,8 @@ const TimeTrack = {
publicDB: false,
fun: false,
sounds: [
// 'psycho.mp3',
'alert.mp3'
// 'psycho',
'alert'
],
}
},
@ -112,8 +112,7 @@ const TimeTrack = { @@ -112,8 +112,7 @@ const TimeTrack = {
let noNoTickets = ['#1920', '#3110', '#2492', '#2419', '#1256'];
if (this.fun && noNoTickets.includes(ticket.number)) {
let psycho = new Audio('/timetrack/assets/audio/' + oneOf(this.sounds));
psycho.play();
playSound(oneOf(this.sounds))
}
this.$forceUpdate();
@ -321,11 +320,11 @@ const TimeTrack = { @@ -321,11 +320,11 @@ const TimeTrack = {
setTimeout(() => {
let historyModal = new bootstrap.Modal(document.getElementById('historyModal'));
historyModal.toggle();
}, 50)
}, 50);
},
getPortalLink (test = false) {
let finalPortalName = this.portal.replace('_', '-');
finalPortalName.replace('-test', '');
let finalPortalName = this.portal.replaceAll('_', '-');
finalPortalName.replaceAll('-test', '');
finalPortalName += test ? '-test' : '';
return 'https://' + finalPortalName + '.vemap.com';
@ -356,6 +355,7 @@ const TimeTrack = { @@ -356,6 +355,7 @@ const TimeTrack = {
message: 'Portal-Wechsel erfolgreich',
color: 'green'
});
playSound('whoosh');
vue.updateStorage();
})
},
@ -409,4 +409,9 @@ function oneOf(collection) { @@ -409,4 +409,9 @@ function oneOf(collection) {
return collection[Math.floor(Math.random()*collection.length)];
}
function playSound(sound, extension = null) {
let audio = new Audio('/timetrack/assets/audio/' + sound + (extension ?? '.mp3'));
audio.play();
}
Vue.createApp(TimeTrack).mount('#root');