diff --git a/index.html b/index.html index b23ee5a..3b0e267 100644 --- a/index.html +++ b/index.html @@ -102,7 +102,7 @@ - + diff --git a/scripts.js b/scripts.js index 978b103..dd1b6d6 100644 --- a/scripts.js +++ b/scripts.js @@ -17,16 +17,20 @@ document.addEventListener('DOMContentLoaded', function() { .then(quotes => { let currentQuoteIndex = 0; const quoteBanner = document.getElementById('quoteBanner'); + const quoteText = quoteBanner.querySelector('blockquote p'); function updateQuote() { - quoteBanner.textContent = quotes[currentQuoteIndex++]; - if (currentQuoteIndex >= quotes.length) currentQuoteIndex = 0; + quoteText.textContent = quotes[currentQuoteIndex]; + currentQuoteIndex = (currentQuoteIndex + 1) % quotes.length; } updateQuote(); setInterval(updateQuote, 5000); - }); + }) + .catch(error => console.error('Error loading JSON:', error)); }); + +