# image-switcher

> Switch image on any event

Latest version **1.0.2** (published 2020-12-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install image-switcher
pnpm add image-switcher
yarn add image-switcher
bun add image-switcher
```

## 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.2 |
| Published | 2020-12-20 |
| First published | 2020-12-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Nebula Byte |
| Maintainers | nebula-byte |
| Keywords | image-switcher, node, npm, js |

## Links

- npm: https://www.npmjs.com/package/image-switcher
- Repository: https://github.com/nebula-byte/image-switcher
- Homepage: https://github.com/nebula-byte/image-switcher#readme
- Issues: https://github.com/nebula-byte/image-switcher/issues
- npm.io page: https://npm.io/package/image-switcher

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.2 (latest) — 2020-12-20
- 1.0.1 — 2020-12-20
- 1.0.0 — 2020-12-20

## README

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

# Image Switcher
![Image Switcher Screenshot](https://github.com/nebula-byte/nebula-byte-content/blob/main/image-switcher.gif)

Add image-switcher to toggle on action.

- No localStorage, only DOM

## Installation

```html
npm i image-switcher
```

## Usage

1. Load `image-switcher.min.js` at the foot of your page:

```html
<script src="image-switcher.js"></script>
```

2. Add ID to your image switch action:

```html
<a href="#" id="image-switcher-action">
    Switch image
</a>
```

3. Add image sources and class to your image tag to switch:

```html
<img class="image-switcher" src="images/1232.jpg" data-switch-src="images/1266.jpg">
```

3. Add animation on images from [animate.style](https://animate.style/):

```html
<a href="#" class="image-switch-animation" id="image-switcher-action">
    Switch image
</a>
<img class="image-switcher" src="images/1232.jpg" data-switch-src="images/1266.jpg" data-animation="bounce">
```

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