summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorseth <[email protected]>2024-04-08 22:58:22 -0400
committerseth <[email protected]>2024-04-08 22:58:22 -0400
commitd8a20e3032a0ce97b6ddc29840e135eda9b3f43c (patch)
tree40a4059020ff4c9d500d4022f5b84e7bf2c46fd4 /src/components
parent33a4eb02a8307be1bcfaaabbe3adaf25d0088d3b (diff)
refactor; use plain css
Diffstat (limited to 'src/components')
-rw-r--r--src/components/Footer.astro30
-rw-r--r--src/components/Gifs.astro20
-rw-r--r--src/components/Head.astro31
-rw-r--r--src/components/Nav.astro30
-rw-r--r--src/components/NavBar.astro20
5 files changed, 40 insertions, 91 deletions
diff --git a/src/components/Footer.astro b/src/components/Footer.astro
deleted file mode 100644
index 7897b8d..0000000
--- a/src/components/Footer.astro
+++ /dev/null
@@ -1,30 +0,0 @@
----
-import { execa } from "execa";
-import Picture from "astro/components/Picture.astro";
-import gifs from "@assets/gifs";
-
-const { stdout: gitCommit } = await execa("git", ["rev-parse", "HEAD"]);
----
-
-<footer class="text-xs text-subtext1 my-10 text-right space-y-2">
- <div class="hidden md:flex flex-wrap justify-around">
- {
- gifs.map(({ gif, alt }) => {
- const img = <Picture src={gif} alt={alt} formats={["gif"]} />;
-
- if (gif.src.includes("steam")) {
- return <a href="https://dnsense.pub/">{img}</a>;
- } else if (gif.src.includes("poweredbynix")) {
- return <a href="https://github.com/sakecode">{img}</a>;
- } else {
- return img;
- }
- })
- }
- </div>
- <p>
- Served from commit {gitCommit.substring(0, 8)} (<a
- href="https://github.com/getchoo/website">source</a
- >)
- </p>
-</footer>
diff --git a/src/components/Gifs.astro b/src/components/Gifs.astro
new file mode 100644
index 0000000..b82230e
--- /dev/null
+++ b/src/components/Gifs.astro
@@ -0,0 +1,20 @@
+---
+import Picture from "astro/components/Picture.astro";
+import gifs from "@assets/gifs";
+---
+
+<div id="gifs">
+ {
+ gifs.map(({ image, alt }) => {
+ const img = <Picture src={image} alt={alt} formats={["gif"]} />;
+
+ if (image.src.includes("steam")) {
+ return <a href="https://dnsense.pub/">{img}</a>;
+ } else if (image.src.includes("poweredbynix")) {
+ return <a href="https://github.com/sakecode">{img}</a>;
+ } else {
+ return img;
+ }
+ })
+ }
+</div>
diff --git a/src/components/Head.astro b/src/components/Head.astro
deleted file mode 100644
index f05e862..0000000
--- a/src/components/Head.astro
+++ /dev/null
@@ -1,31 +0,0 @@
----
-import "@fontsource-variable/noto-sans";
-import "@fontsource/noto-sans-mono";
-const { title, description } = Astro.props;
----
-
-<head>
- <meta charset="UTF-8" />
- <title>{title}</title>
- <meta name="viewport" content="width=device-width,initial-scale=1" />
- <meta name="description" content={description} />
- <link rel="sitemap" href="/sitemap-index.xm" />
-</head>
-<style is:global>
- a {
- text-decoration: underline;
- @apply text-blue;
- }
-
- h1 {
- @apply text-3xl md:text-4xl;
- }
-
- h2 {
- @apply text-2xl md:text-3xl;
- }
-
- h3 {
- @apply text-xl md:text-2xl;
- }
-</style>
diff --git a/src/components/Nav.astro b/src/components/Nav.astro
deleted file mode 100644
index f427548..0000000
--- a/src/components/Nav.astro
+++ /dev/null
@@ -1,30 +0,0 @@
----
-import config from "@root/astro.config.ts";
-
-interface NavLink {
- name: string;
- url: string;
-}
-
-const minifluxUrl = process.env.MINIFLUX_URL || `https://miniflux.${Astro.url.hostname || config.site}`;
-
-const links: NavLink[] = [
- { name: "home", url: "/" },
- {
- name: "miniflux",
- url: minifluxUrl,
- },
- {
- name: "github",
- url: "https://github.com/getchoo",
- },
-];
----
-
-<nav class="space-y-5 text-xl my-5">
- <p class="space-x-2">
- {links.map(({ name, url }) => <a href={url}>{name}</a>)}
- </p>
-
- <hr />
-</nav>
diff --git a/src/components/NavBar.astro b/src/components/NavBar.astro
new file mode 100644
index 0000000..b7c0216
--- /dev/null
+++ b/src/components/NavBar.astro
@@ -0,0 +1,20 @@
+---
+interface NavLink {
+ name: string;
+ url: string;
+}
+
+const links: NavLink[] = [
+ { name: "home", url: "/" },
+ {
+ name: "github",
+ url: "https://github.com/getchoo",
+ },
+];
+---
+
+<div id="nav_links">
+ {links.map(({ name, url }) => <a href={url}>{name}</a>)}
+</div>
+
+<hr />