From 7ed44a8756e40ec67e1a55a6b37e94f8382bead6 Mon Sep 17 00:00:00 2001 From: Shuheda Date: Sat, 14 Mar 2026 16:38:48 +0000 Subject: [PATCH 1/6] Create PR --- Sprint-3/quote-generator/quotes.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4a4d04b72..4ca534882 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -1,3 +1,6 @@ +//CREATE PR + + // DO NOT EDIT BELOW HERE // pickFromArray is a function which will return one item, at From 8c31ef9736358f48a621bedcc6b6425d5b7eef53 Mon Sep 17 00:00:00 2001 From: Shuheda Date: Sat, 28 Mar 2026 01:03:59 +0000 Subject: [PATCH 2/6] testing --- Sprint-3/quote-generator/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index 30b434bcf..8e00b17e6 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -13,3 +13,4 @@

hello there

+testing \ No newline at end of file From c28e8d3774ad2d4a762fc46eee0cbc6e7a3819e1 Mon Sep 17 00:00:00 2001 From: Shuheda Date: Sat, 28 Mar 2026 01:08:46 +0000 Subject: [PATCH 3/6] index.html completed --- Sprint-3/quote-generator/index.html | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index 8e00b17e6..3c9f125b3 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -1,16 +1,21 @@ - + - Title here + Quote Generator App -

hello there

+

Quote Generator

+
+ +

auto-play: OFF

+
-testing \ No newline at end of file From f6b634c069b2e917ee6f6bb73e61e12d64348258 Mon Sep 17 00:00:00 2001 From: Shuheda Date: Sat, 28 Mar 2026 01:11:35 +0000 Subject: [PATCH 4/6] quotes.js completed --- Sprint-3/quote-generator/quotes.js | 42 ++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4ca534882..f0c4685b4 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -494,3 +494,45 @@ const quotes = [ ]; // call pickFromArray with the quotes array to check you get a random quote +// Select the elements from the html +const quoteDisplay = document.getElementById("quote"); +const authorDisplay = document.getElementById("author"); +const newQuoteButton = document.getElementById("new-quote"); + +// Create a function to update the content on the screen +function updateQuote() { + // Use the provided pickFromArray function + const randomQuoteObject = pickFromArray(quotes); + // Access the 'quote' property from the object and, + // inject it into the HTML element + quoteDisplay.innerText = randomQuoteObject.quote; + // Access the 'author' property and use a template literal, + // to add a dash for styling + authorDisplay.innerText = `- ${randomQuoteObject.author}`; +} + +// Add event listener to the button +newQuoteButton.addEventListener("click", updateQuote); +// Show a random quote immediately when the page loads +updateQuote(); + +// Get the new elements from the DOM +const autoplayToggle = document.getElementById("autoplay-toggle"); +const autoplayStatus = document.getElementById("autoplay-status"); + +// Track timer +let timerId = null; + +// Event listener to the checkbox +autoplayToggle.addEventListener("change", () => { + if (autoplayToggle.checked) { + // Switch is ON + autoplayStatus.innerText = "auto-play: ON"; + timerId = setInterval(updateQuote, 5000); + } else { + // Switch is OFF + autoplayStatus.innerText = "auto-play: OFF"; + // Stop the timer + clearInterval(timerId); + } +}); \ No newline at end of file From 67f947b6b6f830416e9c57256c744282fb70780f Mon Sep 17 00:00:00 2001 From: Shuheda Date: Fri, 10 Apr 2026 22:53:04 +0100 Subject: [PATCH 5/6] time until the quote switches changed to 60s --- Sprint-3/quote-generator/quotes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index f0c4685b4..fe6012388 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -528,7 +528,7 @@ autoplayToggle.addEventListener("change", () => { if (autoplayToggle.checked) { // Switch is ON autoplayStatus.innerText = "auto-play: ON"; - timerId = setInterval(updateQuote, 5000); + timerId = setInterval(updateQuote, 60000); } else { // Switch is OFF autoplayStatus.innerText = "auto-play: OFF"; From 569ff3c63fd7d4a9b95563d58d03b8b09d372b5a Mon Sep 17 00:00:00 2001 From: Shuheda Date: Sat, 11 Apr 2026 11:51:31 +0100 Subject: [PATCH 6/6] removed CREATE PR note --- Sprint-3/quote-generator/quotes.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index fe6012388..043296b73 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -1,6 +1,3 @@ -//CREATE PR - - // DO NOT EDIT BELOW HERE // pickFromArray is a function which will return one item, at