LoginSignup
0
0

More than 1 year has passed since last update.

CSS手書き風テキストアニメーション

Posted at

inkscapeでテキストを作成

image.png

SVGは下記のようにタグ内に

image.png

テキストをパスへ変更する

image.png

テキストはパス化される

image.png

アニメーションCSSの設定

    <style>
        /* --- テキスト --- */
        path {
            fill: none; /* 1,塗りの色 */
            stroke: #000; /* 2,線の色 */
            stroke-dasharray: 2000; /* 3,破線の間隔 */
            stroke-dashoffset: 2000; /* 4,破線の開始位置 */
            stroke-width: 1; /* 5,線の太さ */
            animation: handwriting 3s ease-in forwards; /* 6,名前 時間 タイミング 終了後の状態 */
        }

        /* --- アニメーション --- */
        @keyframes handwriting {
            0% {
                fill: transparent; /* 1,塗りの色 */
                stroke-dashoffset: 2000; /* 4,破線の開始位置 */
            }
            50% {
                fill: transparent; /* 1,塗りの色 */
            }
            100% {
                fill: #000; /* 1,塗りの色 */
                stroke-dashoffset: 0; /* 4,破線の開始位置 */
            }
        }
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0