Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zhangking/sharingan
https://github.com/zhangking/sharingan
canvas screenshot
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/zhangking/sharingan
- Owner: zhangking
- Created: 2017-06-17T08:20:40.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-13T12:59:11.000Z (over 7 years ago)
- Last Synced: 2024-09-15T14:35:33.973Z (2 months ago)
- Topics: canvas, screenshot
- Language: JavaScript
- Size: 1.61 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sharingan
use html5canvas
copy the screen and draw something
[demo](https://zhangking.github.io/sharingan/docs/)
### params
| name | desc | type | default |
| --- | --- | --- | --- |
| type | type of drawing , one of `pen` `line` `rect` `circle` | `string` | `pen` |
| color | color of drawing | `string` | `red` |
| linewidth | width of line | `number` | `2` |
| style | style of drawing | `string` | `stroke` |
| scale | scale | `number` | 1 |
| element | the element to copy | `element` | - |
| target | the target canvas | `element` | - |### usage
```html
```
```javascript
import Sharingan from "sharingan";var s;
function takeScreenshot() {
s = new Sharingan({
scale: 0.6,
element: document.getElementById('container'),
target: document.getElementById('target')
});
s.catch(function(target){});
}```
### License
MIT