Skip to content

📱 Enhance mobile experience #173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Jun 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
44b2466
✨ Add mobile menu component and enhance layout interactivity
HassanZahirnia Jun 5, 2025
aa52ed8
Merge branch 'main' into enhance-mobile-menu
HassanZahirnia Jun 5, 2025
18520b2
✨ Enhance mobile menu and social links styling for improved accessibi…
HassanZahirnia Jun 5, 2025
2eea81b
✨ Improve mobile menu item layout and add right-arrow icons for activ…
HassanZahirnia Jun 5, 2025
c946de5
✨ Refactor mobile menu links to improve active state handling and rea…
HassanZahirnia Jun 5, 2025
9e1ccd8
✨ Enhance mobile menu functionality by improving popover synchronizat…
HassanZahirnia Jun 5, 2025
4102084
✨ Enhance mobile menu accessibility by adding ARIA attributes and imp…
HassanZahirnia Jun 5, 2025
e851b1d
✨ Refactor layout components to improve structure and enhance documen…
HassanZahirnia Jun 5, 2025
51b7108
✨ Refactor mobile menu and documentation navigation for improved acce…
HassanZahirnia Jun 6, 2025
cafe405
✨ Refactor mini-platform switcher layout for improved structure and c…
HassanZahirnia Jun 6, 2025
bc3ac09
✨ Refactor docs menu button layout for improved spacing and structure
HassanZahirnia Jun 6, 2025
25863e0
✨ Refactor DocSearch button styles for improved consistency and trans…
HassanZahirnia Jun 6, 2025
f0df8f9
✨ Refactor docs menu button styles for improved layout and transition…
HassanZahirnia Jun 6, 2025
4d586ec
✨ Refactor mobile menu structure for improved layout and transition e…
HassanZahirnia Jun 6, 2025
a76d82e
✨ Refactor docs mobile menu structure for improved layout and transit…
HassanZahirnia Jun 6, 2025
9887ef1
✨ Enhance mobile menu animations and structure for improved user expe…
HassanZahirnia Jun 6, 2025
073e655
✨ Enhance dark mode styles for DocSearch components to improve visual…
HassanZahirnia Jun 6, 2025
14d9e3e
✨ Add padding and text styling to DocSearch hit source and footer for…
HassanZahirnia Jun 6, 2025
80a1787
✨ Replace layout-three-columns component with docs-layout for improve…
HassanZahirnia Jun 6, 2025
bd4c99c
align docs menu center
steven-fox Jun 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions resources/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@
}
}

/* Prevents scrollbars from appearing when a popover is open */
html:has(#mobile-menu-popover:popover-open) {
overflow: hidden;
}

/* Scrollbar width */
::-webkit-scrollbar {
height: 8px;
Expand Down
106 changes: 101 additions & 5 deletions resources/css/docsearch.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
}

.DocSearch-Button {
@apply m-0 flex items-center rounded-lg bg-gray-50 font-normal ring-1 ring-gray-700/40 transition duration-300 ease-out dark:bg-black/30;
@apply m-0 flex items-center rounded-lg bg-gray-50 font-normal ring-1 ring-slate-600/40 transition duration-300 ease-out dark:bg-black/30;
}

.DocSearch-Button:hover {
box-shadow: none;
@apply bg-gray-100 ring-gray-300 dark:bg-black/50 dark:ring-gray-700/70;
@apply bg-gray-100 ring-1 ring-transparent dark:bg-slate-950 dark:ring-slate-700/70;
}

.DocSearch-Button:hover .DocSearch-Button-Placeholder {
Expand All @@ -36,11 +36,11 @@
}

.DocSearch-Button-Placeholder {
@apply hidden pr-1 pl-1 text-sm text-black/60 min-[400px]:block min-[520px]:pr-20 dark:text-white/60;
@apply px-1 text-sm text-black/60 transition duration-300 min-[520px]:pr-20 dark:text-white/60;
}

.DocSearch-Button-Keys {
@apply mt-1 ml-1 hidden min-w-[auto] text-sm leading-none min-[520px]:flex;
@apply mt-1 ml-1 hidden min-w-[auto] text-sm leading-none sm:flex;
}

.DocSearch-Button-Key {
Expand All @@ -55,12 +55,108 @@
@apply text-black;
}

.DocSearch-Modal:where(.dark, .dark *) {
background-color: var(--color-slate-950);
--docsearch-hit-active-color: var(--color-slate-300);
}

