Coder Social home page Coder Social logo

libin1991 / scratchcard Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yuezi32/scratchcard

0.0 0.0 0.0 50 KB

刮刮卡,一张刮刮卡竟包含这么多前端知识点,canvas刮刮乐

Home Page: https://juejin.im/post/5d8a3d62e51d45780f060490

HTML 16.18% JavaScript 83.82%

scratchcard's Introduction

scratchcard

刮刮卡

使用方法

new ScratchCard({
    canvas: document.getElementById('canvas'),
    coverImg: 'scratch-2x.jpg',
    pixelRatio: 2,
    doneCallback: function() {
      console.log('done')
    }
});
参数 说明 默认
canvas canvas元素 null
showAllPercent 直接全部刮开的百分比 65
coverImg 图片图层 null
coverColor 纯色图层,例如:#cccccc。如果图片图层值不为null,则纯色图层无效 null
doneCallback 全部刮开回调 null
radius 屏幕倍数 20
pixelRatio 屏幕倍数 1
fadeOut 展现全部的淡出效果时间(ms) 2000

scratchcard's People

Contributors

yuezi32 avatar

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.