Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/thoughtscript/exp_whiteboard_js_2023

Experiments with the Canvas API
https://github.com/thoughtscript/exp_whiteboard_js_2023

canvas html5 javascript

Last synced: about 2 months ago
JSON representation

Experiments with the Canvas API

Awesome Lists containing this project

README

        

# exp_whiteboard_js

[![](https://img.shields.io/badge/Canvas-API-orange.svg)](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API)

An experiment to get more acquainted with the [Canvas API](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API) (I was looking into this a long time ago and wanted to revisit this topic).

I was also concerned by the lack of simple drawing tools and found the following example inspiring: https://github.com/os1ma/handwriting-canvas/blob/main/LICENSE. Whole companies and websites have launched to do this kind of thing and I was surprised at how easy it is to implement from scratch.

Good to practice proper Library and SDK design.

## Use

### Drawing

1. Use your mouse to draw lines, curves, etc.
2. **Hold-Down** the **Left-Mouse-Button** to do so.

### Erase

1. Select **Erase**.
1. Use your mouse to erase specific parts of your drawings.
2. **Hold-Down** the **Left-Mouse-Button** to do so.

> Select **Erase** again to draw once more!

### Clear the Whiteboard (Entirely)

1. Select **Clear** to reset the page/return it to its blank state.

### Save

1. Select **Save** to download your drawing.
2. (You can import these or use them to generate an inventory of Machine Learning items for [Numpy](https://numpy.org/) - say for Image Recognition).