From 6b8de4defacd6e0cffa6b169ccc99e6cf45a0172 Mon Sep 17 00:00:00 2001 From: Logic Kenzie Date: Tue, 26 Sep 2023 08:14:52 -0500 Subject: [PATCH] Add Magic 8 Ball, add Status Sorting --- .gitmodules | 3 +++ src/pages/8ball | 1 + src/pages/projects.astro | 13 +++++++++++++ src/pages/projects/8ball.md | 8 +++++--- 4 files changed, 22 insertions(+), 3 deletions(-) create mode 160000 src/pages/8ball diff --git a/.gitmodules b/.gitmodules index 91a04ea..b45134a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "src/pages/rockpaperscissors"] path = src/pages/rockpaperscissors url = https://git.ixvd.net/logically.cc/rockpaperscissors +[submodule "src/pages/8ball"] + path = src/pages/8ball + url = https://git.ixvd.net/logically.cc/8ball diff --git a/src/pages/8ball b/src/pages/8ball new file mode 160000 index 0000000..c14fb12 --- /dev/null +++ b/src/pages/8ball @@ -0,0 +1 @@ +Subproject commit c14fb12607739f0acd33e932e8445b895dd95b1a diff --git a/src/pages/projects.astro b/src/pages/projects.astro index 04ce8fe..c70c364 100644 --- a/src/pages/projects.astro +++ b/src/pages/projects.astro @@ -2,7 +2,20 @@ import Layout from "layouts/primary.astro" import ProjectDisplay from "components/projectdisplay.astro"; const projects = await Astro.glob('../pages/projects/*.md'); + +projects.sort((a, b) => { + const statusA = a.frontmatter.status; + const statusB = b.frontmatter.status; + if (statusA !== statusB) { + return statusA.localeCompare(statusB); + } else { + const titleA = a.frontmatter.title; + const titleB = b.frontmatter.title; + return titleA.localeCompare(titleB); + } +}); --- + diff --git a/src/pages/projects/8ball.md b/src/pages/projects/8ball.md index 0c7fafe..180e5ed 100644 --- a/src/pages/projects/8ball.md +++ b/src/pages/projects/8ball.md @@ -1,7 +1,7 @@ --- title: Magic 8 Ball category: Fun -status: Planned +status: Online source: https://git.ixvd.net/logically.cc/8ball layout: ../../layouts/primary.astro --- @@ -11,5 +11,7 @@ layout: ../../layouts/primary.astro ## Planned Features - Random Responses - "Adult" Mode (Responses with cursing) -- Speak aloud -- Detect device shaking instead of requiring button press \ No newline at end of file + +*Version 1.0.0* + +[Open App](/8ball) \ No newline at end of file