Very inspired and copy some code from zfedoran/pixel-sprite-generator
// npm
npm install pixel-mask-generator --save
const pmg = require('pixel-mask-generator')
// Bower
bower install pixel-mask-generator --save
<script src="bower_components/pixel-mask-generator/dist/index.js"></script>
const mask = new pmg.Mask([
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 1,
0, 0, 0, 0, 1, -1,
0, 0, 0, 1, 1, -1,
0, 0, 0, 1, 1, -1,
0, 0, 1, 1, 1, -1,
0, 1, 1, 1, 2, 2,
0, 1, 1, 1, 2, 2,
0, 1, 1, 1, 2, 2,
0, 1, 1, 1, 1, -1,
0, 0, 0, 1, 1, 1,
0, 0, 0, 0, 0, 0
], 6, true, false)
const sprite = new pmg.Sprite(mask)
sprite.generate()
// resize and append
const resizedSpriteCanvasEle = pmg.util.resize(sprite.canvas, 10)
const body = document.body
body.appendChild(resizedSpriteCanvasEle)- Compatible with all browsers
- Unit test: add more tests
- Automated scripts: browser compatibility test
- Automated scripts: deploy to
gh-pages - Branch: split code from
masterandgh-pages - Dependency: split
static/random.jsto another repository - Dependency: split
resizefunction to another repository - Mask: add more masks
- Demo: update demo page
- Coverage: increase coverage threshold
- Article: copy original article into the repo, in case the site and mirror are down
- Algorithm: change algorithm toward to the original, should be symmetrical
$ npm install -g semantic-release-cli
$ semantic-release-cli setup
Using above command to setup "semantic-release"
- Fork the repo
- Install
Node.jsand dependencies - Make a branch for your change and make your changes
- Run
git add -Ato add your changes - Run
npm run commit(don't usegit commit) - Push your changes with
git pushthen create Pull Request