1.0.1 • Published 2 months ago

lines-split v1.0.1

Weekly downloads
-
License
-
Repository
github
Last release
2 months ago

Split in lines

Use cases

It is very useful to create text animations.

Installation

npm install lines-split

Usage

import SplitInLines from 'lines-split'

const paragraph = document.querySelector('p')

new SplitInLines(paragraph)

Instance settings

OptionTypeDefaultDescription
targetHTMLElementundefinedText element to split

Instance props

PropertyTypeDescription
elementHTMLElementSplited element
isVisiblebooleanWhether or not slideUp() animation is completed. Set to true when animation is completed.
paramsobjectInstance parameters : width: numberwords: string[]lines: NodeListOf<HTMLSpanElement>`

Instance methods

OptionDescription
slideUp()Basic text animation
resize()Recreate each line in relation to element's width
1.0.1

2 months ago

1.0.0

4 months ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago