2025年8月20日水曜日

[HTML, etc.]TypeItでタイプライターエフェクトを簡単に実装

集客用のサイトに何かアニメーションを入れたいなぁと思っていたんですが
(まぁjQueryは使ってるんですが)

TypeIt は タイプライターエフェクトを簡単に実装できる JavaScript ライブラリ です

TypeIt | The most versatile JavaScript typewriter effect library on the planet.
https://www.typeitjs.com/

まぁトップページ見ても導入方法がわからんよな

Quick-Start Template | TypeIt
https://www.typeitjs.com/docs/vanilla/quick-start/

クイック-スタート テンプレート があります

HTML

<html>
  <head></head>
  <body>
    <!-- A root element for TypeIt to target. -->
    <span id="myElement"></span>

    <!-- The script itself, loaded AFTER your root element. -->
    <script src="https://unpkg.com/typeit@8.7.1/dist/index.umd.js"></script>
    <!-- <script src="https://unpkg.com/typeit/dist/index.umd.js"></script> -->
    <script>
      new TypeIt("#myElement", {
        strings: "This is what will be typed!",
        loop: true,
      }).go();
    </script>
  </body>
</html>

多くの人はループさせたいだろうなという事で、ループを追加しています

結果

F(uriouz)

欲しいものリスト / 優先度の高いほしいものリスト / ☕を奢る
Donate 寄付 カンパ サポート
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.
詳細プロフィールを表示

0 comments:

スパム対策の為コメントをオフにしています。
Disqusは利用出来ます。

注: コメントを投稿できるのは、このブログのメンバーだけです。

...

Recent Posts

 
"The Android robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License."