diff options
| author | Shpuld Shpludson <shp@cock.li> | 2018-12-13 17:47:01 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2018-12-13 17:47:01 +0000 |
| commit | ad56c8e5bd3f62829b7ccfac285a10425dcbb57a (patch) | |
| tree | bd3b918fdab9295dfdaa64eea72c49f0b6e2589a /src/components/user_card_content/user_card_content.js | |
| parent | ac60550e07b9507ff4a01f4548b781b60f294089 (diff) | |
| parent | cc259411a79c6752f2e71917d58d625fc6028db9 (diff) | |
Merge branch 'collateral-damage-control' into 'develop'
Collateral damage control
See merge request pleroma/pleroma-fe!418
Diffstat (limited to 'src/components/user_card_content/user_card_content.js')
| -rw-r--r-- | src/components/user_card_content/user_card_content.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/components/user_card_content/user_card_content.js b/src/components/user_card_content/user_card_content.js index e7f19953..be7a2349 100644 --- a/src/components/user_card_content/user_card_content.js +++ b/src/components/user_card_content/user_card_content.js @@ -20,10 +20,20 @@ export default { if (color) { const rgb = (typeof color === 'string') ? hex2rgb(color) : color const tintColor = `rgba(${Math.floor(rgb.r)}, ${Math.floor(rgb.g)}, ${Math.floor(rgb.b)}, .5)` + + const gradient = [ + [tintColor, this.hideBio ? '60%' : ''], + this.hideBio ? [ + color, '100%' + ] : [ + tintColor, '' + ] + ].map(_ => _.join(' ')).join(', ') + return { 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})`, + `linear-gradient(to bottom, ${gradient})`, `url(${this.user.cover_photo})` ].join(', ') } |
