Browse Source

change sound

modals-to-spa
stingl 4 years ago
parent
commit
2d65a4dfd0
  1. BIN
      assets/audio/alert.mp3
  2. 18
      js/app.js

BIN
assets/audio/alert.mp3

Binary file not shown.

18
js/app.js

@ -18,7 +18,11 @@ const TimeTrack = {
portals: null, portals: null,
importStringForPortals: '', importStringForPortals: '',
publicDB: false, publicDB: false,
fun: false fun: false,
sounds: [
// 'psycho.mp3',
'alert.mp3'
],
} }
}, },
mounted() { mounted() {
@ -108,7 +112,7 @@ const TimeTrack = {
let noNoTickets = ['#1920', '#3110', '#2492', '#2419', '#1256']; let noNoTickets = ['#1920', '#3110', '#2492', '#2419', '#1256'];
if (this.fun && noNoTickets.includes(ticket.number)) { if (this.fun && noNoTickets.includes(ticket.number)) {
let psycho = new Audio('/timetrack/assets/audio/psycho.mp3'); let psycho = new Audio('/timetrack/assets/audio/' + oneOf(this.sounds));
psycho.play(); psycho.play();
} }
@ -320,7 +324,11 @@ const TimeTrack = {
}, 50) }, 50)
}, },
getPortalLink (test = false) { getPortalLink (test = false) {
return 'https://' + this.portal.replace('_', '-').replace('_test', '') + (test ? '-test' : '') + '.vemap.com'; let finalPortalName = this.portal.replace('_', '-');
finalPortalName.replace('-test', '');
finalPortalName += test ? '-test' : '';
return 'https://' + finalPortalName + '.vemap.com';
}, },
collectDataForDay() { collectDataForDay() {
let collection = []; let collection = [];
@ -397,4 +405,8 @@ const TimeTrack = {
} }
}; };
function oneOf(collection) {
return collection[Math.floor(Math.random()*collection.length)];
}
Vue.createApp(TimeTrack).mount('#root'); Vue.createApp(TimeTrack).mount('#root');