restore opacity if the video is playing.

This commit is contained in:
arabcoders 2025-03-25 02:03:44 +03:00
parent 55b3c34e68
commit fad709b42b
2 changed files with 20 additions and 0 deletions

View file

@ -275,6 +275,9 @@ const video_item = ref(null)
const playVideo = item => video_item.value = item
const closeVideo = () => video_item.value = null
const bg_enable = useStorage('random_bg', true)
const bg_opacity = useStorage('random_bg_opacity', 0.85)
watch(masterSelectAll, (value) => {
for (const key in stateStore.history) {
const element = stateStore.history[key]
@ -493,4 +496,11 @@ const reQueueItem = item => {
}
const pImg = e => e.target.naturalHeight > e.target.naturalWidth ? e.target.classList.add('image-portrait') : null
watch(video_item, v => {
if (!bg_enable.value) {
return
}
document.querySelector('body').setAttribute("style", `opacity: ${ v ? 1 : bg_opacity.value}`)
})
</script>

View file

@ -167,6 +167,9 @@ const showQueue = useStorage('showQueue', true)
const hideThumbnail = useStorage('hideThumbnailQueue', false)
const embed_url = ref('')
const bg_enable = useStorage('random_bg', true)
const bg_opacity = useStorage('random_bg_opacity', 0.85)
watch(masterSelectAll, (value) => {
for (const key in stateStore.queue) {
const element = stateStore.queue[key];
@ -337,4 +340,11 @@ const cancelItems = item => {
}
const pImg = e => e.target.naturalHeight > e.target.naturalWidth ? e.target.classList.add('image-portrait') : null
watch(embed_url, v => {
if (!bg_enable.value) {
return
}
document.querySelector('body').setAttribute("style", `opacity: ${ v ? 1 : bg_opacity.value}`)
})
</script>