Skip to content

Commit

Permalink
Commit a WASM build for GH Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
sulami committed Apr 17, 2024
1 parent c15047b commit 11aaeec
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ https://github.com/sulami/three-bodies/assets/1843193/d8a41847-a475-46c8-8eb9-39

## Building

For the native version, run

```sh
cargo run --release
```

For the wasm version, run

```sh
cargo build --target wasm32-unknown-unknown --release
cp target/wasm32-unknown-unknown/release/three-bodies.wasm wasm/
```
29 changes: 29 additions & 0 deletions wasm/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<html lang="en">

<head>
<meta charset="utf-8">
<title>Three Bodies</title>
<style>
html,
body,
canvas {
margin: 0px;
padding: 0px;
width: 100%;
height: 100%;
overflow: hidden;
position: absolute;
background: black;
z-index: 0;
}
</style>
</head>

<body>
<canvas id="glcanvas" tabindex='1'></canvas>
<!-- Minified and statically hosted version of https://github.com/not-fl3/macroquad/blob/master/js/mq_js_bundle.js -->
<script src="mq_js_bundle.js"></script>
<script>load("three-bodies.wasm");</script>
</body>

</html>
Loading

0 comments on commit 11aaeec

Please sign in to comment.