Coder Social home page Coder Social logo

520hacker / wipe Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leiroc/wipe

0.0 2.0 0.0 519 KB

Wipe是一款基于HTML5 canvas的移动端,涂抹,自动播放涂抹轨迹,刮刮乐的插件。(The movement of the wiper is a based on HTML 5 canvas, daub, automatic playback daub trajectory, scratch music plug-in.)

License: Other

HTML 27.51% JavaScript 72.49%

wipe's Introduction

#BUG Fixed

BY ydq

https://github.com/ydq

2016-08-03

  • 修复reset方法会导致canvas直接全部被涂抹清空的问题
  • 修复resetwipe不能绘制一个点的问题(触摸点击一下不移动产生的数据)
  • 修改onswiping,回调新增了一个参数,可以获取最后一次涂抹的数据
  • 优化合并部分逻辑判断
  • 新增了一个可以同步显示涂抹的demo

==========

  • 合并了 wipe.js 和 canvas.js
  • fixed wipe_img bug

wipe

Wipe是一款基于HTML5 canvas的移动端,涂抹,自动播放涂抹轨迹,刮刮乐的插件。可以轻松实现,涂抹,记录涂抹轨迹自动播放。

#1 使用说明

###html

<script src="../src/wipe.js"></script> 其中已经合并到 wipe.js中的 canvas.js是CanvasRenderingContext2D.prototype.扩展库。方便链式操作。 ###css #wipe { margin: 10px auto; width: 300px; height: 430px; background: url(img/girl.jpg) no-repeat; background-size: 100% 100%; } canvas { opacity: 0.9; }

css其实只是指定canvas后面的世界,和canvas的大小;

PS 需要指定宽度和高度

###js var wipe = new Wipe({ el: '#wipe', fg: '#ccc', size: 50, debug: false, autoWipe: false, data: null, onswiping: function (percent) { //do something 涂抹回调函数 } })

#2 演示 就是这么简单,开始玩起来吧! ###1、默认 http://v5cy.cn:8088/git/wipe/demo/wipe_default.html ###2、自动涂抹,需要生成轨迹 http://v5cy.cn:8088/git/wipe/demo/auto_wipe.html ###3、涂抹图片 http://v5cy.cn:8088/git/wipe/demo/wipe_img.html

###4、实时演示 http://v5cy.cn:8088/git/wipe/demo/wipe_sync.html

###轨迹生成方法: 打开debug,autoWipe=false,然后会在控制台输出数据轨迹,copy下来,放入 data中即可!

wipe's People

Contributors

leiroc avatar ydq avatar lephy avatar

Watchers

James Cloos avatar Odin Luo 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.