Skip to content

Commit

Permalink
colors
Browse files Browse the repository at this point in the history
  • Loading branch information
Gar committed Mar 6, 2017
1 parent 2372053 commit 9132984
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 48 deletions.
13 changes: 9 additions & 4 deletions dist/index.umd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.umd.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.umd.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.umd.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"main.js": "./static/js/main.dc6ffe13.js",
"main.js.map": "./static/js/main.dc6ffe13.js.map"
"main.js": "static/js/main.3642a99f.js",
"main.js.map": "static/js/main.3642a99f.js.map"
}
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.css" rel="stylesheet"><link href="https://fonts.googleapis.com/css?family=Fredericka+the+Great" rel="stylesheet"><link href="https://fonts.googleapis.com/css?family=Diplomata+SC" rel="stylesheet"><link href="https://fonts.googleapis.com/css?family=Sirin+Stencil" rel="stylesheet"><link href="https://fonts.googleapis.com/css?family=Arvo" rel="stylesheet"><link rel="shortcut icon" href="/handwrite/favicon.ico"><title>npm install handwrite</title></head><body><div id="root"></div><script type="text/javascript" src="/handwrite/./static/js/main.dc6ffe13.js"></script></body><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/styles/default.min.css"><script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/highlight.min.js"></script><script>hljs.initHighlightingOnLoad()</script></html>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.css" rel="stylesheet"><link href="https://fonts.googleapis.com/css?family=Fredericka+the+Great" rel="stylesheet"><link href="https://fonts.googleapis.com/css?family=Diplomata+SC" rel="stylesheet"><link href="https://fonts.googleapis.com/css?family=Sirin+Stencil" rel="stylesheet"><link href="https://fonts.googleapis.com/css?family=Arvo" rel="stylesheet"><link rel="shortcut icon" href="/handwrite/favicon.ico"><title>npm install handwrite</title></head><body><div id="root"></div><script type="text/javascript" src="/handwrite/static/js/main.3642a99f.js"></script></body><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/styles/default.min.css"><script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/highlight.min.js"></script><script>hljs.initHighlightingOnLoad()</script></html>
32 changes: 32 additions & 0 deletions docs/static/js/main.3642a99f.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/static/js/main.3642a99f.js.map

Large diffs are not rendered by default.

31 changes: 0 additions & 31 deletions docs/static/js/main.dc6ffe13.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/static/js/main.dc6ffe13.js.map

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "handwrite",
"version": "1.7.0",
"version": "1.8.2",
"description": "creates masking effect that looks like handwriting",
"main": "dist/index.umd.js",
"scripts": {
Expand Down
17 changes: 13 additions & 4 deletions src/Handwrite.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class Handwrite {

if(pos) {
this.drawArt(pos, this.options.brushSize)

} else {

this.onDoneForever()
Expand Down Expand Up @@ -70,10 +71,17 @@ class Handwrite {


drawArt(pos) {
Circle(this.ctxMask, pos.x, pos.y, this.options.brushSize)
if(this.options.cleanFromBehind) {
this.ctxMask.fillRect(0,0,pos.x-30, this.HEIGHT)
if(pos){
Circle(this.ctxMask, pos.x, pos.y, this.options.brushSize)

if(this.options.cleanFromBehind) {
this.ctxMask.fillRect(0,0,pos.x-30, this.HEIGHT)
}
}




this.ctxArt.clearRect(0, 0, this.WIDTH, this.HEIGHT)
this.ctxArt.drawImage(this.canvasMask, 0, 0);
this.ctxArt.save();
Expand All @@ -84,10 +92,11 @@ class Handwrite {

onDoneForever() {
if(this.options.cleanUpWhenDone) {
this.ctxMask.fillStyle = "#31B131"
this.ctxMask.fillRect(0,0,this.WIDTH, this.HEIGHT)
this.drawArt()
}
clearInterval(this.interval)
// this.drawArt()
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/dev.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9132984

Please sign in to comment.