.DocSearch-SearchBar .DocSearch-Form:where(.dark, .dark *) {
border-color: color-mix(in oklab, var(--color-white) 10%, transparent);
background-color: color-mix(in oklab, var(--color-white) 15%, transparent);
color: var(--color-slate-300);
}
.DocSearch-SearchBar .DocSearch-Form:where(.dark, .dark *)::placeholder {
color: var(--color-slate-400);
}
.DocSearch-SearchBar .DocSearch-Form:where(.dark, .dark *) {
--tw-shadow: 0 0 #0000;
box-shadow:
var(--tw-inset-shadow), var(--tw-inset-ring-shadow),
var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
}
.DocSearch-SearchBar .DocSearch-Form:where(.dark, .dark *):disabled {
border-color: color-mix(in oklab, var(--color-white) 5%, transparent);
color: var(--color-slate-400);
}
.DocSearch-SearchBar
.DocSearch-Form:where(.dark, .dark *):disabled::placeholder,
.DocSearch-SearchBar .DocSearch-MagnifierLabel {
color: var(--color-slate-500);
}
.DocSearch-SearchBar .DocSearch-MagnifierLabel:where(.dark, .dark *) {
color: var(--color-slate-300);
}
.DocSearch-SearchBar .DocSearch-LoadingIndicator {
color: var(--color-slate-500);
}
.DocSearch-SearchBar .DocSearch-LoadingIndicator:where(.dark, .dark *),
.DocSearch-SearchBar .DocSearch-Input:where(.dark, .dark *),
.DocSearch-SearchBar .DocSearch-Cancel:where(.dark, .dark *) {
color: var(--color-slate-300);
}

.DocSearch-Dropdown .DocSearch-Hits mark:where(.dark, .dark *) {
color: var(--color-slate-400);
}

.DocSearch-Hit-source {
@apply py-2.5 text-base;
}

.DocSearch-Dropdown .DocSearch-Hit-source:where(.dark, .dark *) {
background-color: var(--color-slate-950);
color: var(--color-slate-300);
}

.DocSearch-Dropdown
.DocSearch-Hit[aria-selected='true']
a:where(.dark, .dark *) {
background-color: var(--color-indigo-800);
}

.DocSearch-Dropdown .DocSearch-Hit a:where(.dark, .dark *) {
background-color: var(--color-indigo-900);
box-shadow: none;
}

.DocSearch-Dropdown .DocSearch-Hit .DocSearch-Hit-title:where(.dark, .dark *) {
color: var(--color-slate-300);
}

.DocSearch-Dropdown
.DocSearch-NoResults
.DocSearch-Screen-Icon:where(.dark, .dark *) {
color: var(--color-slate-500);
}

.DocSearch-Dropdown
.DocSearch-NoResults
.DocSearch-Title:where(.dark, .dark *) {
color: var(--color-slate-300);
}

.DocSearch-Footer {
@apply py-6;
}

.DocSearch-Footer:where(.dark, .dark *) {
background: var(--color-slate-950);
box-shadow: none;
@apply border-t border-t-slate-700;
}

.DocSearch-Footer .DocSearch-Logo svg :where(.dark, .dark *) {
fill: var(--color-gray-500);
color: var(--color-white);
background: transparent;
}

.DocSearch-Screen-Icon {
display: none;
}

.DocSearch-Input {
@apply focus-visible:outline-none;
@apply ring-0 outline-0 focus-visible:outline-none;
}

.DocSearch-Form {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<x-layout :hasMenu="! empty($sidebarLeft)">
<x-layout>
{{-- Main container --}}
<main
class="mx-auto flex w-full max-w-5xl grow items-start px-4 pt-1 xl:max-w-7xl 2xl:max-w-360"
Expand All @@ -13,7 +13,13 @@ class="mx-auto flex w-full max-w-5xl grow items-start px-4 pt-1 xl:max-w-7xl 2xl
<div class="flex w-full min-w-0 grow items-start px-2 pt-2">
{{-- Content --}}
<article class="flex w-full min-w-0 grow flex-col lg:pl-5 xl:pr-5">
{{ $slot }}
{{-- Docs mobile menu --}}
<x-docs-menu>
<nav class="docs-navigation">{{ $sidebarLeft }}</nav>
</x-docs-menu>

{{-- Main content --}}
<div class="mt-3">{{ $slot }}</div>
</article>

{{-- Right sidebar --}}
Expand Down
64 changes: 64 additions & 0 deletions resources/views/components/docs-menu.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<div class="lg:hidden">
<div
class="mb-2 flex flex-col-reverse items-start justify-between gap-3.5 min-[400px]:mb-2.5 min-[400px]:flex-row min-[400px]:items-center"
>
{{-- Docs menu button --}}
<button
type="button"
x-on:click="showDocsMenu = !showDocsMenu"
class="-mx-1 flex items-center gap-1.5 px-1 py-1.5 transition duration-300 ease-in-out will-change-transform focus:ring-0 focus:outline-none"
:aria-expanded="showDocsMenu"
aria-label="Toggle docs menu"
aria-haspopup="true"
title="Open docs navigation"
:class="{
'translate-x-1': showDocsMenu,
}"
>
<svg
xmlns="http://www.w3.org/2000/svg"
class="size-5.5"
viewBox="0 0 24 24"
>
<g
fill="none"
stroke="currentColor"
stroke-linecap="round"
stroke-width="1.5"
>
<path
d="M4 19V5a2 2 0 0 1 2-2h13.4a.6.6 0 0 1 .6.6v13.114"
/>
<path
stroke-linejoin="round"
d="M8 3v8l2.5-1.6L13 11V3"
/>
<path d="M6 17h14M6 21h14" />
<path
stroke-linejoin="round"
d="M6 21a2 2 0 1 1 0-4"
/>
</g>
</svg>

