aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/App.js17
-rw-r--r--src/App.scss4
-rw-r--r--src/App.vue3
-rw-r--r--src/components/desktop_nav/desktop_nav.scss4
-rw-r--r--src/components/settings_modal/tabs/general_tab.js4
-rw-r--r--src/components/settings_modal/tabs/general_tab.vue5
-rw-r--r--src/components/settings_modal/tabs/theme_tab/theme_tab.scss3
-rw-r--r--src/components/settings_modal/tabs/theme_tab/theme_tab.vue9
-rw-r--r--src/i18n/en.json2
-rw-r--r--src/modules/config.js1
-rw-r--r--src/services/theme_data/pleromafe.js4
11 files changed, 45 insertions, 11 deletions
diff --git a/src/App.js b/src/App.js
index 52700319..c79184ab 100644
--- a/src/App.js
+++ b/src/App.js
@@ -54,13 +54,16 @@ export default {
return this.currentUser.background_image || this.$store.state.instance.background
},
bgStyle () {
- return {
- 'background-image': `url(${this.background})`
- }
- },
- bgAppStyle () {
- return {
- '--body-background-image': `url(${this.background})`
+ if (
+ this.currentUser.background_image ||
+ (
+ this.$store.state.instance.background &&
+ !this.$store.getters.mergedConfig.hideInstanceWallpaper
+ )
+ ) {
+ return {
+ '--body-background-image': `url(${this.background})`
+ }
}
},
chat () { return this.$store.state.chat.channel.state === 'joined' },
diff --git a/src/App.scss b/src/App.scss
index 48313f57..2a1d7b1b 100644
--- a/src/App.scss
+++ b/src/App.scss
@@ -14,7 +14,9 @@
right: -20px;
background-size: cover;
background-repeat: no-repeat;
- background-position: 0 50%;
+ background-color: var(--wallpaper);
+ background-image: var(--body-background-image);
+ background-position: 50% 50px;
}
i[class^='icon-'] {
diff --git a/src/App.vue b/src/App.vue
index b4eb0524..1a166778 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,12 +1,11 @@
<template>
<div
id="app"
- :style="bgAppStyle"
+ :style="bgStyle"
>
<div
id="app_bg_wrapper"
class="app-bg-wrapper"
- :style="bgStyle"
/>
<MobileNav v-if="isMobileLayout" />
<DesktopNav v-else />
diff --git a/src/components/desktop_nav/desktop_nav.scss b/src/components/desktop_nav/desktop_nav.scss
index 8fd8e620..2d468588 100644
--- a/src/components/desktop_nav/desktop_nav.scss
+++ b/src/components/desktop_nav/desktop_nav.scss
@@ -5,6 +5,10 @@
width: 100%;
position: fixed;
+ a {
+ color: var(--topBarLink, $fallback--link);
+ }
+
.inner-nav {
display: grid;
grid-template-rows: 50px;
diff --git a/src/components/settings_modal/tabs/general_tab.js b/src/components/settings_modal/tabs/general_tab.js
index df592a10..029ee7a1 100644
--- a/src/components/settings_modal/tabs/general_tab.js
+++ b/src/components/settings_modal/tabs/general_tab.js
@@ -34,6 +34,10 @@ const GeneralTab = {
return this.$store.state.instance.postFormats || []
},
instanceSpecificPanelPresent () { return this.$store.state.instance.showInstanceSpecificPanel },
+ instanceWallpaperUsed () {
+ return this.$store.state.instance.background &&
+ !this.$store.state.users.currentUser.background_image
+ },
...SharedComputedObject()
}
}
diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue
index c1d0d0ec..a9081793 100644
--- a/src/components/settings_modal/tabs/general_tab.vue
+++ b/src/components/settings_modal/tabs/general_tab.vue
@@ -11,6 +11,11 @@
{{ $t('settings.hide_isp') }}
</Checkbox>
</li>
+ <li v-if="instanceWallpaperUsed">
+ <Checkbox v-model="hideInstanceWallpaper">
+ {{ $t('settings.hide_wallpaper') }}
+ </Checkbox>
+ </li>
</ul>
</div>
<div class="setting-item">
diff --git a/src/components/settings_modal/tabs/theme_tab/theme_tab.scss b/src/components/settings_modal/tabs/theme_tab/theme_tab.scss
index 926eceff..1b7d9f31 100644
--- a/src/components/settings_modal/tabs/theme_tab/theme_tab.scss
+++ b/src/components/settings_modal/tabs/theme_tab/theme_tab.scss
@@ -165,7 +165,8 @@
border-color: var(--border, $fallback--border);
margin: 1em 0;
padding: 1em;
- background: var(--body-background-image);
+ background-color: var(--wallpaper);
+ background-image: var(--body-background-image);
background-size: cover;
background-position: 50% 50%;
diff --git a/src/components/settings_modal/tabs/theme_tab/theme_tab.vue b/src/components/settings_modal/tabs/theme_tab/theme_tab.vue
index 4ab793d6..b8add42f 100644
--- a/src/components/settings_modal/tabs/theme_tab/theme_tab.vue
+++ b/src/components/settings_modal/tabs/theme_tab/theme_tab.vue
@@ -617,6 +617,15 @@
/>
</div>
<div class="color-item">
+ <h4>{{ $t('settings.style.advanced_colors.wallpaper') }}</h4>
+ <ColorInput
+ v-model="wallpaperColorLocal"
+ name="wallpaper"
+ :label="$t('settings.style.advanced_colors.wallpaper')"
+ :fallback="previewTheme.colors.wallpaper"
+ />
+ </div>
+ <div class="color-item">
<h4>{{ $t('settings.style.advanced_colors.poll') }}</h4>
<ColorInput
v-model="pollColorLocal"
diff --git a/src/i18n/en.json b/src/i18n/en.json
index c42126fc..815c0f2a 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -329,6 +329,7 @@
"hide_muted_posts": "Hide posts of muted users",
"max_thumbnails": "Maximum amount of thumbnails per post",
"hide_isp": "Hide instance-specific panel",
+ "hide_wallpaper": "Hide instance wallpaper",
"preload_images": "Preload images",
"use_one_click_nsfw": "Open NSFW attachments with just one click",
"hide_post_stats": "Hide post statistics (e.g. the number of favorites)",
@@ -516,6 +517,7 @@
"inputs": "Input fields",
"faint_text": "Faded text",
"underlay": "Underlay",
+ "wallpaper": "Wallpaper",
"poll": "Poll graph",
"icons": "Icons",
"highlight": "Highlighted elements",
diff --git a/src/modules/config.js b/src/modules/config.js
index 444b8ec7..cd088737 100644
--- a/src/modules/config.js
+++ b/src/modules/config.js
@@ -20,6 +20,7 @@ export const defaultState = {
customTheme: undefined,
customThemeSource: undefined,
hideISP: false,
+ hideInstanceWallpaper: false,
// bad name: actually hides posts of muted USERS
hideMutedPosts: undefined, // instance default
collapseMessageWithSubject: undefined, // instance default
diff --git a/src/services/theme_data/pleromafe.js b/src/services/theme_data/pleromafe.js
index 7ed85797..bec1eebd 100644
--- a/src/services/theme_data/pleromafe.js
+++ b/src/services/theme_data/pleromafe.js
@@ -84,6 +84,10 @@ export const SLOT_INHERITANCE = {
opacity: 'bg',
priority: 1
},
+ wallpaper: {
+ depends: ['bg'],
+ color: (mod, bg) => brightness(-2 * mod, bg).rgb
+ },
fg: {
depends: [],
priority: 1