PageSourceSearch

https://news.research.gatech.edu/themes/contrib/arta_theme/js/infinite.js?tlu2c5

js gatech.edu collected 2026-09-24 06:03:31 UTC 1,976 bytes, 69 lines download raw bytes

1 
2 function cloneTimelinesleft() {
3  const columns = document.querySelectorAll('.year-column:not(.left-clone):not(.right-clone)');
4  const timelineYears = document.querySelector('.timeline-years');
5  if (!timelineYears) return;
6
7  const clones = Array.from(columns).map(col => {
8    const clone = col.cloneNode(true);
9    clone.classList.add('left-clone');
10    return clone;
11  });
12
13  // Insert all clones at the beginning in reverse order to maintain visual order
14  clones.reverse().forEach(clone => {
15   timelineYears.insertBefore(clone, timelineYears.firstChild);
16  });
17}
18
19function cloneTimelinesright() {
20  const columns = document.querySelectorAll('.year-column:not(.left-clone):not(.right-clone)');
21  const timelineYears = document.querySelector('.timeline-years');
22  if (!timelineYears) return;
23
24  const clones = Array.from(columns).map(col => {
25    const clone = col.cloneNode(true);
26    clone.classList.add('right-clone');
27    return clone;
28  });
29
30  // Append all clones at the end
31  clones.forEach(clone => {
32    timelineYears.appendChild(clone);
33  });
34}
35
36function startAutoScroll(speed = 1) {
37  const container = document.querySelector('.timeline-years');
38  if (!container) return;
39  
40  // setting up the hover stop for the scroller
41  let scrollInterval;
42
43  function start() {
44    scrollInterval = setInterval(() => {
45      container.scrollLeft += speed;
46
47      // Optional: trigger cloning when reaching the end
48      const maxScroll = container.scrollWidth - container.offsetWidth;
49      if (container.scrollLeft >= maxScroll) {
50        cloneTimelinesright();
51      }
52    }, 20); // Adjust interval for smoother or faster scrolling
53  }
54
55  //Create a function to stop the interval
56  function stop() {
57    clearInterval(scrollInterval);
58  }
59
60  //Add event listeners to detect hover
61  container.addEventListener('mouseenter', stop);
62  container.addEventListener('mouseleave', start);
63
64  // start the scroll
65  start();
66  
67}
68
69startAutoScroll(); // Start auto-scrolling

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.