Skip to content

Commit

Permalink
feat(sdfsdf): sdfsdf
Browse files Browse the repository at this point in the history
  • Loading branch information
Gar committed Feb 26, 2017
1 parent b44d89c commit ba8a7ec
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 47 deletions.
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ <h3>Preview Masking effects using handwrite.js</h3>
</div>
</div>

<div id="root"></div>


</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.19.1/TweenMax.min.js"></script>
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@
"testEnvironment": "jsdom"
},
"dependencies": {
"signals": "1.0.0"
"signals": "1.0.0",
"react": "15.4.2",
"react-dom": "15.4.2"
},
"author": "Gar Liu <[email protected]> (http://lonelydatum.com/)",
"license": "MIT",
Expand Down
16 changes: 16 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React, { Component } from 'react';
import styles from './index.css'


export class App extends Component {
render() {
return (
<div className={styles.main}>

</div>
);
}
}


export default App;
6 changes: 0 additions & 6 deletions src/Handwrite.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,12 @@ class Handwrite {


drawArt() {

this.ctxArt.clearRect(0, 0, this.WIDTH, this.HEIGHT)
this.ctxArt.drawImage(this.canvasMask, 0, 0);

this.ctxArt.save();

this.ctxArt.globalCompositeOperation = 'source-in';

this.ctxArt.drawImage(this.image, 0, 0);

this.ctxArt.restore();

}

render() {
Expand Down
26 changes: 6 additions & 20 deletions src/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Capture from './Capture.js'
import Handwrite from './Handwrite.js'



const dragTarget = document.getElementById('dragTarget');
const captureCanvas = document.getElementById('captureCanvas');
const captureImage = document.getElementById('captureImage');
Expand All @@ -29,6 +30,7 @@ class Dev {
this.brush = brushSize.value
this.image = null

console.log(localStorage);
if(localStorage.length>0) {
this.updateFromLocal()
this.ready()
Expand All @@ -41,14 +43,17 @@ class Dev {
brushSize.addEventListener('change', ()=>this.brushUpdate(brushSize.value))
drawButton.addEventListener('click', this.draw.bind(this), false )
undo.addEventListener('click', this.undo.bind(this))
startOver.addEventListener('click', this.capture.startOver.bind(this.capture) )

}

ready() {
console.log(this.points);
this.capture = new Capture(captureCanvas, brushSize.value, this.points)
this.handwrite = new Handwrite(renderCanvas, renderImage)

this.capture.signals.pointsUpdated.add(this.pointsUpdated)
startOver.addEventListener('click', this.capture.startOver.bind(this.capture) )

this.loadImage(this.image)
this.pointsUpdated(this.points);
this.brushUpdate(this.brush)
Expand Down Expand Up @@ -102,24 +107,5 @@ class Dev {

}





















export default new Dev()
3 changes: 3 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.main {

}
20 changes: 0 additions & 20 deletions webpack.config.utilities.babel.js

This file was deleted.

0 comments on commit ba8a7ec

Please sign in to comment.