0.1.0 • Published 2 years ago

@kisstar/slide-unlock v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

slide-unlock

Demo

A JavaScript library that provides sliding unlocking.

Usage

Provide an HTML element as the mount point:

<div id="slider-container"></div>

Introduce scripts and styles, and then create slider applications:

import SlideUnlock from '@kisstar/slide-unlock';
// You can also directly import SCSS files to create different themes
// The example here imports CSS files directly
import '@kisstar/slide-unlock/dist/slide-unlock.css';

const slideUnlock = new SlideUnlock({
  // Options
});

slideUnlock.init();
slideUnlock.mount('#slider-container');

Options

Configuration itemTypeExplainDefault
widthstringSlider width.'100%'
heightstringSlider height.'100%'
placeholderstringPlaceholder for slider.'Please drag the slider to the right'
messagestringText displayed after unlocking.'Unlock succeeded'
successFunctionCallback after unlocking.
prefixstringPrefix for all styles.'ks'
durationnumberTransition time for slider reset.500ms

Development scripts

# runs the app in the development mode
npm start

# verify the code format and syntax in the project
npm run lint

# write a more friendly commit message
npm run commit

License

MIT