1.0.1 • Published 1 year ago

lines-split v1.0.1

Weekly downloads
-
License
-
Repository
github
Last release
1 year 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

1 year ago

1.0.0

1 year ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago