|
4 | 4 | $desktopHref = '/docs/desktop/1';
|
5 | 5 | @endphp
|
6 | 6 |
|
7 |
| -<div |
8 |
| - {{ $attributes }} |
9 |
| - class="mx-1 mb-3 rounded-xl bg-zinc-100/80 transition-all duration-300 ease-in-out dark:bg-mirage" |
10 |
| - :class="{ |
11 |
| - 'pb-4 pl-4 pr-5 pt-5' : showPlatformSwitcherHeader, |
12 |
| - 'pb-2 pl-2 pr-3 pt-3' : !showPlatformSwitcherHeader |
13 |
| - }" |
| 7 | +<a |
| 8 | + href="{{ $isMobile ? $desktopHref : $mobileHref }}" |
| 9 | + class="group relative mx-0.5 mb-3 w-full rounded-xl bg-gradient-to-tl from-transparent to-violet-100 px-3.5 py-4 dark:from-slate-900/30 dark:to-indigo-900/35" |
14 | 10 | >
|
15 | 11 | <div
|
16 |
| - x-show="showPlatformSwitcherHeader" |
17 |
| - x-collapse |
18 |
| - class="space-y-1.5" |
| 12 | + class="flex items-center gap-3 transition group-hover:translate-y-3 group-hover:opacity-0" |
19 | 13 | >
|
20 |
| - <div class="space-y-1 pl-1"> |
21 |
| - {{-- Title --}} |
22 |
| - <div class="text-sm">Choose your platform</div> |
23 |
| - {{-- Description --}} |
24 |
| - <div class="text-xs opacity-60"> |
25 |
| - Switch between mobile and desktop documentation. |
| 14 | + @if ($isMobile) |
| 15 | + <x-icons.device-mobile-phone class="size-6 shrink-0" /> |
| 16 | + @else |
| 17 | + <x-icons.pc class="size-6 shrink-0" /> |
| 18 | + @endif |
| 19 | + <div class="text-left"> |
| 20 | + <div class="text-xs opacity-50">You're reading the</div> |
| 21 | + <div class="text-sm leading-6 capitalize"> |
| 22 | + {{ $isMobile ? 'Mobile' : 'Desktop' }} Documentation |
26 | 23 | </div>
|
27 | 24 | </div>
|
28 |
| - {{-- Separator --}} |
29 |
| - <div |
30 |
| - class="h-px w-full rounded-full bg-current opacity-5 dark:opacity-15" |
31 |
| - ></div> |
32 | 25 | </div>
|
33 | 26 |
|
34 |
| - {{-- Switcher --}} |
35 |
| - <div |
36 |
| - class="flex items-center gap-3 text-xs" |
37 |
| - :class="{ 'mt-2.5': showPlatformSwitcherHeader }" |
38 |
| - > |
39 |
| - {{-- Desktop --}} |
40 |
| - <a |
41 |
| - href="{{ $desktopHref }}" |
42 |
| - @class([ |
43 |
| - 'flex w-1/2 items-center justify-center gap-x-1.5 gap-y-1 rounded-xl transition duration-300 ease-in-out', |
44 |
| - 'bg-white dark:bg-slate-700/30' => ! $isMobile, |
45 |
| - 'hover:bg-zinc-200/50 dark:text-gray-400/80 dark:hover:bg-gray-900/80 dark:hover:text-white' => $isMobile, |
46 |
| - ]) |
47 |
| - :class="{ 'flex-col p-2.5': showPlatformSwitcherHeader, 'flex-row p-2': !showPlatformSwitcherHeader }" |
48 |
| - > |
49 |
| - <div |
50 |
| - @class([ |
51 |
| - 'grid h-9 w-10 place-items-center rounded-lg', |
52 |
| - 'bg-blue-50 text-blue-500 dark:bg-haiti dark:text-blue-400' => ! $isMobile, |
53 |
| - ]) |
54 |
| - > |
55 |
| - <x-icons.pc class="size-6 shrink-0" /> |
56 |
| - </div> |
57 |
| - <div>Desktop</div> |
58 |
| - </a> |
59 |
| - |
60 |
| - {{-- Center icon --}} |
61 |
| - <svg |
62 |
| - xmlns="http://www.w3.org/2000/svg" |
63 |
| - class="size-6 dark:text-gray-400/80" |
64 |
| - viewBox="0 0 256 256" |
65 |
| - > |
66 |
| - <path |
67 |
| - fill="currentColor" |
68 |
| - d="M144 128a16 16 0 1 1-16-16a16 16 0 0 1 16 16m-84-16a16 16 0 1 0 16 16a16 16 0 0 0-16-16m136 0a16 16 0 1 0 16 16a16 16 0 0 0-16-16" |
69 |
| - /> |
70 |
| - </svg> |
71 |
| - |
72 |
| - {{-- Mobile --}} |
73 |
| - <a |
74 |
| - href="{{ $mobileHref }}" |
75 |
| - @class([ |
76 |
| - 'flex w-1/2 items-center justify-center gap-x-1.5 gap-y-1 rounded-xl transition duration-300 ease-in-out', |
77 |
| - 'bg-white dark:bg-slate-700/30' => $isMobile, |
78 |
| - 'hover:bg-zinc-200/50 dark:text-gray-400/80 dark:hover:bg-gray-900/80 dark:hover:text-white' => ! $isMobile, |
79 |
| - ]) |
80 |
| - :class="{ 'flex-col p-2.5': showPlatformSwitcherHeader, 'flex-row p-2': !showPlatformSwitcherHeader }" |
| 27 | + <div class="absolute top-1/2 right-1/2 translate-x-1/2 -translate-y-1/2"> |
| 28 | + <div |
| 29 | + class="flex -translate-y-3 items-center justify-center gap-2 opacity-0 transition group-hover:translate-y-0 group-hover:opacity-100" |
81 | 30 | >
|
82 |
| - <div |
83 |
| - @class([ |
84 |
| - 'grid h-9 w-10 place-items-center rounded-lg', |
85 |
| - 'bg-blue-50 text-blue-500 dark:bg-haiti dark:text-blue-400' => $isMobile, |
86 |
| - ]) |
87 |
| - > |
88 |
| - <x-icons.device-mobile-phone class="size-5 shrink-0" /> |
89 |
| - </div> |
90 |
| - <div>Mobile</div> |
91 |
| - </a> |
| 31 | + {{ $isMobile ? 'Mobile' : 'Desktop' }} |
| 32 | + <x-icons.right-arrow class="size-3" /> |
| 33 | + {{ $isMobile ? 'Desktop' : 'Mobile' }} |
| 34 | + </div> |
92 | 35 | </div>
|
93 |
| -</div> |
| 36 | +</a> |
0 commit comments