Overlay notification opacity

This commit is contained in:
Natsumi
2025-06-20 18:39:40 +12:00
parent 84913a0ef6
commit 921070da71
7 changed files with 186 additions and 16 deletions

View File

@@ -166,7 +166,8 @@ Vue.component('marquee-text', MarqueeText);
onlineForTimer: '',
wristFeed: [],
devices: [],
deviceCount: 0
deviceCount: 0,
notificationOpacity: 100
},
computed: {},
methods: {
@@ -203,6 +204,10 @@ Vue.component('marquee-text', MarqueeText);
this.cpuUsageEnabled || this.pcUptimeEnabled
);
}
if (this.config.notificationOpacity !== this.notificationOpacity) {
this.notificationOpacity = this.config.notificationOpacity;
this.setNotyOpacity(this.notificationOpacity);
}
};
$app.methods.updateOnlineFriendCount = function (count) {
@@ -272,6 +277,19 @@ Vue.component('marquee-text', MarqueeText);
});
};
$app.methods.setNotyOpacity = function (value) {
var opacity = parseFloat(value / 100).toFixed(2);
let element = document.getElementById('noty-opacity');
if (!element) {
document.body.insertAdjacentHTML(
'beforeend',
`<style id="noty-opacity">.noty_layout { opacity: ${opacity}; }</style>`
);
element = document.getElementById('noty-opacity');
}
element.innerHTML = `.noty_layout { opacity: ${opacity}; }`;
};
$app.methods.updateStatsLoop = async function () {
try {
this.currentTime = new Date()