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

hello there

-

-

- +
+

+

+ +
diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4a4d04b72..9d4a35ed0 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -1,3 +1,21 @@ +document.addEventListener("DOMContentLoaded", () => { + //elements of page to interact with + const quoteDom = document.getElementById("quote"); + const authorDom = document.getElementById("author"); + const button =document.getElementById("new-quote"); + displayQuote(quoteDom, authorDom ); + + button.addEventListener("click",() => { + displayQuote(quoteDom, authorDom ) + }) +}); + +function displayQuote(quoteDom, authorDom ){ + const randomQuote =pickFromArray(quotes); + quoteDom.innerText = randomQuote.quote; + authorDom.innerText = randomQuote.author; +} + // 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..8a5a2aec3 100644 --- a/Sprint-3/quote-generator/style.css +++ b/Sprint-3/quote-generator/style.css @@ -1 +1,24 @@ /** Write your CSS in here **/ +body{ + background-color: orange; +} +#inner{ + background-color: white; + width: 70%; + margin: 125px auto; + padding: 35px; + text-align: end; +} +p{ + color: orange; + +} +#quote{ + font-size: 32px; +} +button{ + background-color: orange; + color: white; + border: none; + padding: 10px; +} \ No newline at end of file