wraplines

wraps each line in a paragraph in an element

Usage no npm install needed!

<script type="module">
  import wraplines from 'https://cdn.skypack.dev/wraplines';
</script>

README

WrapLines 📖

npm version license dependencies gzip size

Tiny library to wrap lines after every "line break" in a paragraph.

Install
npm install wraplines --save
Usage
import wrapLines from 'wraplines';

//Openingtag & closingtag has to be a string
wrapLines(container, openingtag, closingtag);
Example
wrapLines(document.getElementById("container"), "<span><thisiscoolhuh>", "</thisiscoolhuh></span>");
So you don't have to run the demo :p

example.gif

Notice

This library only breaks each line! You can add your own animations with by example css or gsap.

To dos
  • resize option
  • option to also split words/characters
MIT © Niels Reijnders