From b79d1b695eee0b8900a6f1f111ac83537eb42772 Mon Sep 17 00:00:00 2001 From: Ogbemi mene Date: Wed, 29 Jul 2026 09:48:15 +0100 Subject: [PATCH 1/3] commit for quote app --- .../{index.html => quote-generator-app.html} | 0 Sprint-3/quote-generator/quotes.js | 17 +++++++++++++++++ 2 files changed, 17 insertions(+) rename Sprint-3/quote-generator/{index.html => quote-generator-app.html} (100%) diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/quote-generator-app.html similarity index 100% rename from Sprint-3/quote-generator/index.html rename to Sprint-3/quote-generator/quote-generator-app.html diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4a4d04b72..68cfdd052 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -491,3 +491,20 @@ const quotes = [ ]; // call pickFromArray with the quotes array to check you get a random quote +function displayRandomQuote() { + const quoteP = document.getElementById("quote"); + const authorP = document.getElementById("author"); + + const selectedQuote = pickFromArray(quotes); + + quoteP.textContent = selectedQuote.quote; + authorP.textContent = selectedQuote.author; +} + +// Setup event listener and display initial quote on load +window.addEventListener("DOMContentLoaded", () => { + displayRandomQuote(); + + const newQuoteBtn = document.getElementById("new-quote"); + newQuoteBtn.addEventListener("click", displayRandomQuote); +}); \ No newline at end of file From 6aade2fab8b7f28c5e73dfd22b1b68df293749d6 Mon Sep 17 00:00:00 2001 From: Ogbemi mene Date: Mon, 3 Aug 2026 08:40:09 +0100 Subject: [PATCH 2/3] change to put my function above the instruction --- Sprint-3/quote-generator/quotes.js | 38 +++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 68cfdd052..c5f169195 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -1,3 +1,22 @@ +// call pickFromArray with the quotes array to check you get a random quote +function displayRandomQuote() { + const quoteP = document.getElementById("quote"); + const authorP = document.getElementById("author"); + + const selectedQuote = pickFromArray(quotes); + + quoteP.textContent = selectedQuote.quote; + authorP.textContent = selectedQuote.author; +} + +// Setup event listener and display initial quote on load +window.addEventListener("DOMContentLoaded", () => { + displayRandomQuote(); + + const newQuoteBtn = document.getElementById("new-quote"); + newQuoteBtn.addEventListener("click", displayRandomQuote); +}); + // DO NOT EDIT BELOW HERE // pickFromArray is a function which will return one item, at @@ -489,22 +508,3 @@ const quotes = [ author: "Zig Ziglar", }, ]; - -// call pickFromArray with the quotes array to check you get a random quote -function displayRandomQuote() { - const quoteP = document.getElementById("quote"); - const authorP = document.getElementById("author"); - - const selectedQuote = pickFromArray(quotes); - - quoteP.textContent = selectedQuote.quote; - authorP.textContent = selectedQuote.author; -} - -// Setup event listener and display initial quote on load -window.addEventListener("DOMContentLoaded", () => { - displayRandomQuote(); - - const newQuoteBtn = document.getElementById("new-quote"); - newQuoteBtn.addEventListener("click", displayRandomQuote); -}); \ No newline at end of file From 1a1e70f70ed8a2e9fe9c734c0945a739c77af62d Mon Sep 17 00:00:00 2001 From: Ogbemi mene Date: Mon, 3 Aug 2026 08:40:53 +0100 Subject: [PATCH 3/3] i made the right to this file --- .../quote-generator/{quote-generator-app.html => index.html} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Sprint-3/quote-generator/{quote-generator-app.html => index.html} (90%) diff --git a/Sprint-3/quote-generator/quote-generator-app.html b/Sprint-3/quote-generator/index.html similarity index 90% rename from Sprint-3/quote-generator/quote-generator-app.html rename to Sprint-3/quote-generator/index.html index 30b434bcf..5f6a720f1 100644 --- a/Sprint-3/quote-generator/quote-generator-app.html +++ b/Sprint-3/quote-generator/index.html @@ -3,7 +3,7 @@ - Title here + Quote generator app