typed.html 551 B

12345678910111213141516171819
  1. {% assign strings = include.strings | split: '|' %}
  2. {% assign id = include.id | default: "typed" %}
  3. <span class="text-primary" id="{{ id }}">{{ strings | first }}</span>
  4. {% capture_script %}
  5. <script>
  6. document.addEventListener("DOMContentLoaded", function() {
  7. var typed = new Typed('#{{ id }}', {
  8. strings: [{% for string in strings %}'{{ string }}'{% unless forloop.last %}, {% endunless %}{% endfor %}],
  9. typeSpeed: 100,
  10. backSpeed: 50,
  11. backDelay: 1000,
  12. startDelay: 1000,
  13. loop: true,
  14. fade: true
  15. });
  16. });
  17. </script>
  18. {% endcapture_script %}