tweak style of avatar (close #150)

This commit is contained in:
Pig Fang 2020-03-18 10:33:07 +08:00
parent ff7f81939d
commit 60c628dd11
6 changed files with 15 additions and 5 deletions

View File

@ -23,7 +23,7 @@ class UserMenuComposer
public function compose(View $view)
{
$user = auth()->user();
$avatarUrl = route('avatar.user', ['uid' => $user->uid, 'size' => 25]);
$avatarUrl = route('avatar.user', ['uid' => $user->uid, 'size' => 36]);
$avatar = $this->filter->apply('user_avatar', $avatarUrl, [$user]);
$cli = $this->request->is('admin', 'admin/*');

View File

@ -0,0 +1,8 @@
.bs-avatar {
width: 2.1rem;
height: 2.1rem;
margin-top: -8px;
image-rendering: pixelated;
border-radius: 2px;
filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.3));
}

View File

@ -0,0 +1 @@
@import './avatar';

View File

@ -1,6 +1,6 @@
<li class="nav-item dropdown user-menu">
<a href="#" class="nav-link" data-toggle="dropdown">
<img src="{{ avatar }}" class="user-image img-circle elevation-2" alt="User Image">
<img src="{{ avatar }}" class="bs-avatar mr-1" alt="User Image">
<span class="d-none d-md-inline d-sm-block" data-mark="nickname">
{{ user.nickname ?? user.email }}
</span>

View File

@ -11,12 +11,12 @@ class UserMenuComposerTest extends TestCase
$user = factory(User::class)->create();
$this->actingAs($user)
->get('/')
->assertSee(url('/avatar/user/'.$user->uid.'?size=25'));
->assertSee(url('/avatar/user/'.$user->uid.'?size=36'));
$this->actingAs($user)
->get('/skinlib')
->assertSee(url('/avatar/user/'.$user->uid.'?size=25'));
->assertSee(url('/avatar/user/'.$user->uid.'?size=36'));
$this->actingAs($user)
->get('/user')
->assertSee(url('/avatar/user/'.$user->uid.'?size=25'));
->assertSee(url('/avatar/user/'.$user->uid.'?size=36'));
}
}

View File

@ -17,6 +17,7 @@ const config = {
'@/styles/admin-lte.scss',
'@fortawesome/fontawesome-free/css/all.min.css',
'@/styles/common.styl',
'@/styles/common.scss',
],
spectre: [
'spectre.css/dist/spectre.min.css',