diff --git a/about.html b/about.html index 2007cf0..522bb87 100644 --- a/about.html +++ b/about.html @@ -302,5 +302,7 @@ + + \ No newline at end of file diff --git a/assets/js/about.js b/assets/js/about.js index c381b7a..44ba10e 100644 --- a/assets/js/about.js +++ b/assets/js/about.js @@ -137,35 +137,4 @@ document.addEventListener("DOMContentLoaded", function () { hamburger.classList.remove("active"); } }); - // ================= Dark Mode Toggle ================= - const darkModeBtn = document.getElementById("darkModeToggle"); - const darkModeIcon = darkModeBtn.querySelector("i"); - - // Apply saved preference on page load - if (localStorage.getItem("darkMode") === "enabled") { - document.body.classList.add("dark-mode"); - darkModeIcon.classList.remove("fa-moon"); - darkModeIcon.classList.add("fa-sun"); - } - - darkModeBtn.addEventListener("click", () => { - document.body.classList.toggle("dark-mode"); - - if (document.body.classList.contains("dark-mode")) { - localStorage.setItem("darkMode", "enabled"); - darkModeIcon.classList.remove("fa-moon"); - darkModeIcon.classList.add("fa-sun"); - } else { - localStorage.setItem("darkMode", "disabled"); - darkModeIcon.classList.remove("fa-sun"); - darkModeIcon.classList.add("fa-moon"); - } - }); -}); - - - - - - - +}); \ No newline at end of file diff --git a/assets/js/theme.js b/assets/js/theme.js new file mode 100644 index 0000000..377dc15 --- /dev/null +++ b/assets/js/theme.js @@ -0,0 +1,40 @@ +// Centralized Dark Mode Toggle Logic +document.addEventListener('DOMContentLoaded', () => { + const darkModeToggle = document.getElementById("darkModeToggle"); + if (!darkModeToggle) return; // Exit if the button isn't on the page + + const body = document.body; + const darkModeIcon = darkModeToggle.querySelector("i"); + + // Function to apply the theme based on localStorage + const applyTheme = () => { + const currentTheme = localStorage.getItem("theme") || "light"; + if (currentTheme === "dark") { + body.classList.add("dark-mode"); + if (darkModeIcon) { + darkModeIcon.classList.remove("fa-moon"); + darkModeIcon.classList.add("fa-sun"); + } + } else { + body.classList.remove("dark-mode"); + if (darkModeIcon) { + darkModeIcon.classList.remove("fa-sun"); + darkModeIcon.classList.add("fa-moon"); + } + } + }; + + // Event listener for the toggle button + darkModeToggle.addEventListener("click", () => { + body.classList.toggle("dark-mode"); + let theme = "light"; + if (body.classList.contains("dark-mode")) { + theme = "dark"; + } + localStorage.setItem("theme", theme); + applyTheme(); // Update icon state + }); + + // Apply the theme on initial page load + applyTheme(); +}); \ No newline at end of file diff --git a/contact.html b/contact.html index 1108217..28fc8c8 100644 --- a/contact.html +++ b/contact.html @@ -993,29 +993,10 @@ + + - - - - - - - -
-
🧁
-
🍰
-
πŸ₯§
-
πŸͺ
-
- - - - - -
- - -
- -
-
- - -
- -
- - -
- - -
- - -
-
-

🎯 Conversion Results

-
- - -
-
- - - - - - - - - - - - - -
IngredientOriginalGramsNotes
-
-
-
- - -
-
-

⚠️ Ambiguous Measurement

-

- -
- - - - - - - - - + + + + + + + + + Convert Recipe - BakeGenius.ai | AI-Powered Recipe Conversion Tool + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
🧁
+
🍰
+
πŸ₯§
+
πŸͺ
+
+ + + + + +
+ + +
+ +
+
+ + +
+ +
+ + +
+ + +
+ + +
+
+

🎯 Conversion Results

+
+ + +
+
+ + + + + + + + + + + + + +
IngredientOriginalGramsNotes
+
+
+
+ + +
+
+

⚠️ Ambiguous Measurement

+

+ +
+ + + + + + + + + \ No newline at end of file diff --git a/customize.html b/customize.html index 5177c67..4323a73 100644 --- a/customize.html +++ b/customize.html @@ -1567,35 +1567,9 @@ - + + +