<div>Menu</div>
</button>

{{-- Platform switcher --}}
<x-mini-platform-switcher />
</div>

{{-- Docs mobile menu --}}
<div
x-show="showDocsMenu"
x-collapse
role="dialog"
aria-modal="true"
aria-label="Docs menu"
class="dark:bg-mirage rounded-xl bg-gray-100"
>
<div class="p-6">
{{ $slot }}
</div>
</div>
</div>
19 changes: 8 additions & 11 deletions resources/views/components/layout.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
<body
x-cloak
x-data="{
showDocsNavigation: false,
showMobileMenu: false,
showDocsMenu: false,
scrolled: window.scrollY > 50,
width: window.innerWidth,
get showPlatformSwitcherHeader() {
Expand All @@ -69,23 +70,19 @@
}"
x-resize="
width = $width
if (width >= 1024) showDocsNavigation = false
if (width >= 1024) {
showMobileMenu = false
showDocsMenu = false
}
"
x-init="
window.addEventListener('scroll', () => {
scrolled = window.scrollY > 50
})
"
x-effect="
if (showDocsNavigation) {
document.body.style.overflow = 'hidden'
} else {
document.body.style.overflow = ''
}
"
class="min-h-screen overflow-x-clip font-poppins antialiased selection:bg-black selection:text-[#b4a9ff] dark:bg-[#050714] dark:text-white"
class="font-poppins min-h-screen overflow-x-clip antialiased selection:bg-black selection:text-[#b4a9ff] dark:bg-[#050714] dark:text-white"
>
<x-navigation-bar :hasMenu="$hasMenu ?? false" />
<x-navigation-bar />
{{ $slot }}
<x-footer />
@livewireScriptConfig
Expand Down
44 changes: 44 additions & 0 deletions resources/views/components/mini-platform-switcher.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
@php
$isMobile = request()->is('docs/mobile/*');
$mobileHref = '/docs/mobile/1';
$desktopHref = '/docs/desktop/1';
@endphp

<div
class="dark:bg-mirage grid h-11 grid-cols-2 items-center gap-0.5 rounded-lg bg-gray-100 p-1 text-xs"
>
<a
href="{{ $desktopHref }}"
@class([
'flex h-9 items-center gap-1.5 rounded-[calc(var(--radius-lg)-1px)] pr-2 pl-1 transition duration-300 ease-in-out',
'bg-white dark:bg-slate-700/30' => ! $isMobile,
])
>
<div
@class([
'grid h-7 w-7.5 place-items-center rounded-[calc(var(--radius-md)-1px)]',
'dark:bg-haiti bg-blue-50 text-blue-500 dark:text-blue-400' => ! $isMobile,
])
>
<x-icons.pc class="size-5 shrink-0" />
</div>
<div>Desktop</div>
</a>
<a
href="{{ $mobileHref }}"
@class([
'flex h-9 items-center gap-1.5 rounded-[calc(var(--radius-lg)-1px)] pr-2 pl-1 transition duration-300 ease-in-out',
'bg-white dark:bg-slate-700/30' => $isMobile,
])
>
<div
@class([
'grid h-7 w-7.5 place-items-center rounded-[calc(var(--radius-md)-1px)]',
'dark:bg-haiti bg-blue-50 text-blue-500 dark:text-blue-400' => $isMobile,
])
>
<x-icons.device-mobile-phone class="size-4 shrink-0" />
</div>
<div>Mobile</div>
</a>
</div>
Loading