# wc-lazy

> allows to optimize the load of images based on IntersectionObserver

Latest version **0.0.1** (published 2019-04-18) · 0 weekly downloads

## Install

```sh
npm install wc-lazy
pnpm add wc-lazy
yarn add wc-lazy
bun add wc-lazy
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2019-04-18 |
| First published | 2019-04-18 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 210.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Matias Trujillo |
| Maintainers | uppercod |

## Links

- npm: https://www.npmjs.com/package/wc-lazy
- Repository: https://github.com/uppercod/wc-lazy
- Homepage: https://github.com/uppercod/wc-lazy#readme
- Issues: https://github.com/uppercod/wc-lazy/issues
- npm.io page: https://npm.io/package/wc-lazy

## Recent versions

- 0.0.1 (latest) — 2019-04-18
- 0.0.0 — 2019-04-18

## README

# wc-lazy

allows to optimize the load of images based on `IntersectionObserver`.

## lazy-img

this web-component, mediate the attribute and property `src` create a tag `<picture>` to address the loading of images, `src` represent the behavior of `img[src]` and `img[srcset]` so joint

### normal load

Insert the picture tag, only when the intercession happens.

```
<lazy-img src="/my-img.jpg"></lazy-img>

<picture>
	<img src="/my-img.jpg"/>
</picture>
```

### responsive charge

Insert the picture tag, only when the intercession happens.

```
<lazy-img src="/my-img2.jpg 520w, /my-img3.jpg 720w, /my-img.jpg"></lazy-img>

<picture>
	<source media="(min-width: 720px)" srcset="/my-img3.jpg"/>
	<source media="(min-width: 520px)" srcset="/my-img2.jpg"/>
	<img src="/my-img.jpg"/>
</picture>
```

> The use of picture vs img, picture allows you to add more rules on image selection, example type and it works better with responsive art direction.

### intercepted

every time that `lazy-img` is intercepted the attribute `intercepted` will be defined, for the generation of side effects, this can also be heard as an event.

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