0.0.4 • Published 3 years ago

canvas-marquee v0.0.4

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

canvas-marquee

a marquee component based on canvas

Installation

npm i canvas-marquee -S

Usage

import Marquee from 'canvas-marquee';
var textList = ['跑马灯', '666', '233333333',
        'javascript', 'html', 'css', '前端框架', 'Vue', 'React',
        'Angular', '测试跑马灯效果'
    ];
var opts = {
    id:'canvas',
    data:textList,
    top:20,
    offset:1,
    gap:10,
    font:'20px Arial',
    color:'#339966'
};
var marquee = new Marquee(opts);
marquee.draw();

options

ParameterTypeDefaultDescription
idstringthe canvas element’s id
datastringthe tests to show in canvas
topfunctiontext top offset in canvas
offsetstring1text move step
gapnumber0text item gap
colorstringtext color
fontstringtext font
startstring/numberlefttext start point

preview

marquee

0.0.4

3 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago