Skip to content

Commit fb859c8

Browse files
committed
refactor help and notifications menu for improved transition effects
1 parent c6911c6 commit fb859c8

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

resources/views/livewire/admin/help-menu.blade.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
<div x-data="{ isOpen: false }">
22
<div>
33
<button @click="isOpen = !isOpen" class="focus:outline-none">
4-
<svg xmlns="http://www.w3.org/2000/svg" class="size-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
5-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
4+
<svg xmlns="http://www.w3.org/2000/svg" class="size-5" fill="none" viewBox="0 0 24 24"
5+
stroke="currentColor">
6+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
7+
d="M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
68
</svg>
79
</button>
810
</div>
911

1012
<div
11-
x-show.transition="isOpen"
13+
x-show="isOpen"
14+
x-transition:enter="transition ease-out duration-300"
15+
x-transition:enter-start="opacity-0 transform translate-x-full"
16+
x-transition:enter-end="opacity-100 transform translate-x-0"
17+
x-transition:leave="transition ease-in duration-200"
18+
x-transition:leave-start="opacity-100 transform translate-x-0"
19+
x-transition:leave-end="opacity-0 transform translate-x-full"
1220
@click.away="isOpen = false"
1321
class="absolute w-48 origin-top-right right-14">
1422
<div class="relative z-30 bg-white border border-gray-100 shadow-xs rounded-b-md dark:bg-gray-700">
15-
<a href="http://laraveladmintw.com/docs" target="_blank" class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:text-gray-200 dark:hover:bg-gray-600 focus:outline-none">{{ __('Theme Docs (External)') }}</a>
16-
<a href="{{ route('developer-reference') }}" class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:text-gray-200 dark:hover:bg-gray-600 focus:outline-none">{{ __('Developer Reference') }}</a>
23+
<a href="http://laraveladmintw.com/docs" target="_blank"
24+
class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:text-gray-200 dark:hover:bg-gray-600 focus:outline-none">{{ __('Theme Docs (External)') }}</a>
25+
<a href="{{ route('developer-reference') }}"
26+
class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:text-gray-200 dark:hover:bg-gray-600 focus:outline-none">{{ __('Developer Reference') }}</a>
1727
</div>
1828

1929
</div>

resources/views/livewire/admin/notifications-menu.blade.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,15 @@ class="size-5"
2828
</a>
2929
</button>
3030

31-
<div x-show.transition="isOpen" class="fixed z-50 inset-0 overflow-hidden"
32-
aria-labelledby="slide-over-title" role="dialog" aria-modal="true">
31+
<div x-show="isOpen"
32+
x-transition:enter="transition ease-out duration-300"
33+
x-transition:enter-start="opacity-0 transform translate-x-full"
34+
x-transition:enter-end="opacity-100 transform translate-x-0"
35+
x-transition:leave="transition ease-in duration-200"
36+
x-transition:leave-start="opacity-100 transform translate-x-0"
37+
x-transition:leave-end="opacity-0 transform translate-x-full"
38+
class="fixed z-50 inset-0 overflow-hidden"
39+
aria-labelledby="slide-over-title" role="dialog" aria-modal="true">
3340
<div class="absolute inset-0 overflow-hidden bg-gray-500 bg-gray-500/75 transition-opacity">
3441

3542
<div class="fixed inset-y-0 right-0 pl-10 max-w-full flex sm:pl-16">

0 commit comments

Comments
 (0)