mirror of
https://github.com/hunvreus/basecoat.git
synced 2026-11-17 07:28:23 +00:00
Adding mobile support for sidebar
This commit is contained in:
@@ -83,11 +83,33 @@
|
||||
<body>
|
||||
|
||||
{% from "sidebar.njk" import sidebar %}
|
||||
{% from "popover.njk" import popover %}
|
||||
|
||||
{% set footer %}
|
||||
<a href="/logout">
|
||||
<span class="icon" aria-hidden="true">🚪</span>
|
||||
<span>Logout</span>
|
||||
</a>
|
||||
{% set trigger %}
|
||||
<img src="https://github.com/hunvreus.png" class="rounded-lg shrink-0 size-8">
|
||||
<div class="grid flex-1 text-left text-sm leading-tight">
|
||||
<span class="truncate font-medium">Ronan Berder</span>
|
||||
<span class="truncate text-xs">@hunvreus</span>
|
||||
</div>
|
||||
{% lucide "chevrons-up-down" %}
|
||||
{% endset %}
|
||||
{% call popover(
|
||||
trigger=trigger,
|
||||
trigger_attrs={"class": "btn-ghost p-2 h-12 w-full flex items-center justify-start"},
|
||||
content_attrs={"data-side": "right", "data-align": "end", "class": "w-80"}
|
||||
) %}
|
||||
<div class="grid gap-4 p-4">
|
||||
<header class="grid gap-1.5">
|
||||
<h2 class="font-semibold">I hope you like Basecoat...</h2>
|
||||
<p class="text-muted-foreground text-sm">I made this (and <a class="underline underline-offset-4" href="https://pagescms.org" target="_target">other things</a>) because I thought it'd be helpful to others. If you find it useful, please consider sponsoring me on GitHub or following me on X.</p>
|
||||
</header>
|
||||
<footer class="grid gap-2">
|
||||
<a href="https://github.com/sponsors/hunvreus" class="btn-sm" target="_blank">Sponsor me on GitHub</a>
|
||||
<a href="https://x.com/hunvreus" class="btn-sm-outline" target="_blank">Follow me on X</a>
|
||||
</footer>
|
||||
</div>
|
||||
{% endcall %}
|
||||
{% endset %}
|
||||
|
||||
{% set header %}
|
||||
@@ -97,7 +119,7 @@
|
||||
</div>
|
||||
<div class="grid flex-1 text-left text-sm leading-tight">
|
||||
<span class="truncate font-medium">Basecoat</span>
|
||||
<span class="truncate text-xs">v0.1.0</span>
|
||||
<span class="truncate text-xs">v{{ pkg.version }}</span>
|
||||
</div>
|
||||
</a>
|
||||
<div class="flex flex-col gap-2 px-2 text-sm">
|
||||
@@ -109,45 +131,54 @@
|
||||
</div>
|
||||
{% endset %}
|
||||
|
||||
{% set link_attrs = {
|
||||
"hx-boost": "true",
|
||||
"hx-select": "#content",
|
||||
"hx-target": "#content",
|
||||
"hx-swap": "outerHTML"
|
||||
} %}
|
||||
|
||||
{% set icon_info %}{% lucide "info" %}{% endset %}
|
||||
{% set icon_square_terminal %}{% lucide "square-terminal" %}{% endset %}
|
||||
{% set icon_layout_dashboard %}{% lucide "layout-dashboard" %}{% endset %}
|
||||
{% set icon_github %}{% lucide "github" %}{% endset %}
|
||||
|
||||
{% set menu = [
|
||||
{ type: "group", label: "Getting started", items: [
|
||||
{ type: "item", label: "Introduction", url: "/", icon: icon_info, current: true },
|
||||
{ type: "item", label: "Installation", url: "/installation", icon: icon_square_terminal },
|
||||
{ type: "item", label: "Kitchen sink", url: "/kitchen-sink", icon: icon_layout_dashboard }
|
||||
{ type: "item", label: "Introduction", url: "/", icon: icon_info, current: true, attrs: link_attrs },
|
||||
{ type: "item", label: "Installation", url: "/installation", icon: icon_square_terminal, attrs: link_attrs },
|
||||
{ type: "item", label: "Kitchen sink", url: "/kitchen-sink", icon: icon_layout_dashboard, attrs: link_attrs },
|
||||
{ type: "item", label: "GitHub", url: "https://github.com/hunvreus/basecoat", icon: icon_github, attrs: link_attrs }
|
||||
]},
|
||||
{ type: 'group', label: 'Components', items: [
|
||||
{ type: "item", url: "/components/accordion", label: "Accordion" },
|
||||
{ type: "item", url: "/components/alert", label: "Alert" },
|
||||
{ type: "item", url: "/components/alert-dialog", label: "Alert Dialog" },
|
||||
{ type: "item", url: "/components/avatar", label: "Avatar" },
|
||||
{ type: "item", url: "/components/badge", label: "Badge" },
|
||||
{ type: "item", url: "/components/breadcrumb", label: "Breadcrumb" },
|
||||
{ type: "item", url: "/components/button", label: "Button" },
|
||||
{ type: "item", url: "/components/card", label: "Card" },
|
||||
{ type: "item", url: "/components/checkbox", label: "Checkbox" },
|
||||
{ type: "item", url: "/components/combobox", label: "Combobox" },
|
||||
{ type: "item", url: "/components/dialog", label: "Dialog" },
|
||||
{ type: "item", url: "/components/dropdown-menu", label: "Dropdown Menu" },
|
||||
{ type: "item", url: "/components/form", label: "Form" },
|
||||
{ type: "item", url: "/components/input", label: "Input" },
|
||||
{ type: "item", url: "/components/label", label: "Label" },
|
||||
{ type: "item", url: "/components/pagination", label: "Pagination" },
|
||||
{ type: "item", url: "/components/popover", label: "Popover" },
|
||||
{ type: "item", url: "/components/radio-group", label: "Radio Group" },
|
||||
{ type: "item", url: "/components/select", label: "Select" },
|
||||
{ type: "item", url: "/components/skeleton", label: "Skeleton" },
|
||||
{ type: "item", url: "/components/sidebar", label: "Sidebar" },
|
||||
{ type: "item", url: "/components/slider", label: "Slider" },
|
||||
{ type: "item", url: "/components/switch", label: "Switch" },
|
||||
{ type: "item", url: "/components/table", label: "Table" },
|
||||
{ type: "item", url: "/components/tabs", label: "Tabs" },
|
||||
{ type: "item", url: "/components/textarea", label: "Textarea" },
|
||||
{ type: "item", url: "/components/toast", label: "Toast" },
|
||||
{ type: "item", url: "/components/tooltip", label: "Tooltip" }
|
||||
{ type: "item", url: "/components/accordion", label: "Accordion", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/alert", label: "Alert", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/alert-dialog", label: "Alert Dialog", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/avatar", label: "Avatar", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/badge", label: "Badge", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/breadcrumb", label: "Breadcrumb", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/button", label: "Button", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/card", label: "Card", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/checkbox", label: "Checkbox", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/combobox", label: "Combobox", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/dialog", label: "Dialog", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/dropdown-menu", label: "Dropdown Menu", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/form", label: "Form", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/input", label: "Input", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/label", label: "Label", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/pagination", label: "Pagination", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/popover", label: "Popover", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/radio-group", label: "Radio Group", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/select", label: "Select", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/skeleton", label: "Skeleton", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/sidebar", label: "Sidebar", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/slider", label: "Slider", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/switch", label: "Switch", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/table", label: "Table", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/tabs", label: "Tabs", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/textarea", label: "Textarea", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/toast", label: "Toast", attrs: link_attrs },
|
||||
{ type: "item", url: "/components/tooltip", label: "Tooltip", attrs: link_attrs }
|
||||
]}
|
||||
] %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user