diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index 30b434bcf..12fbeb9b0 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -3,13 +3,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..fa08c2aac 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -1,3 +1,23 @@ +function displayQuote(quoteObject) { + const quoteP = document.getElementById("quote"); + const authorP = document.getElementById("author"); + quoteP.innerText = quoteObject.quote; + authorP.innerText = quoteObject.author; +} + +function showRandomQuote () { + const randomQuote = pickFromArray(quotes); + displayQuote(randomQuote); +} + +window.onload = function () { + showRandomQuote(); + + const newQuoteBtn = document.getElementById("new-quote") + newQuoteBtn.addEventListener("click", () => { + showRandomQuote(); + }); +}; // DO NOT EDIT BELOW HERE // pickFromArray is a function which will return one item, at diff --git a/Sprint-3/quote-generator/style.css b/Sprint-3/quote-generator/style.css index 63cedf2d2..73e7dabb8 100644 --- a/Sprint-3/quote-generator/style.css +++ b/Sprint-3/quote-generator/style.css @@ -1 +1,60 @@ -/** Write your CSS in here **/ +body { + margin: 0; + min-height: 100vh; + display: grid; + place-items: center; + padding: 40px; + font-family: Helvetica, sans-serif; + background: #cc5500; +} + +.container { + width: 100%; + max-width: 650px; + background: #cc5500; + padding: 50px; + border-radius: 8px; +} + +h1 { + font-size: 26px; + line-height: 1.5; + color: white; + margin: 0; + text-align: center; +} + +.quote-box { + background: black; + padding: 30px; + border-radius: 6px; + border: 2px solid #cc5500; + margin-bottom: 20px; +} + +#quote { + font-size: 26px; + line-height: 1.5; + color: white; + margin: 0; + text-align: center; +} + +#author { + margin-top: 20px; + text-align: right; + color: white; + font-weight: 600; +} + +#new-quote { + margin-top: 2px; + background: white; + color: black; + border: 2px solid #cc5500;; + padding: 10px 18px; + cursor: pointer; + border-radius: 4px; +} + +