From cc721c63344e7a026a1fb2ab1b312e99023afcda Mon Sep 17 00:00:00 2001 From: Shirin Panahian Date: Fri, 20 Nov 2026 21:30:21 +0000 Subject: [PATCH 1/3] implement random quote generator --- Sprint-3/quote-generator/index.html | 4 ++-- Sprint-3/quote-generator/quotes.js | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index 30b434bcfb..befe8788e2 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -1,9 +1,9 @@ - + - Title here + Quote generator app diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4a4d04b722..90bb168af6 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -490,4 +490,14 @@ const quotes = [ }, ]; +const button = document.querySelector("button"); +function showQuote() { + const result = pickFromArray(quotes); + const author = document.querySelector("#author"); + const quote = document.querySelector("#quote"); + quote.textContent = result.quote; + author.textContent = result.author; +} +button.addEventListener("click", showQuote); + // call pickFromArray with the quotes array to check you get a random quote From 0ae49226853cb7e1385831e6cf19f896a78406b1 Mon Sep 17 00:00:00 2001 From: Shirin Panahian Date: Fri, 20 Nov 2026 22:35:28 +0000 Subject: [PATCH 2/3] style: improve quote generator UI --- Sprint-3/quote-generator/index.html | 10 +++++---- Sprint-3/quote-generator/quotes.js | 2 +- Sprint-3/quote-generator/style.css | 34 +++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index befe8788e2..0fc2dd7de8 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -4,12 +4,14 @@ Quote generator app + -

hello there

-

-

- +
+

+

+ +
diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 90bb168af6..445d974dd3 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -496,7 +496,7 @@ function showQuote() { const author = document.querySelector("#author"); const quote = document.querySelector("#quote"); quote.textContent = result.quote; - author.textContent = result.author; + author.textContent = ` - ${result.author}`; } button.addEventListener("click", showQuote); diff --git a/Sprint-3/quote-generator/style.css b/Sprint-3/quote-generator/style.css index 63cedf2d2f..21c180a96c 100644 --- a/Sprint-3/quote-generator/style.css +++ b/Sprint-3/quote-generator/style.css @@ -1 +1,35 @@ /** Write your CSS in here **/ + +body { + font-family: "Poppins", sans-serif; + background-color: #fcc054; + display: flex; + justify-content: center; + align-items: center; + min-height: 100vh; +} +button { + background-color: #fca800; + align-self: flex-end; + padding: 10px; + border: 0; + color: white; + font-weight: bold; +} +.quote-card { + background-color: #fcfcfc; + border-radius: 5px; + padding: 30px; + display: flex; + flex-direction: column; + width: 600px; + min-height: 200px; +} +#quote { + font-family: "Playfair Display", serif; + font-size: 28px; + color: #333333; +} +#author { + align-self: flex-end; +} From 3dd94bad260f9ebc5789bb3b132d4c24c996d7e8 Mon Sep 17 00:00:00 2001 From: Shirin Panahian Date: Fri, 20 Nov 2026 22:52:36 +0000 Subject: [PATCH 3/3] fix the size problem --- Sprint-3/quote-generator/style.css | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Sprint-3/quote-generator/style.css b/Sprint-3/quote-generator/style.css index 21c180a96c..9b60a3c25a 100644 --- a/Sprint-3/quote-generator/style.css +++ b/Sprint-3/quote-generator/style.css @@ -1,5 +1,9 @@ /** Write your CSS in here **/ +* { + box-sizing: border-box; +} + body { font-family: "Poppins", sans-serif; background-color: #fcc054; @@ -7,7 +11,10 @@ body { justify-content: center; align-items: center; min-height: 100vh; + margin: 0; + padding: 20px; } + button { background-color: #fca800; align-self: flex-end; @@ -16,20 +23,35 @@ button { color: white; font-weight: bold; } + .quote-card { background-color: #fcfcfc; border-radius: 5px; padding: 30px; display: flex; flex-direction: column; - width: 600px; + width: 100%; + max-width: 600px; min-height: 200px; } + #quote { font-family: "Playfair Display", serif; font-size: 28px; color: #333333; + overflow-wrap: break-word; } + #author { align-self: flex-end; } + +@media (max-width: 480px) { + .quote-card { + padding: 20px; + } + + #quote { + font-size: 22px; + } +}