From 2e93716be1b42046c1cd01555ad3b151f42cf632 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Mon, 30 Mar 2026 22:44:41 +0100 Subject: [PATCH 01/14] sorted out the head element --- Sprint-3/quote-generator/index.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index 30b434bcf..4b8da3d6e 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -1,10 +1,11 @@ - + - Title here + Quote generator app +

hello there

From 9426b5696b26cbc777725a9fce6f4372272b643c Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Tue, 31 Mar 2026 07:57:39 +0100 Subject: [PATCH 02/14] adjusting the html title --- 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 4b8da3d6e..ac8f003af 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -8,7 +8,7 @@ -

hello there

+

Welcome to the Quote Generator

From ca51b1eb0117b562b5572e7a5ebbe02ad90baf69 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Tue, 31 Mar 2026 09:03:00 +0100 Subject: [PATCH 03/14] implement the main function --- Sprint-3/quote-generator/quotes.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4a4d04b72..6e9cf37fd 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -20,6 +20,12 @@ function pickFromArray(choices) { return choices[Math.floor(Math.random() * choices.length)]; } +function main() { + document.querySelector("#quote").innerText = pickFromArray(quotes).quote; + document.querySelector("#author").innerText = pickFromArray(quotes).author; +} + +document.getElementById("new-quote").addEventListener("click", main); // A list of quotes you can use in your app. // DO NOT modify this array, otherwise the tests may break! const quotes = [ From 99a7aa28038579dfe15677d96f5c7f7d8c5de464 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Tue, 14 Apr 2026 08:01:10 +0100 Subject: [PATCH 04/14] creating elements --- Sprint-3/quote-generator/index.html | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index ac8f003af..4110ae64c 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -7,10 +7,14 @@ - +

Welcome to the Quote Generator

-

-

- +
+

+

+
+ +
+
From 3b6fe775c09ea8a4c7fea1bb533ed2d181a2bd07 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Wed, 15 Apr 2026 01:37:06 +0100 Subject: [PATCH 05/14] opleting the quote generator project. --- Sprint-3/quote-generator/index.html | 1 - Sprint-3/quote-generator/quotes.js | 13 +++++---- Sprint-3/quote-generator/style.css | 44 ++++++++++++++++++++++++++++- 3 files changed, 50 insertions(+), 8 deletions(-) diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index 4110ae64c..765d1ce2e 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -8,7 +8,6 @@ -

Welcome to the Quote Generator

diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 6e9cf37fd..a1bc07641 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -1,3 +1,10 @@ +function main() { + document.querySelector("#quote").innerText = pickFromArray(quotes).quote; + document.querySelector("#author").innerText = pickFromArray(quotes).author; +} + +document.getElementById("new-quote").addEventListener("click", main); + // DO NOT EDIT BELOW HERE // pickFromArray is a function which will return one item, at @@ -20,12 +27,6 @@ function pickFromArray(choices) { return choices[Math.floor(Math.random() * choices.length)]; } -function main() { - document.querySelector("#quote").innerText = pickFromArray(quotes).quote; - document.querySelector("#author").innerText = pickFromArray(quotes).author; -} - -document.getElementById("new-quote").addEventListener("click", main); // A list of quotes you can use in your app. // DO NOT modify this array, otherwise the tests may break! const quotes = [ diff --git a/Sprint-3/quote-generator/style.css b/Sprint-3/quote-generator/style.css index 63cedf2d2..2da4a63b9 100644 --- a/Sprint-3/quote-generator/style.css +++ b/Sprint-3/quote-generator/style.css @@ -1 +1,43 @@ -/** Write your CSS in here **/ +body { + background-color: orange; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; +} +.container { + background-color: white; + width: 60%; + padding: 50px 50px; +} +#quote { + text-align: center; + color: orange; + font-size: 28px; +} +#quote::before { + content: open-quote; +} +#quote::after { + content: close-quote; +} +#author { + color: orange; + text-align: right; + font-size: 20px; +} +#author::before { + content: "- "; +} +#new-quote { + display: flex; + justify-content: end; +} +button { + background-color: orange; + color: white; + border: none; + font-size: 18px; + padding: 15px; + cursor: pointer; +} From 0f8bf9650da83045e846f241e1b98d118e1ad8fd Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Thu, 16 Apr 2026 10:30:57 +0100 Subject: [PATCH 06/14] fixed the function to make the author match the quote --- Sprint-3/quote-generator/quotes.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index a1bc07641..01df36761 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -1,6 +1,7 @@ function main() { - document.querySelector("#quote").innerText = pickFromArray(quotes).quote; - document.querySelector("#author").innerText = pickFromArray(quotes).author; + const randomQuote = pickFromArray(quotes); + document.querySelector("#quote").innerText = randomQuote.quote; + document.querySelector("#author").innerText = randomQuote.author; } document.getElementById("new-quote").addEventListener("click", main); From db450697ab4c968c1a25124fbeaa61c44411a0fc Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Thu, 16 Apr 2026 10:47:28 +0100 Subject: [PATCH 07/14] rename main to setup --- Sprint-3/quote-generator/index.html | 2 +- Sprint-3/quote-generator/quotes.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index 765d1ce2e..092b739e9 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -7,7 +7,7 @@ - +

diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 01df36761..4cbbce4fe 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -1,10 +1,10 @@ -function main() { +function setup() { const randomQuote = pickFromArray(quotes); document.querySelector("#quote").innerText = randomQuote.quote; document.querySelector("#author").innerText = randomQuote.author; } -document.getElementById("new-quote").addEventListener("click", main); +document.getElementById("new-quote").addEventListener("click", setup); // DO NOT EDIT BELOW HERE From e8f54ad3eca2c708a079e18fb3d39ca2d674f65d Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Thu, 16 Apr 2026 11:01:05 +0100 Subject: [PATCH 08/14] placing all the run on load code inside the setup function --- Sprint-3/quote-generator/index.html | 2 +- Sprint-3/quote-generator/quotes.js | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index 092b739e9..eb93effc3 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -7,7 +7,7 @@ - +

diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4cbbce4fe..b994e95c8 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -2,10 +2,9 @@ function setup() { const randomQuote = pickFromArray(quotes); document.querySelector("#quote").innerText = randomQuote.quote; document.querySelector("#author").innerText = randomQuote.author; + document.getElementById("new-quote").addEventListener("click", setup); } - -document.getElementById("new-quote").addEventListener("click", setup); - +window.onload = setup; // DO NOT EDIT BELOW HERE // pickFromArray is a function which will return one item, at From b22db66166676b71199a0d67b560428055f8428e Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Thu, 16 Apr 2026 11:05:29 +0100 Subject: [PATCH 09/14] separated JS code from HTML and used addEventListener() --- 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 b994e95c8..6bbb5fa6b 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -4,7 +4,7 @@ function setup() { document.querySelector("#author").innerText = randomQuote.author; document.getElementById("new-quote").addEventListener("click", setup); } -window.onload = setup; +window.addEventListener("load", setup); // DO NOT EDIT BELOW HERE // pickFromArray is a function which will return one item, at From 35b34f7879b2e79daff2dda7f03ae65c86180bf6 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Thu, 16 Apr 2026 17:09:33 +0100 Subject: [PATCH 10/14] take the event listener out of the setup function --- 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 6bbb5fa6b..4cdc3b268 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -2,8 +2,8 @@ function setup() { const randomQuote = pickFromArray(quotes); document.querySelector("#quote").innerText = randomQuote.quote; document.querySelector("#author").innerText = randomQuote.author; - document.getElementById("new-quote").addEventListener("click", setup); } +document.getElementById("new-quote").addEventListener("click", setup); window.addEventListener("load", setup); // DO NOT EDIT BELOW HERE From 570dca59b672aa96b66b4971c4e43d819feb2c00 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Thu, 16 Apr 2026 17:21:36 +0100 Subject: [PATCH 11/14] putting the click event listener inside a separate function for better readability, maintenance and future scalability. --- Sprint-3/quote-generator/quotes.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4cdc3b268..45ee4b64c 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -3,7 +3,9 @@ function setup() { document.querySelector("#quote").innerText = randomQuote.quote; document.querySelector("#author").innerText = randomQuote.author; } -document.getElementById("new-quote").addEventListener("click", setup); +function newQuote() { + document.getElementById("new-quote").addEventListener("click", setup); +} window.addEventListener("load", setup); // DO NOT EDIT BELOW HERE From fb9b86503834ffd5738d708f0c599e957e9af634 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Thu, 16 Apr 2026 17:38:24 +0100 Subject: [PATCH 12/14] calling the newQuote function Please enter the commit message for your changes. Lines starting --- Sprint-3/quote-generator/quotes.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 45ee4b64c..bd4025bb2 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -6,6 +6,7 @@ function setup() { function newQuote() { document.getElementById("new-quote").addEventListener("click", setup); } +newQuote(); window.addEventListener("load", setup); // DO NOT EDIT BELOW HERE From 2d49b112c4274c992254502ed16c487485cb7368 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Thu, 16 Apr 2026 23:30:00 +0100 Subject: [PATCH 13/14] renamed functions to be more descriptive. --- Sprint-3/quote-generator/quotes.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index bd4025bb2..4203f4ef6 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -1,13 +1,13 @@ -function setup() { +function randomQuote() { const randomQuote = pickFromArray(quotes); document.querySelector("#quote").innerText = randomQuote.quote; document.querySelector("#author").innerText = randomQuote.author; } -function newQuote() { - document.getElementById("new-quote").addEventListener("click", setup); +function setup() { + document.getElementById("new-quote").addEventListener("click", randomQuote); } -newQuote(); -window.addEventListener("load", setup); +setup(); +window.addEventListener("load", randomQuote); // DO NOT EDIT BELOW HERE // pickFromArray is a function which will return one item, at From 69eab09a18c528aefa31dad712e7dfc3c6b89a0d Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Fri, 17 Apr 2026 16:37:54 +0100 Subject: [PATCH 14/14] ade the setup function to perform the operations when the page loads. --- Sprint-3/quote-generator/quotes.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4203f4ef6..01d9ffa24 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -5,9 +5,9 @@ function randomQuote() { } function setup() { document.getElementById("new-quote").addEventListener("click", randomQuote); + randomQuote(); } -setup(); -window.addEventListener("load", randomQuote); +window.addEventListener("load", setup); // DO NOT EDIT BELOW HERE // pickFromArray is a function which will return one item, at