diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index 30b434bcf..34c05f69a 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -1,15 +1,18 @@ - + - Title here + Quote generator app + -

hello there

-

-

- +
+

Quote Generator

+

+

+ +
diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4a4d04b72..f229ca7a6 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -491,3 +491,16 @@ const quotes = [ ]; // call pickFromArray with the quotes array to check you get a random quote +const quoteElement = document.getElementById("quote"); +const authorElement = document.getElementById("author"); +const newQuoteButton = document.getElementById("new-quote"); + +function showRandomQuote() { + const randomQuote = pickFromArray(quotes); + quoteElement.textContent = randomQuote.quote; + authorElement.textContent = "- " + randomQuote.author; +} + +showRandomQuote(); + +newQuoteButton.addEventListener("click", showRandomQuote); diff --git a/Sprint-3/quote-generator/style.css b/Sprint-3/quote-generator/style.css index 63cedf2d2..6ae00e816 100644 --- a/Sprint-3/quote-generator/style.css +++ b/Sprint-3/quote-generator/style.css @@ -1 +1,61 @@ -/** Write your CSS in here **/ +* { + box-sizing: border-box; +} + +body { + margin: 0; + min-height: 100vh; + display: flex; + justify-content: center; + align-items: center; + background: linear-gradient(135deg, #667eea, #764ba2); + font-family: Georgia, "Times New Roman", Times, serif; + padding: 1rem; +} + +.card { + background: #ffffff; + max-width: 600px; + width: 100%; + padding: 2rem; + border-radius: 12px; + box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); + text-align: center; +} + +h1 { + margin-top: 0; + font-size: 1rem; + letter-spacing: 0.15em; + text-transform: uppercase; + color: #888; +} + +#quote { + font-size: 1.5rem; + line-height: 1.5; + font-style: italic; + color: #222; + margin: 1.5rem 0 1rem; +} + +button { + background: #764ba2; + color: #ffffff; + border: none; + padding: 0.75rem 1.75rem; + font-size: 1rem; + border-radius: 999px; + cursor: pointer; + transition: + background 0.2s, + transform 0.1s; +} + +button:hover { + background: #5d3a85; +} + +button:active { + transform: scale(0.96); +}