aboutsummaryrefslogtreecommitdiff
path: root/src/components/user_card_content/user_card_content.js
diff options
context:
space:
mode:
authorlambda <pleromagit@rogerbraun.net>2018-06-08 13:30:49 +0000
committerlambda <pleromagit@rogerbraun.net>2018-06-08 13:30:49 +0000
commitaf47d51cd14503495c1ee7398ba733ad4c5ed4a4 (patch)
treebf2b0df49756e72800a0f34bd5c26d4fb9beabeb /src/components/user_card_content/user_card_content.js
parent9b86fc4dcd05a8f63ff564e117f06caf8046be78 (diff)
parente2c5e4eb46143b52ccff21ca0914c5f1b79376fa (diff)
Merge branch 'develop' into 'patch-1'
# Conflicts: # src/i18n/messages.js
Diffstat (limited to 'src/components/user_card_content/user_card_content.js')
-rw-r--r--src/components/user_card_content/user_card_content.js20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/components/user_card_content/user_card_content.js b/src/components/user_card_content/user_card_content.js
index 1e8c91de..4d4266cb 100644
--- a/src/components/user_card_content/user_card_content.js
+++ b/src/components/user_card_content/user_card_content.js
@@ -2,16 +2,24 @@ import StillImage from '../still-image/still-image.vue'
import { hex2rgb } from '../../services/color_convert/color_convert.js'
export default {
- props: [ 'user', 'switcher', 'hideBio' ],
+ props: [ 'user', 'switcher', 'selected', 'hideBio' ],
computed: {
headingStyle () {
const color = this.$store.state.config.colors.bg
if (color) {
const rgb = hex2rgb(color)
+ const tintColor = `rgba(${Math.floor(rgb.r)}, ${Math.floor(rgb.g)}, ${Math.floor(rgb.b)}, .5)`
console.log(rgb)
+ console.log([
+ `url(${this.user.cover_photo})`,
+ `linear-gradient(to bottom, ${tintColor}, ${tintColor})`
+ ].join(', '))
return {
- backgroundColor: `rgb(${Math.floor(rgb[0] * 0.53)}, ${Math.floor(rgb[1] * 0.56)}, ${Math.floor(rgb[2] * 0.59)})`,
- backgroundImage: `url(${this.user.cover_photo})`
+ backgroundColor: `rgb(${Math.floor(rgb.r * 0.53)}, ${Math.floor(rgb.g * 0.56)}, ${Math.floor(rgb.b * 0.59)})`,
+ backgroundImage: [
+ `linear-gradient(to bottom, ${tintColor}, ${tintColor})`,
+ `url(${this.user.cover_photo})`
+ ].join(', ')
}
}
},
@@ -61,8 +69,10 @@ export default {
store.state.api.backendInteractor.setUserMute(this.user)
},
setProfileView (v) {
- const store = this.$store
- store.commit('setProfileView', { v })
+ if (this.switcher) {
+ const store = this.$store
+ store.commit('setProfileView', { v })
+ }
}
}
}