mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: navbar rewrite
This commit is contained in:
1 parent
27abf1b0de
commit
e9684ce033
5 files changed
+50
-28
No files matched your search
@@ -16,6 +16,8 @@ import "@fontsource-variable/roboto-flex";
|
|||||||
--space-8: 16rem;
|
--space-8: 16rem;
|
||||||
--space-9: 32rem;
|
--space-9: 32rem;
|
||||||
|
|
||||||
|
--page-width: 52rem;
|
||||||
|
|
||||||
--max-size: max(100vw, 100vh);
|
--max-size: max(100vw, 100vh);
|
||||||
|
|
||||||
--font-size-regular: 1rem;
|
--font-size-regular: 1rem;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const strings = await api.strings(locale);
|
|||||||
|
|
||||||
.content {
|
.content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
max-width: 52rem;
|
max-width: var(--page-width);
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -1,36 +1,54 @@
|
|||||||
---
|
---
|
||||||
import { HamburgerMenuIcon, MagnifyingGlassIcon } from "@radix-ui/react-icons";
|
import { HamburgerMenuIcon, MagnifyingGlassIcon } from "@radix-ui/react-icons";
|
||||||
import { BlitzKitIcon } from "../icons/BlitzKit";
|
import { BlitzKitIcon } from "../icons/BlitzKit";
|
||||||
|
import { LinkI18n } from "./LinkI18n";
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
locale: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { locale } = Astro.props;
|
||||||
---
|
---
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.navbar {
|
.navbar {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
width: 100%;
|
left: 0;
|
||||||
margin-bottom: calc(var(--space-4) * -1);
|
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: center;
|
||||||
|
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
backdrop-filter: var(--blur-glass);
|
backdrop-filter: var(--blur-glass);
|
||||||
background-color: var(--black-a11);
|
background-color: var(--black-a5);
|
||||||
|
|
||||||
|
.content {
|
||||||
|
flex: 1;
|
||||||
|
max-width: calc(var(--page-width) + 2 * var(--space-4));
|
||||||
|
|
||||||
.side {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
.action {
|
.side {
|
||||||
width: calc(var(--space-5) + var(--space-4));
|
|
||||||
height: calc(var(--space-5) + var(--space-4));
|
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
.icon {
|
.action {
|
||||||
width: 1.25em;
|
padding: var(--space-4);
|
||||||
height: 1.25em;
|
|
||||||
|
cursor: pointer;
|
||||||
|
color: var(--color-regular);
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
outline: var(--outline-focus);
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 1.25em;
|
||||||
|
height: 1.25em;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -38,19 +56,21 @@ import { BlitzKitIcon } from "../icons/BlitzKit";
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
<div class="side">
|
<div class="content">
|
||||||
<div class="action">
|
<div class="side">
|
||||||
<BlitzKitIcon className="icon" />
|
<LinkI18n {locale} className="action" tabIndex={0}>
|
||||||
</div>
|
<BlitzKitIcon className="icon" />
|
||||||
</div>
|
</LinkI18n>
|
||||||
|
|
||||||
<div class="side">
|
|
||||||
<div class="action">
|
|
||||||
<MagnifyingGlassIcon className="icon" />
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="action">
|
<div class="side">
|
||||||
<HamburgerMenuIcon className="icon" />
|
<div class="action" tabindex="0">
|
||||||
|
<MagnifyingGlassIcon className="icon" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="action" tabindex="0">
|
||||||
|
<HamburgerMenuIcon className="icon" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
.content {
|
.content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
max-width: 52rem;
|
max-width: var(--page-width);
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ const { accent, noNavbar, locale } = Astro.props;
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="dark">
|
<body class="dark">
|
||||||
{!noNavbar && <Navbar />}
|
{!noNavbar && <Navbar {locale} />}
|
||||||
|
|
||||||
<slot />
|
<slot />
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user