Skip to content

Latest commit

 

History

History
56 lines (44 loc) · 852 Bytes

README.md

File metadata and controls

56 lines (44 loc) · 852 Bytes

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