avatar: add size 30, fix unique scaled avatar background

This commit is contained in:
Felix Niklas 2016-03-23 15:14:42 +01:00
parent fa223d560f
commit 77eccea2c9
2 changed files with 18 additions and 4 deletions

View file

@ -48,6 +48,7 @@ class App.User extends App.Model
return '??' return '??'
avatar: (size = 40, placement = '', cssClass = '', unique = false, avatar, type = undefined) -> avatar: (size = 40, placement = '', cssClass = '', unique = false, avatar, type = undefined) ->
baseSize = 40
size = parseInt(size, 10) size = parseInt(size, 10)
cssClass += ' ' if cssClass cssClass += ' ' if cssClass
@ -92,8 +93,8 @@ class App.User extends App.Model
cssClass: cssClass cssClass: cssClass
placement: placement placement: placement
vip: vip vip: vip
x: x x: x * size/baseSize
y: y y: y * size/baseSize
initials: @initials() initials: @initials()
# generate image based avatar # generate image based avatar

View file

@ -3381,6 +3381,11 @@ footer {
vertical-align: bottom; vertical-align: bottom;
position: relative; position: relative;
&.size-30 {
width: 30px;
height: 30px;
}
.icon-crown { .icon-crown {
position: absolute; position: absolute;
width: 28px; width: 28px;
@ -3414,7 +3419,7 @@ footer {
&.unique { &.unique {
background-image: image_url("/assets/images/avatar-bg.png"); background-image: image_url("/assets/images/avatar-bg.png");
background-size: auto; background-size: 300px 226px;
color: white; color: white;
line-height: 40px; line-height: 40px;
text-align: center; text-align: center;
@ -3424,14 +3429,22 @@ footer {
text-shadow: 0 1px rgba(0,0,0,.2); text-shadow: 0 1px rgba(0,0,0,.2);
cursor: default; cursor: default;
&.size-30 {
font-size: 10px;
line-height: 32px;
background-size: 225px 170px;
}
&.size-50 { &.size-50 {
font-size: 16px; font-size: 16px;
line-height: 52px; line-height: 52px;
background-size: 375px 283px;
} }
&.size-80 { &.size-80 {
font-size: 20px; font-size: 26px;
line-height: 84px; line-height: 84px;
background-size: 600px 452px;
} }
} }