Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/strohel/wasmrain
Simple rain simulation as web app written in Rust compiled into WebAssembly (WASM), thus running in browsers.
https://github.com/strohel/wasmrain
demo rust webassembly
Last synced: 3 days ago
JSON representation
Simple rain simulation as web app written in Rust compiled into WebAssembly (WASM), thus running in browsers.
- Host: GitHub
- URL: https://github.com/strohel/wasmrain
- Owner: strohel
- Created: 2020-10-24T14:59:27.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-24T15:33:42.000Z (over 4 years ago)
- Last Synced: 2024-11-29T22:49:31.211Z (2 months ago)
- Topics: demo, rust, webassembly
- Language: Rust
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WASM Rain: Rain Simulation in Rust
A simple web app written in Rust compiled into WASM, thus running in browsers.
Demo: https://storage.googleapis.com/strohel-pub/wasmrain/index.html
## Build
1. `cargo build --target wasm32-unknown-unknown [--release]`
2. `wasm-bindgen --target web --no-typescript --out-dir target target/wasm32-unknown-unknown/debug/wasmrain.wasm`
- Replace `debug`by `release` if you are using the release build.Note that building requires the solver from https://github.com/strohel/snapwater
which is not currently public. Feel free to ping me.Deploy (for me):
1. `gsutil -h "Cache-Control:no-cache,max-age=0" cp index.html gs://strohel-pub/wasmrain/`
2. `gsutil -h "Cache-Control:no-cache,max-age=0" cp target/wasmrain.js target/wasmrain_bg.wasm gs://strohel-pub/wasmrain/target/`## Resources
- https://dev.to/dandyvica/wasm-in-rust-without-nodejs-2e0c
- https://rustwasm.github.io/docs/wasm-bindgen/examples/without-a-bundler.html
- https://rustwasm.github.io/docs/book/introduction.html