mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
feat: ahhhhhhhhhh
This commit is contained in:
1 parent
cbfcb29691
commit
7399c402af
8 files changed
+74
-17
No files matched your search
@@ -9,7 +9,7 @@ export interface HeadingProps extends Omit<TextProps, "size"> {
|
|||||||
export function Heading({
|
export function Heading({
|
||||||
className,
|
className,
|
||||||
weight,
|
weight,
|
||||||
size = "1",
|
size = "2",
|
||||||
...props
|
...props
|
||||||
}: HeadingProps) {
|
}: HeadingProps) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -11,4 +11,13 @@
|
|||||||
&[data-underline="hover"]:focus {
|
&[data-underline="hover"]:focus {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&[data-high-contrast="true"] {
|
||||||
|
color: var(--accent-12);
|
||||||
|
}
|
||||||
|
|
||||||
|
svg {
|
||||||
|
width: 1.25em;
|
||||||
|
height: 1.25em;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -4,14 +4,21 @@ import "./index.css";
|
|||||||
|
|
||||||
export interface LinkProps extends ComponentProps<"a"> {
|
export interface LinkProps extends ComponentProps<"a"> {
|
||||||
underline?: "always" | "hover" | "never";
|
underline?: "always" | "hover" | "never";
|
||||||
|
highContrast?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Link({ className, underline = "always", ...props }: LinkProps) {
|
export function Link({
|
||||||
|
highContrast,
|
||||||
|
className,
|
||||||
|
underline = "always",
|
||||||
|
...props
|
||||||
|
}: LinkProps) {
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
className={classNames("link", className)}
|
className={classNames("link", className)}
|
||||||
{...props}
|
{...props}
|
||||||
data-underline={underline}
|
data-underline={underline}
|
||||||
|
data-high-contrast={highContrast}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -19,26 +19,40 @@ const strings = await api.strings(locale);
|
|||||||
|
|
||||||
<style>
|
<style>
|
||||||
#navbar {
|
#navbar {
|
||||||
position: sticky;
|
position: fixed;
|
||||||
top: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
background-color: var(--gray-3);
|
background-color: var(--gray-a5);
|
||||||
box-shadow: var(--shadow-none);
|
box-shadow: var(--shadow-none);
|
||||||
|
backdrop-filter: var(--blur-glass) brightness(5%);
|
||||||
|
border-radius: var(--space-4) var(--space-4) 0 0;
|
||||||
|
|
||||||
transition-duration: var(--duration-brief);
|
transition-duration: var(--duration-brief);
|
||||||
|
|
||||||
&[data-sticky="true"] {
|
&[data-sticky="true"] {
|
||||||
background-color: var(--gray-a2);
|
transform: translateY(100%);
|
||||||
box-shadow: var(--shadow-subtle);
|
}
|
||||||
|
|
||||||
|
.bar {
|
||||||
|
width: 100%;
|
||||||
|
max-width: var(--space-6);
|
||||||
|
height: var(--space-2);
|
||||||
|
margin-top: var(--space-3);
|
||||||
|
|
||||||
|
background-color: var(--white-a2);
|
||||||
|
|
||||||
|
border-radius: var(--max-size);
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
flex: 1;
|
width: 100%;
|
||||||
max-width: calc(var(--page-width) + 2 * var(--space-4));
|
max-width: calc(var(--page-width) + 2 * var(--space-4));
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -97,9 +111,12 @@ const strings = await api.strings(locale);
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
const navbar = document.getElementById("navbar")!;
|
const navbar = document.getElementById("navbar")!;
|
||||||
|
let lastScrollY = window.scrollY;
|
||||||
|
|
||||||
function handleScroll() {
|
function handleScroll() {
|
||||||
navbar.dataset.sticky = `${window.scrollY > 0}`;
|
const dy = window.scrollY - lastScrollY;
|
||||||
|
lastScrollY = window.scrollY;
|
||||||
|
navbar.dataset.sticky = `${dy > 0}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
handleScroll();
|
handleScroll();
|
||||||
@@ -107,6 +124,8 @@ const strings = await api.strings(locale);
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="navbar">
|
<div id="navbar">
|
||||||
|
<div class="bar"></div>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<LinkI18n {locale} href="/" className="action" tabIndex={0} data-selected>
|
<LinkI18n {locale} href="/" className="action" tabIndex={0} data-selected>
|
||||||
<div class="selector">
|
<div class="selector">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
.section {
|
.section {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: 0 var(--space-4);
|
padding: var(--space-4);
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
---
|
---
|
||||||
|
import { ArrowLeftIcon } from "@radix-ui/react-icons";
|
||||||
import { api } from "../core/api/dynamic";
|
import { api } from "../core/api/dynamic";
|
||||||
import type { Tool } from "../core/tools/tools";
|
import type { Tool } from "../core/tools/tools";
|
||||||
import { Heading } from "./Heading";
|
import { Heading } from "./Heading";
|
||||||
|
import { LinkI18n } from "./LinkI18n";
|
||||||
import { Text } from "./Text";
|
import { Text } from "./Text";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -17,7 +19,6 @@ const toolStrings = strings.tools[tool.id as keyof typeof strings.tools];
|
|||||||
<style>
|
<style>
|
||||||
.tool-banner {
|
.tool-banner {
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
margin-bottom: calc(var(--space-5) - var(--space-4));
|
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -25,7 +26,8 @@ const toolStrings = strings.tools[tool.id as keyof typeof strings.tools];
|
|||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
flex-direction: column;
|
||||||
|
gap: var(--space-4);
|
||||||
padding: var(--space-5) var(--space-4);
|
padding: var(--space-5) var(--space-4);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
@@ -35,6 +37,10 @@ const toolStrings = strings.tools[tool.id as keyof typeof strings.tools];
|
|||||||
padding: var(--space-6) var(--space-4);
|
padding: var(--space-6) var(--space-4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.back {
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
.centered {
|
.centered {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
max-width: var(--page-width);
|
max-width: var(--page-width);
|
||||||
@@ -71,11 +77,13 @@ const toolStrings = strings.tools[tool.id as keyof typeof strings.tools];
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
<LinkI18n highContrast className="back" {locale} href="/">
|
||||||
|
<ArrowLeftIcon />
|
||||||
|
</LinkI18n>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="pattern"
|
class="pattern"
|
||||||
style={{
|
style={{ backgroundImage: `url(/assets/patterns/${tool.id}.svg)` }}
|
||||||
backgroundImage: `url(/assets/patterns/${tool.id}.svg)`,
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ const { accent, noNavbar, locale } = Astro.props;
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: var(--space-5);
|
|
||||||
|
|
||||||
background-color: var(--gray-1);
|
background-color: var(--gray-1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
import { Heading } from "../../../components/Heading";
|
||||||
|
import { Section } from "../../../components/Section";
|
||||||
|
import BaseLayout from "../../../layouts/BaseLayout.astro";
|
||||||
|
|
||||||
|
export { getStaticPaths } from "../index.astro";
|
||||||
|
|
||||||
|
const { locale } = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<BaseLayout {locale} accent="amber">
|
||||||
|
<Section>
|
||||||
|
<Heading>Settings</Heading>
|
||||||
|
</Section>
|
||||||
|
</BaseLayout>
|
||||||
Reference in new issue
Block a user