0.0.9 • Published 5 years ago

@twoavy/image-comparer v0.0.9

Weekly downloads
-
License
-
Repository
github
Last release
5 years ago

image-comparer

A Vue component for comparing 2 images with a slider

Installation

yarn add @twoavy/image-comparer 
import ImageComparer from '@twoavy/image-comparer'

Usage

<image-comparer before="/img/before.png" after="/img/after.png" />

Props

NameTypeDefaultNote
beforestringrequiredupper/left image
afterstringrequiredlower/right image
afterLabelstring
afterLabelstring
offsetnumber0.5slider start pos
clickToMovebooleantruemove only on handle
handleWidthnumber60/30(horizontal/vertical)
handleHeightnumber30/60(horizontal/vertical)
orientationbooleanhorizontal

Events

@update

fired when slider moves. returns slider position

{ x: 0.2321, y: 0.9342 } // 0 <= value <= 1