A gruid Driver using syscall/js and wasm and HTML5 canvas.
|
Yon
38fc6dab26
cleanups and minor fix
No custom handling of fullscreen on F11 (we don't use the screenful script anymore). We now ensure that preventDefault is only called for things we actually use in gruid (so that F11 still works, but with the browser's default behavior). AppDivID option is no more, as it's no longer used. Also, fix "Backspace" key (was spelled wrongly). Some code simplifications, too, and update to latest gruid. |
||
|---|---|---|
| files | Put the gruid js Driver in its own module. | |
| .gitignore | Put the gruid js Driver in its own module. | |
| go.mod | cleanups and minor fix | |
| go.sum | cleanups and minor fix | |
| js.go | cleanups and minor fix | |
| LICENSE | add LICENSE | |
| README.md | update dependencies and README for release | |
gruid-js
The gruid-js module provides a gruid Driver for making wasm gruid applications that run in the browser. The module's package is called js.
To build a browser application, you have to build it with the following variables:
GOOS=js GOARCH=wasm go build -o app.wasm /path/to/your/application
Then, you have to serve using an http server a directory containing the
app.wasm file along with an index.html file such as the basic example one
in files/index.html (the html page containing the canvas of
your application). You also need to copy the wasm_exec.js support file
corresponding to your Go version, as explained in Go Wiki:
WebAssembly.