comparison-slider
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

comparison-slider

Comparing two images. No dependencies.

Latest NPM release MIT License

Example

Usage

<div class="ComparisonSlider">
  <div
    class="ComparisonSlider__Before"
    style="background-image: url(./img-a.jpg)"
  ></div>
  <div
    class="ComparisonSlider__After"
    style="background-image: url(./img-b.jpg)"
  ></div>
</div>

Declare the height of the view.

.ComparisonSlider {
  width: 600px;
  height: 400px;
}

then...

As a module

import ComparisonSlider from 'comparison-slider';
const comparisonSlider = new ComparisonSlider();

in browser

<script src="path/to/comparison-slider.min.js"></script>
<script>
const comparisonSlider = new ComparisonSlider();
</script>

Package Sidebar

Install

npm i comparison-slider

Weekly Downloads

76

Version

1.2.0

License

MIT

Unpacked Size

39.7 kB

Total Files

20

Last publish

Collaborators

  • yomotsu