# @coffeekraken/text-intro

> Provide some cool animations to display your titles, etc... with style. They are all triggered when the element appear in viewport.

Latest version **1.0.1** (published 2020-01-09) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @coffeekraken/text-intro
pnpm add @coffeekraken/text-intro
yarn add @coffeekraken/text-intro
bun add @coffeekraken/text-intro
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-01-09 |
| First published | 2019-12-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 47 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 0 |
| Author | Coffeekraken |
| Maintainers | olivierbossel |
| Keywords | intro, text, appear, css, html, coffee, kraken, coffeekraken |

## Links

- npm: https://www.npmjs.com/package/@coffeekraken/text-intro
- Repository: https://github.com/coffeekraken/coffeekraken
- Homepage: http://coffeekraken.io
- Issues: https://github.com/coffeekraken/coffeekraken/issues
- npm.io page: https://npm.io/package/@coffeekraken/text-intro

## Dependencies (2)

- [fs-extra](https://npm.io/package/fs-extra.md) ^8.1.0
- [@coffeekraken/sugar](https://npm.io/package/@coffeekraken/sugar.md) ^1.0.4

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2020-01-09
- 1.0.0 — 2019-12-14

## README

# Coffeekraken text-intro <img src=".resources/coffeekraken-logo.jpg" height="25px" />

![npm](https://img.shields.io/npm/l/@coffeekraken/text-intro?style=flat-square)
![npm](https://img.shields.io/npm/v/@coffeekraken/text-intro?style=flat-square)
![npm](https://img.shields.io/npm/dw/@coffeekraken/text-intro?style=flat-square)

Provide some cool animations to display your titles, etc... with style. They are all triggered when the element appear in viewport.

## Table of content

2. [Features](#readme-features)
2. [Install](#readme-install)
3. [Requirements](#readme-requirements)
4. [Get Started](#readme-get-started)
5. [`[intro-activator]`](#readme-intro-activator)
6. [Javascript API](doc/src/js)
7. [SASS API](doc/src/scss)
8. [Coffeekraken](#readme-coffeekraken)

<a name="readme-features"></a>

## Features

1. Multiple cool animations to display your titles, etc... with style
2. Trigger the animation when element is in the viewport
3. Support for [`[intro-activator]`](#readme-intro-activator) feature

<a name="readme-install"></a>

## Install

```
npm install @coffeekraken/text-intro --save
```

<a name="readme-requirements"></a>
## Requirements

In order to make this package work with your settings, you have to add the `node_modules/@coffeekraken` folder in the [load paths](https://sass-lang.com/documentation/at-rules/import#load-paths) of your `sass` installation.

<a name="readme-get-started"></a>
## Get Started

First import the component into your javascript file like so:

```js
import lettersInReveal from '@coffeekraken/text-intro/js/lettersInReveal'
import lettersInRain from '@coffeekraken/text-intro/js/lettersInRain'
import slideIn from '@coffeekraken/text-intro/js/slideIn'
// init listeners
lettersInReveal();
lettersInRain();
slideIn();
```

Then import and generate the classes using the provided mixins like so:

```scss
@use '@coffeekraken/text-intro/index' as text-intro;
@include text-intro.letters-in-reveal-classes();
@include text-intro.letters-in-rain-classes();
@include text-intro.slide-in-classes();
```

Then simply use it inside your html like so:

```html
<h1 intro="letters-in-reveal">
	My cool animated title
</h1>
<h1 intro="letters-in-rain">
	My cool animated title
</h1>
<h2 intro="slide-in-up">
	My cool animated title
</h2>
<h2 intro="slide-in-down">
	My cool animated title
</h2>
<h2 intro="slide-in-left">
	My cool animated title
</h2>
<h2 intro="slide-in-right">
	My cool animated title
</h2>
```

<a name="readme-intro-activator"></a>
## `[intro-activator]`

You can tell you animations to be played depending on the state of one of his parent node. To do that, simply apply the `intro-activator` attribute on the parent you want and handle the animation state on this element directly.

You animation will be played if the `intro-activator` node has the `.active` class or the `[active]` attribute. This is useful for example in a slider if you want each slides to trigger the animations independently.

```html
<!-- here's an example -->
<div intro-activator>
	<h1 intro="slide-in-up">The animation will not been played</h1>
</div>
<div intro-activator class="active">
	<h1 intro="slide-in-up">The animation will been played</h1>
</div>
```

<a name="readme-coffeekraken"></a>

# Coffeekraken

We are a young collective of front-end creative developers with one goal in mind. Build tools to make every team working day life better. This is our first and only concern. All our tools are build around that purpose.
All what we provide are some cool tools that you can use the way you want. These tools features cover a large scope of the front-end workflow (styleguide generation, colors/fonts management, etc...). You can use only the parts that you need and let the rest aside...

[![Coffeekraken](.resources/coffeekraken-logo.jpg)](https://coffeekraken.io)

---
_Source: https://npm.io/package/@coffeekraken/text-intro · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
