diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index 30b434bcf..20822cbf7 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..8a0e21b75 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -1,3 +1,25 @@ +const quoteElement = document.getElementById("quote"); +const authorElement = document.getElementById("author"); +const newQuoteButton = document.getElementById("new-quote"); + +function showQuote(quoteObject) { + quoteElement.textContent = quoteObject.quote; + authorElement.textContent = quoteObject.author; +} + +function showRandomQuote() { + const randomQuote = pickFromArray(quotes); + showQuote(randomQuote); +} + +window.addEventListener("load", function () { + showRandomQuote(); + + newQuoteButton.addEventListener("click", function () { + 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..b43628924 100644 --- a/Sprint-3/quote-generator/style.css +++ b/Sprint-3/quote-generator/style.css @@ -1 +1,44 @@ /** Write your CSS in here **/ +body { + font-family: Arial, sans-serif; + background-color:burlywood; + padding: 20px; +} + + #quote-container { + background-color: #fff; + padding: 20px; + border-radius: 5px; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); + max-width: 600px; + margin: auto; + text-align: center; +} +#quote { + font-size: 24px; + font-style: italic; + margin-bottom: 10px; +} +#author { + font-size: 20px; + text-align: center; + margin-bottom: 20px; + color: #555; +} +button { + background-color: #007BFF; + color: white; + padding: 10px 20px; + font-size: 16px; + cursor: pointer; +} + +h1 { + color: #333; + margin-bottom: 20px; +} + + + + +