mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-18 22:33:50 +02:00
VR overlay progress bar
This commit is contained in:
@@ -13,8 +13,6 @@ Vue.component('marquee-text', MarqueeText);
|
||||
|
||||
import configRepository from './repository/config.js';
|
||||
|
||||
speechSynthesis.getVoices();
|
||||
|
||||
(async function () {
|
||||
var $app = null;
|
||||
|
||||
@@ -293,6 +291,16 @@ speechSynthesis.getVoices();
|
||||
|
||||
$app.methods.nowPlayingUpdate = function (json) {
|
||||
this.nowPlaying = JSON.parse(json);
|
||||
if (this.appType === '2') {
|
||||
var circle = document.querySelector(".np-progress-circle-stroke");
|
||||
if (this.config.progressPie && this.nowPlaying.percentage !== 0) {
|
||||
circle.style.opacity = 0.5;
|
||||
var circumference = circle.getTotalLength();
|
||||
circle.style.strokeDashoffset = circumference - (this.nowPlaying.percentage / 100) * circumference;
|
||||
} else {
|
||||
circle.style.opacity = 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$app.methods.lastLocationUpdate = function (json) {
|
||||
@@ -480,15 +488,6 @@ speechSynthesis.getVoices();
|
||||
return text;
|
||||
};
|
||||
|
||||
$app.methods.speak = function (text) {
|
||||
var tts = new SpeechSynthesisUtterance();
|
||||
var voices = speechSynthesis.getVoices();
|
||||
var voiceIndex = this.config.notificationTTSVoice;
|
||||
tts.voice = voices[voiceIndex];
|
||||
tts.text = text;
|
||||
speechSynthesis.speak(tts);
|
||||
};
|
||||
|
||||
$app = new Vue($app);
|
||||
window.$app = $app;
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user