Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/brecert/doodlepad

good doodles
https://github.com/brecert/doodlepad

canvas javascript

Last synced: 3 days ago
JSON representation

good doodles

Awesome Lists containing this project

README

        

# DoodlePad
> good doodle pad

A simple doodle pad to use with canvas contexes

## Demo
[demo](https://brecert.github.io/doodlepad/)

## Notes

Make sure the canvas container has this css applied to it

```
touch-action: none;
```

to prevent strokes from being mis-inputed and cancelled

## Example
```js
import { PaintingContext } from 'https://unpkg.com/doodlepad'

const canvas = document.createElement('canvas')
canvas.width = window.innerWidth
canvas.height = window.innerHeight

const ctx = canvas.getContext('2d')
const paint = new PaintingContext(ctx)

paint.strokeSize = 5
paint.strokeSmoothing = 0.5

document.body.appendChild(canvas)
```