+
+ -
+
Introduction: God Delusion
+
+
+ -
+
Piste 02
+
+
+ -
+
Piste 03
+
+
+ -
+
Piste 04
+
+
+ -
+
Piste 05
+
+
+ -
+
Piste 06
+
+
+ -
+
Piste 07
+
+
+
+
+
@@ -339,8 +382,15 @@
Share Your Thoughts
-
-
-
+
+
+
+
+
+
diff --git a/script.js b/script.js
index 6554cc6..23f0c65 100644
--- a/script.js
+++ b/script.js
@@ -15,20 +15,6 @@ document.addEventListener("DOMContentLoaded", function () {
let allBooksList = [];
let currentBook;
- fetch("/data/books.json")
- .then((response) => response.json())
- .then((response) => {
- allBooksList = response;
- response.forEach((book) => {
- if (book.id == currentBookId) {
- currentBook = book;
- } else {
- renderBookItem(book, bookList);
- }
- });
- loadFavourites();
- });
-
// Function to display error popup
function showErrorPopup(message) {
const overlay = document.createElement("div");
@@ -155,16 +141,20 @@ document.addEventListener("DOMContentLoaded", function () {
return activate;
}
- favouriteButton.addEventListener("click", () => {
- const activated = toggleHeart();
- markFavourite(currentBookId);
- if (activated) {
- document.getElementById("fav-empty-container").classList.add("invisible");
- renderBookItem(currentBook, favBooksList);
- } else {
- loadFavourites();
- }
- });
+ if (favouriteButton) {
+ favouriteButton.addEventListener("click", () => {
+ const activated = toggleHeart();
+ markFavourite(currentBookId);
+ if (activated) {
+ document
+ .getElementById("fav-empty-container")
+ .classList.add("invisible");
+ renderBookItem(currentBook, favBooksList);
+ } else {
+ loadFavourites();
+ }
+ });
+ }
//Keyboard Shortcuts buttons
document.addEventListener("keydown", function (e) {
@@ -238,6 +228,12 @@ document.addEventListener("DOMContentLoaded", function () {
// Theme Toggle
const body = document.body;
+ function initializeTheme() {
+ const currentTheme = localStorage.getItem("theme") || "dark";
+ body.classList.toggle("dark-theme", currentTheme === "dark");
+ body.classList.toggle("light-theme", currentTheme === "light");
+ }
+
function toggleTheme() {
body.classList.toggle("dark-theme");
body.classList.toggle("light-theme");
@@ -247,6 +243,9 @@ document.addEventListener("DOMContentLoaded", function () {
localStorage.setItem("theme", newTheme);
}
+ // Initialize theme on load
+ initializeTheme();
+
if (themeToggle) {
themeToggle.addEventListener("click", () => {
console.log("clicker");
@@ -262,30 +261,28 @@ document.addEventListener("DOMContentLoaded", function () {
});
}
- if (menuClose) {
- menuClose.addEventListener("click", () => {
- menu.classList.add("scale-0");
- menu.classList.remove("scale-100");
- });
+ menuClose.addEventListener("click", () => {
+ menu.classList.add("scale-0");
+ menu.classList.remove("scale-100");
+ });
+
+ // Function to load an HTML file into an element
+ function loadHTML(file, elementId) {
+ fetch(file)
+ .then((response) => {
+ if (!response.ok)
+ throw new Error("Erreur lors du chargement du fichier " + file);
+ return response.text();
+ })
+ .then((data) => {
+ document.getElementById(elementId).innerHTML = data;
+ })
+ .catch((error) => console.error(error));
}
-});
-// Function to load an HTML file into an element
-function loadHTML(file, elementId) {
- fetch(file)
- .then((response) => {
- if (!response.ok)
- throw new Error("Erreur lors du chargement du fichier " + file);
- return response.text();
- })
- .then((data) => {
- document.getElementById(elementId).innerHTML = data;
- })
- .catch((error) => console.error(error));
-}
-
-// Load header and footer
-document.addEventListener("DOMContentLoaded", function () {
- // loadHTML("./pages/header.html", "header-placeholder");
- loadHTML("./pages/footer.html", "footer-placeholder");
+ // Load header and footer
+ document.addEventListener("DOMContentLoaded", function () {
+ loadHTML("./pages/header.html", "header-placeholder");
+ loadHTML("./pages/footer.html", "footer-placeholder");
+ });
});
diff --git a/style.css b/style.css
index 44e6c95..7116f38 100644
--- a/style.css
+++ b/style.css
@@ -2,8 +2,8 @@
--shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* Customize your shadow here */
--transition-transform: transform 0.6s ease-in-out 0.1s;
--transition-background: background-color 0.6s ease-in-out 0.1s;
- --accent-color: #1ed760;
- --accent-background-color: #1ed760;
+ --accent-color: #94d769;
+ --accent-background-color: #94d769;
}
* {
@@ -53,6 +53,10 @@ a {
text-decoration: none !important;
}
+a.logo-text {
+ color: var(--accent-color);
+}
+
h1,
h2,
h3 {
@@ -98,15 +102,23 @@ button:hover {
background-color: var(--accent-background-color) !important;
}
-footer {
- background-color: #191414;
- color: #b3b3b3;
+footer.light-theme {
+ background-color: inherit;
+ color: #181818;
+}
+footer.dark-theme {
+ background-color: inherit;
+ color: #f6f6f6;
}
footer a:hover {
color: var(--accent-color);
}
+.footer-col-title {
+ color: var(--accent-color) !important;
+}
+
/* About page */
body.dark-theme section {
width: 100%;
@@ -246,7 +258,7 @@ body.light-theme .playlist-card {
}
.play-pause-button:hover {
- background-color: #1ed760;
+ background-color: var(--accent-background-color);
}
.tooltip-parent {
diff --git a/test.html b/test.html
index d87e67a..5c39d2c 100644
--- a/test.html
+++ b/test.html
@@ -17,22 +17,24 @@
/>
My Favorite Books Music App
-
+
-