Skip to content

Soya-xy/captcha

Repository files navigation

Canvas Captcha

This project was reconstructed into TypeScript based on jigsaw

Features

  • Local Image
  • Use TypeScript
  • Randomly select network pictures from picsum.photos

Use

install captcha

npm install @ldzn/js-captcha
# or
yarn add @ldzn/js-captcha
# or
pnpm install @ldzn/js-captcha

import captcha

import { captcha } from '@ldzn/js-captcha'
captcha({
  el: DOM,
  width: 100,
  height: 100,
  imgSrc:'',
  onSuccess() {
    console.log('success')
  },
  onFail() {
    console.log('err')
  },
  onRefresh() {
    console.log('refresh')
  }
})

then import style

import '@ldzn/js-captcha/style.css'

OR

 @import '@ldzn/js-captcha/style.css';

License

MIT License © 2022 Soya-xy

About

Use the canvas generated slider verification code/使用canvas生成的滑块验证码

Resources

License

Stars

Watchers

Forks

Packages

No packages published