//section-titleをCSSで追加すると番号が背景につく
document.addEventListener('DOMContentLoaded', function () {
  const sectionTitles = document.querySelectorAll('.section-title');
  sectionTitles.forEach((title, index) => {
    title.setAttribute('data-number', (index + 1).toString().padStart(2, '0'));
  });
});

//flickityを使用swpをcssで追加する
document.addEventListener('DOMContentLoaded', function () {
  let elmParents = document.querySelectorAll('.swp');

  elmParents.forEach(elmParent => {
    let elmFlkty = elmParent.firstElementChild;
    elmFlkty.classList.add('flickity-carousel');
    let flkty = new Flickity(elmFlkty, {
      cellAlign: 'center', pageDots: true, prevNextButtons: false, autoPlay: 3000, wrapAround: true
    });
  });
});