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

hello there

-

-

- +
+

Your Quote for the day

+ +
+ + +
+

+

+
+ +
+
diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4a4d04b72..2f0064761 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -490,4 +490,19 @@ const quotes = [ }, ]; +function displayRandomQuote() { + const randomQuote = pickFromArray(quotes); + + document.getElementById("quote").textContent = randomQuote.quote; + document.getElementById("author").textContent = randomQuote.author; +} + +// A new quote is shown on page load +displayRandomQuote(); + +//Button click +document + .getElementById("new-quote") + .addEventListener("click", displayRandomQuote); + // call pickFromArray with the quotes array to check you get a random quote diff --git a/Sprint-3/quote-generator/style.css b/Sprint-3/quote-generator/style.css index 63cedf2d2..97b751b0a 100644 --- a/Sprint-3/quote-generator/style.css +++ b/Sprint-3/quote-generator/style.css @@ -1 +1,80 @@ /** Write your CSS in here **/ +body { + margin: 0; + font-family: Georgia, "Times New Roman", serif; + background-color: #f59e0b; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; +} +/* h1 changes */ +h1 { + color: #050301; + text-align: center; + margin-bottom: 40px; + font-weight: normal; +} + +/* Container card */ +.quote-container { + background-color: #d9d9d9; + width: 1200px; + max-width: none; + padding: 60px; + box-sizing: border-box; + text-align: left; + display: flex; + flex-direction: column; + justify-content: space-between; + height: 500px; + +} + +/* Quote text */ +#quote { + font-size: 32px; + color: #f59e0b; + line-height: 1.4; + margin-bottom: 30px; + position: relative; +} + +/* Big quote mark */ +#quote::before { + content: "“"; + font-size: 80px; + position: absolute; + left: -40px; + top: -20px; + color: #f59e0b; +} + +/* Author */ +#author { + text-align: right; + font-size: 20px; + color: #130d04; + margin-bottom: 30px; +} + +/* Button */ +#new-quote { + background-color: #f59e0b; + color: white; + border: none; + padding: 15px 25px; + font-size: 16px; + cursor: pointer; + align-self: flex-end; +} + +#new-quote:hover { + background-color: #d97706; +} +/* Making the new area scrollable*/ +.quote-text { + flex-grow: 1; + overflow-y: auto; + min-height: 0; +} \ No newline at end of file