diff --git a/src/components/CommandPalette.astro b/src/components/CommandPalette.astro new file mode 100644 index 00000000..96a1405d --- /dev/null +++ b/src/components/CommandPalette.astro @@ -0,0 +1,211 @@ +--- +import type { AstroModule, ProjectMetadata } from "../pages/index.astro"; + +interface Props {} + +const {} = Astro.props; + +const options = [{ name: "home", location: "/" }]; +// add all individual projects to options +Object.values( + import.meta.glob("../pages/projects/*.astro", { eager: true }) +).forEach((module) => { + const metadata = module.metadata as ProjectMetadata; + if (metadata) { + options.push({ + name: `${metadata.title}`, + location: `/projects/${metadata.slug}`, + }); + } +}); +--- + + + + + + diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 3eae5f0d..e84cd436 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -1,5 +1,6 @@ --- import "../styles/global.css"; +import CommandPalette from "../components/CommandPalette.astro"; import Header from "../components/Header.astro"; const { currentPage } = Astro.props; --- @@ -11,6 +12,7 @@ const { currentPage } = Astro.props; ob - {currentPage.title} +
+ diff --git a/src/pages/index.astro b/src/pages/index.astro index d93e4a07..25bc99ec 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -5,7 +5,7 @@ import TimeSince from "../components/TimeSince.astro"; import { Icon } from "astro-icon/components"; -interface ProjectMetadata { +export interface ProjectMetadata { title: string; description: string; date: string; @@ -16,7 +16,7 @@ interface ProjectMetadata { type: string; } -interface AstroModule { +export interface AstroModule { metadata?: ProjectMetadata; } diff --git a/src/styles/global.css b/src/styles/global.css index f70e340a..7ff0ae35 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -7,6 +7,7 @@ /* core ayu colors */ --ayu-bg: #10141c; + --ayu-bg-50percent: #00000080; --ayu-fg: #bfbdb6; --ayu-accent: #e6b450; --ayu-highlight: #161a24; @@ -140,6 +141,9 @@ body { .bg-ayu-bg { background-color: var(--ayu-bg); } +.bg-ayu-bg-50percent { + background-color: var(--ayu-bg-50percent); +} .bg-ayu-highlight { background-color: var(--ayu-highlight); } @@ -152,6 +156,12 @@ body { .bg-ayu-selection { background-color: var(--ayu-selection); } +.bg-ayu-gutter { + background-color: var(--ayu-gutter); +} +.bg-ayu-gutter-dim { + background-color: var(--ayu-gutter-dim); +} .text-ayu-fg { color: var(--ayu-fg); @@ -216,6 +226,18 @@ body { .border-ayu-accent { border-color: var(--ayu-accent); } +.border-ayu-red-500 { + border-color: var(--ayu-red-500); +} +.border-ayu-green-500 { + border-color: var(--ayu-green-500); +} +.border-ayu-blue-500 { + border-color: var(--ayu-blue-500); +} +.border-ayu-purple-500 { + border-color: var(--ayu-purple-500); +} .border-ayu-gutter { border-color: var(--ayu-gutter); }