1.0.0 • Published 11 months ago

@kiefer/scratch v1.0.0

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

@kiefer/scratch

A smooth and easy-to-use canvas scratch card component

Using this package

Run the following command:

npm install @kiefer/scratch

Learn more about this package at our Doc Page

API

AttritubeTypeDescriptionDefault
idstringThe id of canvas DOMscratch-card
widthnumberThe width of canvas DOM-
heightnumberThe height of canvas DOM-
availablebooleanIf it's available to scratchtrue
finishTransitionbooleanIf the transition is enabled when it's finishedtrue
coverstringCover image of scratch card-
thresholdnumberThreshold to finish scratching automatically0.95
fadeDurationnumberDuration for cover fade out1
scratchRadiusnumberRadius while scratching15
fillStylenumberFillStyle under img#fff
onFill() => voidCallback when fillArea-
onFinishStart() => voidCallback when finish transition start-
onFinish() => voidCallback when scratching finished-
1.0.0

11 months ago

0.0.1

11 months ago