0.1.74 • Published 5 months ago

before-to-after v0.1.74

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Before to after

This package provides a simple way to create a before and after effect using two images. It allows you to easily create this effect by passing the container ID and an optional configuration object with the following parameters:

Installation

Install before-to-after with npm

  npm i before-to-after

Usage/Examples

Add container with the id btaContainer and inside add the img tag with the before-image and after-image id

<div id="btaContainer">
  <img src="/image-1.jpg" id="before-image" alt="" />
  <img src="/image-2.jpeg" id="after-image" alt="" />
</div>

create the instance of before-to-after

import beforeAfterEffect from 'before-to-after'

const bta = new beforeAfterEffect('btaContainer', {
  width: '500px',
  height: '300px',
  rangeInitialValue: '0',
  rangeInitialColor: '#000000'
})

Object conf is optional.

API Reference

ParameterTypeDescription
widthstringoptional. Specifies the width of the container element. Default value: '500px'.
heightstringoptional. Specifies the height of the container element. Default value: '300px'
rangeInitialValuestringoptional. Sets the initial value of the position. Default value: '50'.
rangeInitialColorstringoptional. Defines the initial color of the range input. Default value: '#000000'.

Authors

Support

For support, email bis.arroyo@gmail.com

0.1.74

5 months ago

0.1.71

5 months ago

0.1.72

5 months ago

0.1.73

5 months ago

0.1.7

5 months ago

0.1.2

5 months ago

0.1.1

5 months ago

0.1.4

5 months ago

0.1.3

5 months ago

0.1.6

5 months ago

0.1.5

5 months ago

0.1.0

5 months ago