diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index 30b434bcf..998b61742 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

-

-

- +
+

Dare to be inspired.....

+

+

+ +
diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4a4d04b72..b7dd10473 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -491,3 +491,19 @@ const quotes = [ ]; // call pickFromArray with the quotes array to check you get a random quote +const fetchQuote = document.getElementById("quote"); +const fetchAuthor = document.getElementById("author"); +const newQuote = document.getElementById("new-quote"); + +// function to display a random quote +function displayRandomQuote() { + const randomQuote = pickFromArray(quotes); + fetchQuote.innerText = randomQuote.quote; + fetchAuthor.innerText = randomQuote.author; +} + +// show one quote when page loads +displayRandomQuote(); + +// change quote when button is clicked +newQuote.addEventListener("click", displayRandomQuote); \ No newline at end of file diff --git a/Sprint-3/quote-generator/style.css b/Sprint-3/quote-generator/style.css index 63cedf2d2..2a67844a8 100644 --- a/Sprint-3/quote-generator/style.css +++ b/Sprint-3/quote-generator/style.css @@ -1 +1,47 @@ /** Write your CSS in here **/ +body { + font-family: Arial, sans-serif; + text-align: center; + margin: 40px; + background-color: lightgray; +} + +div { + background: white; + padding: 20px; + border-radius: 8px; + max-width: 500px; + margin: auto; + box-shadow: 0 2px 6px gray; +} + +h1 { + color: black; + margin-bottom: 20px; +} + +#quote { + font-size: 1.2em; + margin: 20px 0; + color: darkblue; +} + +#author { + font-style: italic; + color: darkgreen; + margin-bottom: 25px; +} + +button { + padding: 10px 20px; + font-size: 1em; + background-color: magenta; + color: white; + border: none; + border-radius: 5px; + cursor: pointer; +} + +button:hover { + background-color: navy; +}