PageSourceSearch

https://www.lisachastain.com/js/home/index.js

js lisachastain.com collected 2026-10-04 16:07:53 UTC 1,903 bytes, 60 lines download raw bytes

1let cardCycleInterval
2
3function cycleCards() {
4  const cards = document.querySelectorAll('[data-program-cards] .program-card')
5  if (!cards.length) return
6
7  const cardCount = cards.length
8  // Each card stays dark for 2s, with 1.5s fade in and 1.5s fade out via CSS transition
9  // Total phase per card: 5s (fade in + stay + fade out), with 2s overlap
10  const phaseDuration = 4000 // ms per card in dark state
11  let currentIndex = 0
12
13  function showDarkCard(index) {
14    cards.forEach((card, i) => {
15      const overlay = card.querySelector('.program-card-overlay')
16      const title = card.querySelector('.card-title')
17      const desc = card.querySelector('.card-desc')
18      const label = card.querySelector('.card-label')
19      const date = card.querySelector('.card-date')
20
21      if (i === index) {
22        // Fade dark ON
23        if (overlay) overlay.style.opacity = '1'
24        if (title) title.style.color = '#ffffff'
25        if (desc) desc.style.color = '#d1d5db'
26        if (label) label.style.color = '#d1d5db'
27        if (date) date.style.color = '#d1d5db'
28        card.style.borderColor = 'rgba(201, 162, 39, 0.3)'
29      } else {
30        // Fade dark OFF
31        if (overlay) overlay.style.opacity = '0'
32        if (title) title.style.color = '#111827'
33        if (desc) desc.style.color = '#4b5563'
34        if (label) label.style.color = '#4b5563'
35        if (date) date.style.color = '#1f2937'
36        card.style.borderColor = 'rgb(229, 231, 235)'
37      }
38    })
39  }
40
41  // Start with card 0 dark
42  showDarkCard(0)
43
44  cardCycleInterval = setInterval(() => {
45    currentIndex = (currentIndex + 1) % cardCount
46    showDarkCard(currentIndex)
47  }, phaseDuration)
48}
49
50export function init() {
51  // Small delay to ensure DOM is ready
52  setTimeout(cycleCards, 100)
53}
54
55export function teardown() {
56  if (cardCycleInterval) {
57    clearInterval(cardCycleInterval)
58    cardCycleInterval = null
59  }
60}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.