home.js 442 B

12345678910111213141516
  1. import { init } from 'ityped'
  2. // =========== Typing Carousel ================
  3. // get data from hidden ul and set as typing data
  4. document.addEventListener('DOMContentLoaded', () => {
  5. const $ul = document.getElementById('typing-carousel-data')?.children
  6. if ($ul == null || $ul.length === 0) return
  7. const strings = Array.from($ul).map($el => $el.textContent)
  8. init('#ityped', {
  9. strings,
  10. startDelay: 200,
  11. loop: true
  12. })
  13. })