forked from mirrors/amputoma-fe
add support for video instance wallpapers
This commit is contained in:
parent
5315dd54c1
commit
19a32e3d73
6 changed files with 32 additions and 8 deletions
19
src/App.js
19
src/App.js
|
@ -76,11 +76,24 @@ export default {
|
||||||
? null
|
? null
|
||||||
: this.$store.state.instance.background
|
: 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 () {
|
bgStyle () {
|
||||||
if (this.background) {
|
const background = this.background
|
||||||
|
if (!background) return null
|
||||||
|
|
||||||
|
const isVideo = /\.(mp4|webm|mov)$/i.test(background)
|
||||||
|
|
||||||
|
if (isVideo) {
|
||||||
return {
|
return {
|
||||||
'--body-background-image': `url(${this.background})`
|
'--body-background-image': 'none'
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
'--body-background-image': `url(${background})`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
13
src/App.vue
13
src/App.vue
|
@ -6,7 +6,18 @@
|
||||||
<div
|
<div
|
||||||
id="app_bg_wrapper"
|
id="app_bg_wrapper"
|
||||||
class="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'" />
|
<MobileNav v-if="layoutType === 'mobile'" />
|
||||||
<DesktopNav v-else />
|
<DesktopNav v-else />
|
||||||
<Notifications v-if="currentUser" />
|
<Notifications v-if="currentUser" />
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="column-inner">
|
<div class="column-inner">
|
||||||
<terms-of-service-panel />
|
|
||||||
<staff-panel />
|
<staff-panel />
|
||||||
|
<terms-of-service-panel />
|
||||||
<LocalBubblePanel v-if="showLocalBubblePanel" />
|
<LocalBubblePanel v-if="showLocalBubblePanel" />
|
||||||
<MRFTransparencyPanel />
|
<MRFTransparencyPanel />
|
||||||
<features-panel v-if="currentUser && showFeaturesPanel" />
|
<features-panel v-if="currentUser && showFeaturesPanel" />
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"alwaysShowSubjectInput": true,
|
"alwaysShowSubjectInput": true,
|
||||||
"background": "/static/tropic_island_night.jpg.webp",
|
"background": "https://media.puppyspace.org/puppy/uploads/33af6203-2978-4d7b-9a76-bbe9ccf80fc8.mp4",
|
||||||
"collapseMessageWithSubject": false,
|
"collapseMessageWithSubject": false,
|
||||||
"greentext": false,
|
"greentext": false,
|
||||||
"hideFilteredStatuses": false,
|
"hideFilteredStatuses": false,
|
||||||
|
|
Loading…
Reference in a new issue