/** Landing page: the hero caption demo. */
const words = ['THIS', 'IS', 'HOW', 'YOU', 'GET', 'VIEWS']
const cap = document.getElementById('demo-cap')
if (cap) {
let i = 0
const reduce = matchMedia('(prefers-reduced-motion: reduce)').matches
const show = () => {
const start = Math.floor(i / 2) * 2
cap.innerHTML = words
.slice(start, start + 2)
.map((w, k) => `${w}`)
.join('
')
i = (i + 1) % words.length
}
show()
if (!reduce) setInterval(show, 650)
}