diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index 30b434bcf..0c4b6e1ea 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -1,15 +1,20 @@ - - - - Title here - - - -

hello there

+ + + + + Quote generator app + + + + + +

- - +
+ + + \ No newline at end of file diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4a4d04b72..62f3bd9fb 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -19,6 +19,18 @@ function pickFromArray(choices) { return choices[Math.floor(Math.random() * choices.length)]; } +const quotePar = document.getElementById("quote"); +const authorPar = document.getElementById("author"); +const newQuoteBtn = document.getElementById("new-quote"); + +function displayQuote(quoteObj) { + quotePar.textContent = quoteObj.quote; + authorPar.textContent = quoteObj.author; +} + +newQuoteBtn.addEventListener("click", function () { + displayQuote(pickFromArray(quotes)); +}); // A list of quotes you can use in your app. // DO NOT modify this array, otherwise the tests may break! @@ -491,3 +503,5 @@ const quotes = [ ]; // call pickFromArray with the quotes array to check you get a random quote +console.log(pickFromArray(quotes)); //object gets logged into the console initially +displayQuote(pickFromArray(quotes)); diff --git a/Sprint-3/quote-generator/style.css b/Sprint-3/quote-generator/style.css index 63cedf2d2..dbb3c874a 100644 --- a/Sprint-3/quote-generator/style.css +++ b/Sprint-3/quote-generator/style.css @@ -1 +1,27 @@ -/** Write your CSS in here **/ +body { + background-color: rgb(11, 170, 170); + color: white; + font-size: 2rem; + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +#quote-box { + background-color: teal; + border: 3px solid white; + padding: 40px; + border-radius: 10px; + +} + +#new-quote { + display: block; + background-color: rgb(11, 170, 170); + color: white; + font-size: 1.25rem; + padding: 10px 24px; + border-radius: 10px; +} \ No newline at end of file