diff --git a/frontend/resources/wasm-playground/index.html b/frontend/resources/wasm-playground/index.html new file mode 100644 index 0000000000..9f7dd64d0b --- /dev/null +++ b/frontend/resources/wasm-playground/index.html @@ -0,0 +1,27 @@ + + + + + WASM Playground Home + + + +

WASM Playground Home

+ + + \ No newline at end of file diff --git a/render-wasm/docs/images/wasm_playground_renderer.png b/render-wasm/docs/images/wasm_playground_renderer.png new file mode 100644 index 0000000000..a3d3d78ffd Binary files /dev/null and b/render-wasm/docs/images/wasm_playground_renderer.png differ diff --git a/render-wasm/docs/test_playground.md b/render-wasm/docs/test_playground.md new file mode 100644 index 0000000000..890659c208 --- /dev/null +++ b/render-wasm/docs/test_playground.md @@ -0,0 +1,95 @@ +# WASM Playground + +We've created an isolated playground environment for rapid rendering testing. There are two types of playgrounds: + +- Shapes Playground +- Text Editor Playground + +## File Structure + +The playground files are located in: + +``` +frontend/resources/wasm-playground/ +├── clips.html +├── comparison.html +├── index.html +├── masks.html +├── paths.html +├── plus.html +├── rects.html +├── texts.html +└── js/ +``` + +Each HTML file is a separate playground demo. The `js/` directory contains shared JavaScript modules and utilities. + +## Shapes Playground + +- Run penpot locally +- Go to http://localhost:3449/wasm-playground/ +- The `index.html` page lists all available playgrounds for easy navigation. + +For the different kinds of shape playgrounds, you can set the amount of shapes you want to render each time by passing a query parameter. For example: + + http://localhost:3449/wasm-playground/texts.html?texts=300 + +This will render 300 text shapes. You can adjust the parameter for other playgrounds as well to control the number of shapes rendered. + +![WASM Playground Renderer](images/wasm_playground_renderer.png) + +### How to Add a New Playground Test + +1. **Create a new HTML file** in `frontend/resources/wasm-playground/` (e.g., `mytest.html`). +2. Use one of the existing playground HTML files as a template (such as `clips.html` or `comparison.html`). +3. Import the necessary modules from `js/lib.js` or other shared scripts. +4. Add your test logic in a `