diff --git a/Sprint-2/debug/address.js b/Sprint-2/debug/address.js index 940a6af83..e19ab9314 100644 --- a/Sprint-2/debug/address.js +++ b/Sprint-2/debug/address.js @@ -12,4 +12,4 @@ const address = { postcode: "XYZ 123", }; -console.log(`My house number is ${address[0]}`); +console.log(`My house number is ${address[0]}`); \ No newline at end of file diff --git a/Sprint-2/debug/recipe.js b/Sprint-2/debug/recipe.js index 6cbdd22cd..1f2146266 100644 --- a/Sprint-2/debug/recipe.js +++ b/Sprint-2/debug/recipe.js @@ -12,4 +12,4 @@ const recipe = { console.log(`${recipe.title} serves ${recipe.serves} ingredients: -${recipe}`); +${recipe}`); \ No newline at end of file diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index 30b434bcf..ab49fce40 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -3,13 +3,16 @@ - Title here - + Random Quote Generator + -

hello there

-

-

- +
+

Loading...

+

+ +
+ + diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4a4d04b72..2ec004220 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -491,3 +491,16 @@ const quotes = [ ]; // call pickFromArray with the quotes array to check you get a random quote + +function displayRandomQuote() { + const randomQuote = pickFromArray(quotes); + document.getElementById("quote").textContent = randomQuote.quote; + document.getElementById("author").textContent = randomQuote.author; +} + +// Show a quote immediately on page load +displayRandomQuote(); + +// Set up button click to get a new quote +document.getElementById("new-quote").addEventListener("click", displayRandomQuote); + diff --git a/Sprint-3/quote-generator/style.css b/Sprint-3/quote-generator/style.css index 63cedf2d2..694a56a9d 100644 --- a/Sprint-3/quote-generator/style.css +++ b/Sprint-3/quote-generator/style.css @@ -1 +1,17 @@ /** Write your CSS in here **/ +body { + font-family: Arial, sans-serif; + background: #f4f4f4; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; +} + +.quote-box { + background: white; + padding: 2rem; + border-radius: 1rem; + box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); + text-align: center; +} \ No newline at end of file