- Backed by
-
-
-
- Programming and Doodles™
- All rights reserved.
+
+
+ Dev Encyclopedia;
+
+
+ Find out what that Sr. Developer is talking about.
+
+
+
@@ -72,29 +58,16 @@ let sortedCategories = Array.from(categories).sort((a, b) => a.localeCompare(b))
>
Contribute
-
-
-
-
-
+
diff --git a/src/components/ModeToggleButton.astro b/src/components/ModeToggleButton.astro
new file mode 100644
index 00000000..1292e9d9
--- /dev/null
+++ b/src/components/ModeToggleButton.astro
@@ -0,0 +1,7 @@
+---
+
+---
+
+
diff --git a/src/components/ModeToggleButton.test.ts b/src/components/ModeToggleButton.test.ts
new file mode 100644
index 00000000..6326a235
--- /dev/null
+++ b/src/components/ModeToggleButton.test.ts
@@ -0,0 +1,21 @@
+import { experimental_AstroContainer as AstroContainer } from "astro/container"
+import { expect, test, describe, beforeEach } from "vitest"
+import ModeToggleButton from "./ModeToggleButton.astro"
+
+describe("Mode toggle button", () => {
+ let container: AstroContainer
+
+ beforeEach(async () => {
+ // instantiate astro container api
+ container = await AstroContainer.create()
+ })
+
+ test("component is rendered correctly", async () => {
+ // render component
+ const result = await container.renderToString(ModeToggleButton)
+
+ // Insert test assertion
+ expect(result).toContain('class="button toggle-button"')
+ expect(result).toContain('class="fas fa-moon"')
+ })
+})
\ No newline at end of file
diff --git a/src/pages/index.astro b/src/pages/index.astro
index ec5f33da..f1efdca3 100644
--- a/src/pages/index.astro
+++ b/src/pages/index.astro
@@ -6,6 +6,7 @@ import Hero from "../components/Hero.astro"
import CardList from "../components/CardList.astro"
import Modal from "../components/Modal.astro"
import Head from "../components/Head.astro"
+import Footer from "../components/Footer.astro"
import { getCollection } from "astro:content"
@@ -40,9 +41,12 @@ const terms = await getCollection("terms")
-
-
-
+
+
+
+
+
+
diff --git a/src/scripts/hero-action.ts b/src/scripts/hero-action.ts
index 7e7ef27c..e9881166 100644
--- a/src/scripts/hero-action.ts
+++ b/src/scripts/hero-action.ts
@@ -199,8 +199,8 @@ document
document
.getElementById("darkModeToggle")!
.addEventListener("click", toggleDarkMode)
-const darkModeHTML = `
Light Mode`
-const lightModeHTML = `
Dark Mode`
+const darkModeHTML = `
`
+const lightModeHTML = `
`
setTheme()
diff --git a/src/styles/global.css b/src/styles/global.css
index 618ae2c6..c7dca4ad 100644
--- a/src/styles/global.css
+++ b/src/styles/global.css
@@ -466,6 +466,27 @@ body.dark-mode select option {
appearance: none !important;
}
+.toggle-button {
+ position: fixed;
+ top: 20px;
+ right: 20px;
+ z-index: 1000;
+ border-radius: 100%;
+ width: 40px;
+ height: 40px;
+ align-items: center;
+ padding: 0;
+}
+
+.toggle-button i {
+ font-size: 1rem;
+ width: 100%;
+ height: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
.navigation-button {
display: flex;
align-items: center;