document.addEventListener('DOMContentLoaded', function () { let sayings = [ "is sound money", "is equal weights and measures (Prov 11:1)", "is the first finite commodity", "is investing the master's talents (Matt 25:14-30)", "is a bearer instrument, yet invisible", "removes the power of the state from money" ]; const sayingsContainer = document.getElementById('sayings'); let index = 0; let cycle = 0; let finished = false; function showSaying() { if (finished) return; // Show the final message after the first full cycle if (cycle === 1 && index === 0) { sayingsContainer.classList.remove('fade-in', 'fade-out'); sayingsContainer.innerHTML = 'study \u20BFitcoin'; void sayingsContainer.offsetWidth; sayingsContainer.classList.add('fade-in'); setTimeout(() => { sayingsContainer.classList.remove('fade-in'); sayingsContainer.style.opacity = '1'; finished = true; }, 900); return; } sayingsContainer.textContent = sayings[index]; sayingsContainer.classList.add('fade-in'); setTimeout(() => { sayingsContainer.classList.remove('fade-in'); sayingsContainer.classList.add('fade-out'); setTimeout(() => { sayingsContainer.classList.remove('fade-out'); index = (index + 1); if (index === sayings.length) { cycle++; index = 0; } showSaying(); }, 900); }, 3000); } // Initial call showSaying(); });