New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

letterit

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

letterit

A javascript helper to split HTML text into characters

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

LetterIt

I created this as a simple and easy way to add staggering delays to CSS transition effects to sentences.

It takes a sentence such as "Hello World" and will wrap each character in a div

<div>H</div>
<div>e</div>
<div>l</div>
<div>l</div>
<div>o</div>

<!-- Etc -->

Usage

Install the script npm install letterit --save

Once installed use it like this

import LetterIt from 'letterit'
LetterIt.init();

You also need to add some data attributes to your HTML elements

<h1 class="letterIt" data-transition-delay="0.01" data-letterit="letter">
Quiet and secluded
</h1>

You can change the data-transition-delay attribute to any duration. Leaving this out will provide no delayed transition.

You then need to add your own CSS transitions in your style sheet.

eg


.letterIt .letter{
  transition:all 1s ease-in-out;
  opacity:0;
}
.letterIt.active .letter{
    opacity:1;
}

In the above example the text will not display until the letterIt class has had the active class applied to it. Once applied each character should show with a nice staggering delay.

FAQs

Package last updated on 06 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts