From c8b22c2c985b5705c414950c62c20caf596d5936 Mon Sep 17 00:00:00 2001 From: Preeti Tyagi <68293926+preeti-t@users.noreply.github.com> Date: Wed, 10 Dec 2025 10:32:17 +0100 Subject: [PATCH 1/2] Update script.js changes added --- Sprint-3/reading-list/script.js | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/Sprint-3/reading-list/script.js b/Sprint-3/reading-list/script.js index 6024d73a0..ff3fa739b 100644 --- a/Sprint-3/reading-list/script.js +++ b/Sprint-3/reading-list/script.js @@ -21,3 +21,38 @@ const books = [ }, ]; +const readingList = document.getElementById("reading-list"); + +books.forEach((book) => { + const listItem = document.createElement("li"); + listItem.style.listStyleType = "none"; + listItem.style.backgroundColor = book.alreadyRead ? "green" : "tomato"; + listItem.style.margin = "0 0 12px"; + listItem.style.padding = "12px"; + listItem.style.display = "flex"; + listItem.style.alignItems = "center"; + listItem.style.gap = "12px"; + listItem.style.borderRadius = "6px"; + + const img = document.createElement("img"); + img.src = book.bookCoverImage; + img.alt = `${book.title} cover`; + img.style.height = "90px"; + + const title = document.createElement("p"); + title.textContent = book.title; + title.style.fontWeight = "bold"; + title.style.margin = "0 0 4px"; + + const author = document.createElement("p"); + author.textContent = `by ${book.author}`; + author.style.margin = "0"; + + const textContainer = document.createElement("div"); + textContainer.appendChild(title); + textContainer.appendChild(author); + + listItem.appendChild(img); + listItem.appendChild(textContainer); + readingList.appendChild(listItem); +}); From bf6d382337d9b0f77e567b7a35781e6df985db50 Mon Sep 17 00:00:00 2001 From: Preeti Tyagi <68293926+preeti-t@users.noreply.github.com> Date: Wed, 10 Dec 2025 10:33:41 +0100 Subject: [PATCH 2/2] Update index.html made minor changes --- Sprint-3/reading-list/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-3/reading-list/index.html b/Sprint-3/reading-list/index.html index dbdb0f471..88102fc1f 100644 --- a/Sprint-3/reading-list/index.html +++ b/Sprint-3/reading-list/index.html @@ -4,7 +4,7 @@ -