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

hello there

-

-

- +

Quotes

+
+

+

+ +
diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4a4d04b72..6a5c4d5f6 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -491,3 +491,27 @@ const quotes = [ ]; // call pickFromArray with the quotes array to check you get a random quote +const card = document.querySelector("#wildCard"); +console.log(card); +const author = document.querySelector("#author"); +console.log(author); +const quote = document.querySelector("#quote"); +console.log(quote); +const quoteButton = document.querySelector("#new-quote"); +console.log(quoteButton); + +window.addEventListener("load", function () { + // to invoke quotes when page loads + const result = pickFromArray(quotes); + + quote.textContent = `${result.quote}`; + author.textContent = `- ${result.author}`; +}); + +quoteButton.addEventListener("click", function () { + // invoke quotes when the button is clicked + const result = pickFromArray(quotes); + + quote.textContent = `${result.quote}`; + author.textContent = `- ${result.author}`; +}); diff --git a/Sprint-3/quote-generator/style.css b/Sprint-3/quote-generator/style.css index 63cedf2d2..8b7bed109 100644 --- a/Sprint-3/quote-generator/style.css +++ b/Sprint-3/quote-generator/style.css @@ -1 +1,69 @@ -/** Write your CSS in here **/ +body { + background-color: orange; + padding-left: 75px; + padding-right: 75px; + padding-bottom: 150px; + padding-top: 150px; + align-items: center; + justify-content: center; + display: flex; +} + +h1 { + display: none; +} + +#wildCard.card { + border-radius: 5px; + text-align: justify; + background-color: white; + height: 300px; + width: 900px; + padding: 30px; + position: relative; + display: flex; + flex-direction: column; + justify-content: space-between; +} + +#quote { + color: orange; + font-size: 25px; + font-family: Arial, Helvetica, sans-serif; + font-style: italic; + position: relative; + margin-right: 30px; +} + +#quote::before { + content: "❝"; + font-family: "Playfair Display", serif; + position: relative; + color: orange; + font-size: 35px; + margin-top: 90px; + margin-left: 20px; +} + +#author { + color: orange; + font-size: 20px; + font-family: Arial, Helvetica, sans-serif; + font-style: italic; + text-align: right; + margin-top: 50px; + margin-right: 30px; + margin-bottom: 20px; +} + +#new-quote { + color: white; + align-self: self-end; + background-color: orange; + border-radius: 5px; + border-color: orange; + width: 110px; + height: 35px; + margin-top: auto; + margin-right: 30px; +}