Svelte | svelte-marquee でマーキーを表示する

HTML5 でもマーキーを表示したいと言われたので、Svelte のライブラリーないかな?と調べたら、svelte-marqueeを見つけたので、試してみた。

インストール

npm install コマンドでインストールする。

1
# npm install svelte-marquee

サンプルコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<script>
import Marquee from "svelte-marquee";
</script>

<main>
<h1>Svelte-Marquee</h1>

<h2>Slow</h2>
<Marquee
content="[slow]この文章はダミーです文字の大きさ量字間行間等を確認するために入れています[slow]"
autoplay=true
reverse=true
speed="slow"
/>

<h2>Medium</h2>
<Marquee
content="[medium]この文章はダミーです文字の大きさ量字間行間等を確認するために入れています[medium]"
autoplay=true
reverse=true
speed="medium"
/>

<h2>Fast</h2>
<Marquee
content="[fast]この文章はダミーです文字の大きさ量字間行間等を確認するために入れています[fast]"
autoplay=true
reverse=true
speed="fast"
/>
</main>

<style>
</style>

実行結果

ダミーテキストの作成は、ここを利用しました。