Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/maxulyanov/ImageComparison

Slider to quickly compare two images
https://github.com/maxulyanov/ImageComparison

compare compare-images css css3 dom es6 imagecomparison javascript plugin slide slider vanilla-js

Last synced: 2 months ago
JSON representation

Slider to quickly compare two images

Awesome Lists containing this project

README

        

ImageComparison
[![npm](https://img.shields.io/npm/dt/image-comparison.svg)](https://www.npmjs.com/package/image-comparison)
[![npm](https://img.shields.io/npm/v/image-comparison.svg)](https://www.npmjs.com/package/image-comparison)
===============
Slider to quickly compare two images

## Install
```bash
$ npm install image-comparison --save
```

## Connection
### JavaScript
#### CommonJS
```js
import { ImageComparison } from 'image-comparison';
```
#### AMD
```js
require(['ImageComparison'], function (ImageComparison) {
// Usage
});
```
### CSS
```html

```

## Usage
```html

new ImageComparison({
container: containerSelector,
startPosition: 70,
data: [
{
image: images[0],
label: 'before'
},
{
image: images[1],
label: 'after'
}
],
});

```

## Options
Options list:


Name
Description


container
Dom element for initialization ImageComparison


startPosition
starting position in percentage


data
Array of objects, where each object: `{ image: dom element, label: 'before'}`

## Browsers support
Chrome, FF, Opera, Safari, IE10+

## Example
See example - ImageComparison