tweak style of avatar (close #150)
This commit is contained in:
parent
ff7f81939d
commit
60c628dd11
@ -23,7 +23,7 @@ class UserMenuComposer
|
|||||||
public function compose(View $view)
|
public function compose(View $view)
|
||||||
{
|
{
|
||||||
$user = auth()->user();
|
$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]);
|
$avatar = $this->filter->apply('user_avatar', $avatarUrl, [$user]);
|
||||||
$cli = $this->request->is('admin', 'admin/*');
|
$cli = $this->request->is('admin', 'admin/*');
|
||||||
|
|
||||||
|
8
resources/assets/src/styles/avatar.scss
Normal file
8
resources/assets/src/styles/avatar.scss
Normal 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));
|
||||||
|
}
|
1
resources/assets/src/styles/common.scss
Normal file
1
resources/assets/src/styles/common.scss
Normal file
@ -0,0 +1 @@
|
|||||||
|
@import './avatar';
|
@ -1,6 +1,6 @@
|
|||||||
<li class="nav-item dropdown user-menu">
|
<li class="nav-item dropdown user-menu">
|
||||||
<a href="#" class="nav-link" data-toggle="dropdown">
|
<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">
|
<span class="d-none d-md-inline d-sm-block" data-mark="nickname">
|
||||||
{{ user.nickname ?? user.email }}
|
{{ user.nickname ?? user.email }}
|
||||||
</span>
|
</span>
|
||||||
|
@ -11,12 +11,12 @@ class UserMenuComposerTest extends TestCase
|
|||||||
$user = factory(User::class)->create();
|
$user = factory(User::class)->create();
|
||||||
$this->actingAs($user)
|
$this->actingAs($user)
|
||||||
->get('/')
|
->get('/')
|
||||||
->assertSee(url('/avatar/user/'.$user->uid.'?size=25'));
|
->assertSee(url('/avatar/user/'.$user->uid.'?size=36'));
|
||||||
$this->actingAs($user)
|
$this->actingAs($user)
|
||||||
->get('/skinlib')
|
->get('/skinlib')
|
||||||
->assertSee(url('/avatar/user/'.$user->uid.'?size=25'));
|
->assertSee(url('/avatar/user/'.$user->uid.'?size=36'));
|
||||||
$this->actingAs($user)
|
$this->actingAs($user)
|
||||||
->get('/user')
|
->get('/user')
|
||||||
->assertSee(url('/avatar/user/'.$user->uid.'?size=25'));
|
->assertSee(url('/avatar/user/'.$user->uid.'?size=36'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ const config = {
|
|||||||
'@/styles/admin-lte.scss',
|
'@/styles/admin-lte.scss',
|
||||||
'@fortawesome/fontawesome-free/css/all.min.css',
|
'@fortawesome/fontawesome-free/css/all.min.css',
|
||||||
'@/styles/common.styl',
|
'@/styles/common.styl',
|
||||||
|
'@/styles/common.scss',
|
||||||
],
|
],
|
||||||
spectre: [
|
spectre: [
|
||||||
'spectre.css/dist/spectre.min.css',
|
'spectre.css/dist/spectre.min.css',
|
||||||
|
Loading…
Reference in New Issue
Block a user