Coder Social home page Coder Social logo

1587315093 / scratch-card Goto Github PK

View Code? Open in Web Editor NEW
163.0 1.0 10.0 3.57 MB

canvas实现的 react 刮刮卡组件,可用于刮奖与刮刮乐等业务; The react scratch card component implemented by canvas can be used for scratch-off and scratch-off games and other businesses

Home Page: https://1587315093.github.io/scratch-card/

License: MIT License

JavaScript 6.45% TypeScript 89.24% Less 2.97% Shell 1.34%
canvas react reactjs

scratch-card's Introduction

ScratchCard 刮刮卡(React 版)

NPM version NPM downloads GitHub

card

使用

欢迎提交 issuepr~

$ npm install scratch-card-react
# or
$ yarn add scratch-card-react
# or
$ pnpm install scratch-card-react

属性

属性 说明 类型 默认值
classNames 语义结构化的 className { root?:string, mask?:string, body?:string } -
children 刮开蒙层显示的底部元素 ReactNode -
coverColor 刮刮卡蒙版的颜色 string #ddd
coverImg 刮刮卡蒙版的图片 string | Promise<any> -
callbackInfo 刮开一定比例触发的回调信息 { callback:()=>void,ratio:number } -
width 刮刮卡宽度 number 240
height 刮刮卡高度 number 120

Ref

属性 说明 类型
canvasContainer canvas 节点 HTMLCanvasElement
initDone 初始化完成 boolean
clearCard 清除蒙版 ()=>void

开发

# install dependencies
$ pnpm install

# dev
$ pnpm dev

# push package
$ pnpm publish

LICENSE

MIT

scratch-card's People

Contributors

1587315093 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

scratch-card's Issues

比例单词radio拼写错误

callbackInfo 刮开一定比例触发的回调信息 { callback:()=>void,radio:number },“radio”拼写错误,应该为ratio

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.