add support for video instance wallpapers

This commit is contained in:
Leafy :3 2025-01-27 08:15:07 +01:00
parent 5315dd54c1
commit 19a32e3d73
Signed by: Leafus
GPG key ID: 06B907155B66AAE3
6 changed files with 32 additions and 8 deletions

View file

@ -76,11 +76,24 @@ export default {
? null
: this.$store.state.instance.background
},
background () { return this.pageBackground || (this.$store.getters.mergedConfig.overrideInstanceWallpaper && this.userBackground) || this.instanceBackground },
background () {
return this.pageBackground ||
(this.$store.getters.mergedConfig.overrideInstanceWallpaper && this.userBackground) ||
this.instanceBackground
},
bgStyle () {
if (this.background) {
const background = this.background
if (!background) return null
const isVideo = /\.(mp4|webm|mov)$/i.test(background)
if (isVideo) {
return {
'--body-background-image': `url(${this.background})`
'--body-background-image': 'none'
}
} else {
return {
'--body-background-image': `url(${background})`
}
}
},

View file

@ -6,7 +6,18 @@
<div
id="app_bg_wrapper"
class="app-bg-wrapper"
/>
>
<video
v-if="background && /\.(mp4|webm|ogg)$/i.test(background)"
class="bg-video"
autoplay
loop
muted
playsinline
>
<source :src="background" type="video/mp4">
</video>
</div>
<MobileNav v-if="layoutType === 'mobile'" />
<DesktopNav v-else />
<Notifications v-if="currentUser" />

View file

@ -1,7 +1,7 @@
<template>
<div class="column-inner">
<terms-of-service-panel />
<staff-panel />
<terms-of-service-panel />
<LocalBubblePanel v-if="showLocalBubblePanel" />
<MRFTransparencyPanel />
<features-panel v-if="currentUser && showFeaturesPanel" />

View file

@ -1,6 +1,6 @@
{
"alwaysShowSubjectInput": true,
"background": "/static/tropic_island_night.jpg.webp",
"background": "https://media.puppyspace.org/puppy/uploads/33af6203-2978-4d7b-9a76-bbe9ccf80fc8.mp4",
"collapseMessageWithSubject": false,
"greentext": false,
"hideFilteredStatuses": false,