Preparing storefront

The foundation is open source, feel free to test the solutions.

const codeLines = [
  4,  // read current time
  6,  // update hours
  7,  // update minutes
  8,  // update seconds
  11  // render next frame
];

const codeElements = codeLines.map(
  line =>
    document.querySelector(
      `.clock-code__line[data-line="${line}"]`
    )
);

let codeIndex = 0;

function animateCode() {
  codeElements.forEach(
    line => line?.classList.remove("is-active")
  );

  codeElements[codeIndex]
    ?.classList.add("is-active");

  codeIndex =
    (codeIndex + 1) % codeElements.length;

  setTimeout(
    animateCode,
    650
  );
}

animateCode();