From 089a02ce763ed7485978e825aba62b0a7521f419 Mon Sep 17 00:00:00 2001 From: JenniferIsidienu Date: Mon, 18 Aug 2025 15:39:33 +0100 Subject: [PATCH] Sprint-3- Quote-generator --- Sprint-3/quote-generator/index.html | 16 ++++++----- Sprint-3/quote-generator/quotes.js | 12 +++++++++ Sprint-3/quote-generator/style.css | 42 +++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 6 deletions(-) diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index 30b434bcf..af9b10957 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -3,13 +3,17 @@ - Title here - + Quote generator app + -

hello there

-

-

- +

Quote generator app

+

Click the button to get a new quote.

+
+

+

+ +
+ diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4a4d04b72..4d3efecc2 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -491,3 +491,15 @@ const quotes = [ ]; // call pickFromArray with the quotes array to check you get a random quote +let quote = document.getElementById("quote"); +let author = document.getElementById("author"); +let quoteButton = document.getElementById("new-quote"); + +function displayQuote() { + let randomQuote = pickFromArray(quotes); + quote.textContent = randomQuote.quote; + author.textContent = randomQuote.author; +} + +displayQuote(); +quoteButton.addEventListener("click", displayQuote); diff --git a/Sprint-3/quote-generator/style.css b/Sprint-3/quote-generator/style.css index 63cedf2d2..9d3f9843c 100644 --- a/Sprint-3/quote-generator/style.css +++ b/Sprint-3/quote-generator/style.css @@ -1 +1,43 @@ /** Write your CSS in here **/ +body { + font-family: Arial, sans-serif; + max-width: 600px; + margin: 50px auto; + padding: 0 20px; + background: #198699; + color: #333; + text-align: center; +} + +h1 { + margin-bottom: 10px; +} + +#quote { + font-size: 1.5rem; + font-weight: bold; + margin: 20px 0 5px 0; + color: #b0b7be; +} + +#author { + font-size: 1.2rem; + font-style: italic; + margin-bottom: 30px; + color: #7f8c8d; +} + +button#new-quote { + background-color: #101a20; + border: none; + padding: 10px 20px; + font-size: 1rem; + color: white; + border-radius: 5px; + cursor: pointer; + transition: background-color 0.3s ease; +} + +button#new-quote:hover { + background-color: #43494d; +}