-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
14e9396
commit b474811
Showing
13 changed files
with
726 additions
and
7,574 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Gruntfile.js | ||
test/test.js | ||
test/testDeps | ||
test/**/*.js | ||
webpack.config.js | ||
lib/ | ||
examples/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,6 @@ examples/__test | |
p5soundnotes | ||
*.DS_Store | ||
.vscode | ||
coverage | ||
coverage | ||
yarn-error.log | ||
debug.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,53 +9,85 @@ | |
[![codecov](https://codecov.io/gh/doriclaudino/p5.drawer/branch/master/graph/badge.svg)](https://codecov.io/gh/doriclaudino/p5.drawer) | ||
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier) | ||
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/doriclaudino/p5.drawer/issues) | ||
<img alt="npm bundle size" src="https://img.shields.io/bundlephobia/min/p5.drawer"> | ||
|
||
### Install (CDN) | ||
|
||
<br> | ||
<br> | ||
Create a drawer animation emulating Scribit, AxiDraw extremely easy. | ||
<br> | ||
<div> | ||
<img src="https://i.imgur.com/emokMlD.png" width="200"> | ||
<img src="https://imgur.com/AevdDH0.png" width="200"> | ||
<img src="https://imgur.com/nbt0qGb.png" width="200"> | ||
</div> | ||
```html | ||
<!-- option one jsdelivr--> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/p5.drawer.min.js"></script> | ||
|
||
<!-- option two githack--> | ||
<script src="https://raw.githack.com/doriclaudino/p5.drawer/master/dist/p5.drawer.min.js"></script> | ||
|
||
<!-- | ||
option three local source | ||
downloading from: https://github.com/doriclaudino/p5.drawer/blob/master/dist/p5.drawer.min.js --> | ||
<script src="../p5.drawer.min.js"></script> | ||
``` | ||
|
||
### Install (NPM) | ||
|
||
```bash | ||
npm install p5.drawer | ||
or | ||
yarn install p5.drawer | ||
``` | ||
|
||
### Requirements | ||
### Requirements (CDN) | ||
|
||
```bash | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.10.2/p5.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.10.2/addons/p5.sound.js"></script> | ||
``` | ||
|
||
### Install | ||
### Requirements (NPM) | ||
|
||
```bash | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/p5.drawer.min.js"></script> | ||
or | ||
<script src="https://raw.githack.com/doriclaudino/p5.drawer/master/dist/p5.drawer.min.js"></script>; | ||
npm install p5 | ||
or | ||
import 'p5.drawer' | ||
yarn install p5 | ||
``` | ||
|
||
**Start coding!** | ||
|
||
[p5.drawer sketch](https://editor.p5js.org/doriclaudino/sketches/5UUjoEKRx) | ||
<br> | ||
<br> | ||
|
||
```bash | ||
createDrawer(image,audio,position); | ||
**Checkout our example on [editor.p5js.org](https://editor.p5js.org/doriclaudino/sketches/5UUjoEKRx)** | ||
|
||
```javascript | ||
//main function to create a drawer | ||
createDrawer([image], [audio], [position]); | ||
//main function to move your drawer around | ||
myDrawer.moveTo(mouseX, mouseY, [speed]); | ||
|
||
//on Preload | ||
//load images on preload | ||
let myDrawer; | ||
function preload() { | ||
let img = loadImage('image_path') | ||
let sound = loadSound('sound_path') | ||
let pos = createVector(20,20) | ||
|
||
myDrawer = createDrawer(img,sound,pos); | ||
let img = loadImage('image_path'); | ||
let sound = loadSound('sound_path'); | ||
let pos = createVector(20, 20); | ||
|
||
//create the drawer | ||
myDrawer = createDrawer(img, sound, pos); | ||
} | ||
|
||
function draw() { | ||
myDrawer.moveTo(mouseX, mouseY); | ||
} | ||
``` | ||
|
||
### Images from our sketch | ||
|
||
Create a drawer animation emulating Scribit, AxiDraw extremely easy. | ||
|
||
<div> | ||
<img src="https://i.imgur.com/emokMlD.png" width="200"> | ||
<img src="https://imgur.com/AevdDH0.png" width="200"> | ||
<img src="https://imgur.com/nbt0qGb.png" width="200"> | ||
</div> | ||
|
||
### Gifs from our sketch | ||
|
||
![](https://media.giphy.com/media/U3hHR6jI6XbOfdH9Ka/giphy.gif) | ||
|
||
### Features | ||
|
@@ -67,25 +99,45 @@ function preload() { | |
- Center images | ||
- Save internal steps | ||
|
||
### Importing library | ||
##Development | ||
[Fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) this project | ||
|
||
You can import our library for testing purpose or to use on web: | ||
```javascript | ||
import 'p5' //make sure you expose p5 or import somewhere | ||
import 'p5.drawer' //extend p5 prototype and expose our methods everywhere | ||
``` | ||
```bash | ||
#use yarn or npm | ||
#install all deps | ||
yarn | ||
|
||
Additionally, you can use the cdn compile version [(ready-to-copy example)](https://editor.p5js.org/doriclaudino/sketches/5UUjoEKRx): | ||
```javascript | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/p5.drawer.min.js"></script> | ||
#auto-reload watch files src files, tests files | ||
#serve example at http://localhost:8000/ | ||
#serve test at http://localhost:8000/test/ | ||
yarn dev | ||
|
||
#clean and run new tests with coverage artifacts | ||
yarn test | ||
|
||
#final build version with optimizations | ||
yarn build | ||
|
||
or using githack | ||
|
||
<script src="https://raw.githack.com/doriclaudino/p5.drawer/master/dist/p5.drawer.min.js"></script>; | ||
### continuos integrations | ||
|
||
#validate our ci configs | ||
yarn ci:validate | ||
|
||
#execute local ci using our config, it will fail on coverage | ||
yarn ci:executeLocal | ||
``` | ||
|
||
## Resources | ||
|
||
## Credits | ||
- [Grunt](https://github.com/gruntjs/grunt-cli) | ||
- [Webpack](https://github.com/webpack/webpack) | ||
- [p5.js](https://github.com/processing/p5.js) | ||
- [p5.js-sound](https://github.com/processing/p5.js-sound) | ||
|
||
## References and Inspiration | ||
|
||
Projects started using typescript-library-starter | ||
- p5.js-sound. Licensed under The MIT License (MIT). [github](https://github.com/processing/p5.js-sound) | ||
- Daniel Shiffmmann @shiffmann [github](https://github.com/shiffman) | ||
- Stefano Padoan @stefanopadoan.art [instagram](https://www.instagram.com/stefanopadoan.art/) | ||
- Samer Dabra @spongenuity [instagram](https://www.instagram.com/spongenuity/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.