# brito101-fade

> Class for applying the fade effect in DOM sections

Latest version **1.0.0** (published 2021-10-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install brito101-fade
pnpm add brito101-fade
yarn add brito101-fade
bun add brito101-fade
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-10-28 |
| First published | 2021-10-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | brito101 |

## Links

- npm: https://www.npmjs.com/package/brito101-fade
- Repository: https://github.com/brito101/Fade
- Homepage: https://www.rodrigobrito.dev.br
- Issues: https://github.com/brito101/Fade/issues
- npm.io page: https://npm.io/package/brito101-fade

## Recent versions

- 1.0.0 (latest) — 2021-10-28

## README

# Fade

Class for applying the "fade" effect in DOM sections, in a simple way, used on the website https://www.rodrigobrito.dev.br.</br>
-- Classe para aplicação do efeito "fade" em seções do DOM, de forma simples, utilizada no site https://www.rodrigobrito.dev.br.

# Example of use

Selecting DOM elements with the "fadeInScroll" class (can be any tag) and importing the class (import Fade from...) or in the same file:</br>
-- Selecionando elementos do DOM com a classe "fadeInScrool" (pode ser qualquer tag) e importando a classe (import Fade from...) ou no mesmo arquivo:

```
const fadeInScroll = document.querySelectorAll(".fadeInScroll");
const fade = new Fade(fadeInScroll);
fade.init();
```

Adding to browser window "scroll" event with debounce:</br>
--Adicionando ao evento de "scroll" da janela do navegador com debounce:

```
window.addEventListener("scroll", () => {
    let timer;
    if (timer) clearTimeout(timer);
    timer = setTimeout(() => {
      fade.checkFades();
      timer = null;
    }, 200);
  });
```

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