diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index 30b434bcf..baddab59b 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -3,13 +3,16 @@ + Title here -

hello there

-

-

- +
+

hello there

+

+

+ +
diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4a4d04b72..b4c5b7297 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -491,3 +491,19 @@ const quotes = [ ]; // call pickFromArray with the quotes array to check you get a random quote + +const author = document.querySelector("#author"); +const quote = document.querySelector("#quote"); +const newQuoteButton = document.querySelector("#new-quote"); + +displayQuote(); + +newQuoteButton.addEventListener("click", () => { + displayQuote(); +}); + +function displayQuote() { + const randomQuote = pickFromArray(quotes); + quote.textContent = randomQuote.quote; + author.textContent = randomQuote.author; +} diff --git a/Sprint-3/quote-generator/style.css b/Sprint-3/quote-generator/style.css index 63cedf2d2..448e77738 100644 --- a/Sprint-3/quote-generator/style.css +++ b/Sprint-3/quote-generator/style.css @@ -1 +1,48 @@ -/** Write your CSS in here **/ +body { + font-family: Arial, Helvetica, sans-serif; + min-height: 100vh; + margin: 0; + display: flex; + padding: 0 1rem; + background-color: #F59E25; +} + +.box { + max-width: 700px; + margin: auto; + background-color: #FFFFFF; + border-radius: 8px; + padding: 2rem; + text-align: center; +} + +h1 { + margin-bottom: 2rem; +} + +#quote { + font-size: 1.5rem; + font-style: italic; + line-height: 1.6; + margin-bottom: 1rem; +} + +#author { + font-size: 1.1rem; + font-weight: bold; + margin-bottom: 2rem; +} + +button { + padding: 0.75rem 1.5rem; + font-size: 1rem; + cursor: pointer; + border: none; + border-radius: 6px; + background-color: #1976d2; + color: white; +} + +button:hover { + background-color: #1565c0; +} \ No newline at end of file