Giter Club home page Giter Club logo

vue-svg-textstroke's Introduction

vue-svg-textstroke

テキストのラインアニメーションをSVGで。

DEMO

導入方法

  1. /src/components/svgTextStroke.vue を任意の場所に追加。

使用方法

詳しくはApp.vueを参照

<svgTextStroke msg="表示する文字列"/>

オプション

・font-size
フォントサイズを指定

<svgTextStroke msg="表示する文字列" font-size="30"/>

・stroke-color
線の色を指定

<svgTextStroke msg="表示する文字列" stroke-color="#f0f"/>

・font-color
文字色を指定

<svgTextStroke msg="表示する文字列" font-color="#f0f"/>

・letter-spacing
字間を指定

<svgTextStroke msg="表示する文字列" letter-spacing="1.5"/>

・line-height
行間を指定

<svgTextStroke msg="表示する文字列" line-height="1.5"/>

・dy
文字の縦位置を指定
フォントによって上下が切れたりするのを調整する時に使用する

<svgTextStroke msg="表示する文字列" dy="1.5"/>

・複数行
brで改行させると複数行表示になる

<svgTextStroke msg="メロスは激怒した。<br>必ず、かの邪智暴虐(じゃちぼうぎゃく)の王を除かなければならぬと決意した。<br>メロスには政治がわからぬ。<br>メロスは、村の牧人である。<br>笛を吹き、羊と遊んで暮して来た。<br>けれども邪悪に対しては、人一倍に敏感であった。"/>

・delay
delayを指定すると表示が徐々に表示される
複数行の時も同様

<svgTextStroke msg="時間差で徐々に表示するサンプルです。" delay="0.04"/>
<svgTextStroke msg="メロスは激怒した。<br>必ず、かの邪智暴虐(じゃちぼうぎゃく)の王を除かなければならぬと決意した。<br>メロスには政治がわからぬ。<br>メロスは、村の牧人である。<br>笛を吹き、羊と遊んで暮して来た。<br>けれども邪悪に対しては、人一倍に敏感であった。" delay="0.04"/>

vue-svg-textstroke's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.