From c3e9a4d6c1b2ef7529be5ccf49ea00453751bcb8 Mon Sep 17 00:00:00 2001 From: YakeDev Date: Sun, 13 Oct 2024 21:27:45 +0200 Subject: [PATCH 01/13] Correction bug Theme toggle --- adventures.html | 408 ++++++++++++++++++++++++++++++++++++++++++++++++ fs.html | 2 +- index.html | 4 +- rdpd.html | 5 +- script.js | 23 ++- 5 files changed, 424 insertions(+), 18 deletions(-) create mode 100644 adventures.html diff --git a/adventures.html b/adventures.html new file mode 100644 index 0000000..b501c8b --- /dev/null +++ b/adventures.html @@ -0,0 +1,408 @@ + + + + + + + + + + + My Favorite Books Music App + + + +
+ +
+ + + + + +
+ +
+
+
+ +
+ Pale Blue Dot +
+ +
+

+ Adventures of Sherlock Holmes +

+

By Sir Arthur Conan Doyle

+

+ Adventures of Sherlock Holmes by Sir Arthur Conan Doyle is a + collection of twelve detective mysteries featuring Sherlock + Holmes and Dr. Watson. +

+
+ +
+ + +
+ Save to Favourites + Share + + View comments +
+
+
+ +
+
+
    +
  • +

    Introduction

    + +
  • +
  • +

    Piste 01

    + +
  • +
  • +

    Piste 02

    + +
  • +
  • +

    Piste 03

    + +
  • +
  • +

    Piste 04

    + +
  • +
  • +

    Piste 05

    + +
  • +
  • +

    Piste 06

    + +
  • +
+ +
+
+ +
+ + +
+ + +
+
+
+
+ + +
+ +
+ Next Book +
+
+ + + +
+
+

+ Share Your Comments +

+
+
+ + +
+
+ + +
+
+ +
+
+ +
+
+
+
+ + + + + + + + + + diff --git a/fs.html b/fs.html index 81beba6..c2e6c80 100644 --- a/fs.html +++ b/fs.html @@ -406,7 +406,7 @@

By Mary Shelby

Next Book diff --git a/index.html b/index.html index 3c8b1cb..ba6896e 100644 --- a/index.html +++ b/index.html @@ -206,7 +206,7 @@

Top Audio Books

class="card-cover-container rounded-4 d-flex align-items-center border" > Audio book cover @@ -449,7 +449,7 @@

By Richard Dawkins

Next Book diff --git a/rdpd.html b/rdpd.html index bf948a7..a20b8e6 100644 --- a/rdpd.html +++ b/rdpd.html @@ -10,9 +10,12 @@ href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" /> + My Favorite Books Music App diff --git a/script.js b/script.js index 6554cc6..28a18a6 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"); @@ -238,6 +224,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 +239,9 @@ document.addEventListener("DOMContentLoaded", function () { localStorage.setItem("theme", newTheme); } + // Initialize theme on load + initializeTheme(); + if (themeToggle) { themeToggle.addEventListener("click", () => { console.log("clicker"); From 2726832ed7f069e2596eb3e423ecf4700ce063ef Mon Sep 17 00:00:00 2001 From: YakeDev Date: Sun, 13 Oct 2024 22:09:22 +0200 Subject: [PATCH 02/13] rdpd.html page UI update corrected light/dark mode --- about.html | 14 +- fs.html | 2 +- pbd.html | 8 +- rdpd.html | 468 ++++++++++++++++++++++++++++++----------------------- script.js | 24 +-- test.html | 9 +- 6 files changed, 303 insertions(+), 222 deletions(-) diff --git a/about.html b/about.html index d6b0d73..74264c2 100644 --- a/about.html +++ b/about.html @@ -15,11 +15,10 @@ integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous" /> + My Favorite Books Music App - - - +