aboutsummaryrefslogtreecommitdiff
path: root/src/App.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2018-08-31 04:06:00 +0300
committerHenry Jameson <me@hjkos.com>2018-08-31 04:06:00 +0300
commite99534ef717881d71a6fa975bb5e81fad6399b15 (patch)
tree1517ecbcde639a624d749791f704e4bd55e098e9 /src/App.js
parent63fdad8703bc640b8a3698490a536fb68b6d089c (diff)
added option for logo in navbar to follow color scheme of the rest of the site
also fixed potential mess-up between api/static configs
Diffstat (limited to 'src/App.js')
-rw-r--r--src/App.js31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/App.js b/src/App.js
index a9a46fad..c455c18c 100644
--- a/src/App.js
+++ b/src/App.js
@@ -18,7 +18,14 @@ export default {
ChatPanel
},
data: () => ({
- mobileActivePanel: 'timeline'
+ mobileActivePanel: 'timeline',
+ supportsMask: window.CSS && window.CSS.supports && (
+ window.CSS.supports('mask-size', 'contain') ||
+ window.CSS.supports('-webkit-mask-size', 'contain') ||
+ window.CSS.supports('-moz-mask-size', 'contain') ||
+ window.CSS.supports('-ms-mask-size', 'contain') ||
+ window.CSS.supports('-o-mask-size', 'contain')
+ )
}),
created () {
// Load the locale from the storage
@@ -29,7 +36,27 @@ export default {
background () {
return this.currentUser.background_image || this.$store.state.config.background
},
- logoStyle () { return { 'background-image': `url(${this.$store.state.config.logo})` } },
+ enableMask () { return this.supportsMask && this.$store.state.config.logoMask },
+ logoStyle () {
+ return {
+ 'visibility': this.enableMask ? 'hidden' : 'visible'
+ }
+ },
+ logoMaskStyle () {
+ return this.enableMask ? {
+ 'mask-image': `url(${this.$store.state.config.logo})`
+ } : {
+ 'background-color': this.enableMask ? '' : 'transparent'
+ }
+ },
+ logoBgStyle () {
+ return Object.assign({
+ 'margin': `${this.$store.state.config.logoMargin} 0`
+ }, this.enableMask ? {} : {
+ 'background-color': this.enableMask ? '' : 'transparent'
+ })
+ },
+ logo () { return this.$store.state.config.logo },
style () { return { 'background-image': `url(${this.background})` } },
sitename () { return this.$store.state.config.name },
chat () { return this.$store.state.chat.channel.state === 'joined' },