From df59907991a513512c1896b011bcfd08c9fd63a3 Mon Sep 17 00:00:00 2001 From: Hanna Bohlin Date: Thu, 19 Nov 2026 15:07:29 +0000 Subject: [PATCH 1/2] Implemented and tested basic functionality of the app --- Sprint-3/quote-generator/index.html | 2 +- Sprint-3/quote-generator/package.json | 2 +- Sprint-3/quote-generator/quotes.js | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index 30b434bcfb..5f6a720f12 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -3,7 +3,7 @@ - Title here + Quote generator app diff --git a/Sprint-3/quote-generator/package.json b/Sprint-3/quote-generator/package.json index 0f6f989174..00c9212370 100644 --- a/Sprint-3/quote-generator/package.json +++ b/Sprint-3/quote-generator/package.json @@ -14,4 +14,4 @@ "url": "https://github.com/CodeYourFuture/CYF-Coursework-Template/issues" }, "homepage": "https://github.com/CodeYourFuture/CYF-Coursework-Template#readme" -} +} \ No newline at end of file diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4a4d04b722..44cfe0481a 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 getRandomQuote() { + return pickFromArray(quotes); +} + +function displayQuote() { + const quoteEl = document.querySelector("#quote"); + const authorEl = document.querySelector("#author"); + const quoteObj = getRandomQuote(); + quoteEl.innerText = quoteObj.quote; + authorEl.innerText = quoteObj.author; +} + +displayQuote(); + +const buttonEl = document.querySelector("#new-quote"); + +buttonEl.addEventListener("click", displayQuote); From 2389eb803af7b206acf09a2945d78248a0057d2a Mon Sep 17 00:00:00 2001 From: Hanna Bohlin Date: Thu, 19 Nov 2026 15:15:21 +0000 Subject: [PATCH 2/2] Changed to a more descriptive h1 --- Sprint-3/quote-generator/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index 5f6a720f12..ba66359c15 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -7,7 +7,7 @@ -

hello there

+

Quote Generator