Skip to content

Commit 6376ec2

Browse files
committed
Added 2D NBody WASM sim with demo
1 parent 2e9c5bd commit 6376ec2

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

index.html

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ <h1 class="title is-1 pb-6">
180180
<div class="container">
181181
<h1 class="title is-1"><a name="showcase">#</a> Showcase</h1>
182182
<br>
183-
<p class="subtitle is-4">Made something cool with <b>wgpu</b>? <a href="https://github.com/gfx-rs/wgpu-rs.github.io">Make a PR</a>, and reach out to us on <a href="https://matrix.to/#/#wgpu-users:matrix.org">#wgpu-users</a>!</p>
183+
<p class="subtitle is-4">Made something cool with <b>wgpu</b>? <a
184+
href="https://github.com/gfx-rs/wgpu-rs.github.io">Make a PR</a>, and reach out to us on <a
185+
href="https://matrix.to/#/#wgpu-users:matrix.org">#wgpu-users</a>!</p>
184186
<br>
185187

186188
<div id="showcase_container"></div>
@@ -223,6 +225,12 @@ <h1 class="title is-1"><a name="showcase">#</a> Showcase</h1>
223225
"website": "https://bevyengine.org/",
224226
"thumbnail": "screenshots/bevy.gif",
225227
},
228+
{
229+
"name": "WASM nbodysim",
230+
"description": "Realtime 2D WASM N-Body-Simulation",
231+
"website": "https://github.com/simbleau/nbody-wasm-sim",
232+
"thumbnail": "screenshots/nbodywasm.gif",
233+
},
226234
{
227235
"name": "nbodysim",
228236
"description": "Realtime 3D N-Body-Simulation",
@@ -370,7 +378,7 @@ <h1 class="title is-1"><a name="showcase">#</a> Showcase</h1>
370378
];
371379

372380
// Showcase Card Template
373-
const showcase_template = ({name, description, website, thumbnail}) => {
381+
const showcase_template = ({ name, description, website, thumbnail }) => {
374382
// Providing fallback formats for Safari
375383
const file_ext_pos = thumbnail.lastIndexOf(".");
376384
const file_name = thumbnail.slice(0, file_ext_pos);
@@ -405,15 +413,15 @@ <h1 class="title is-1"><a name="showcase">#</a> Showcase</h1>
405413

406414
const showcase_container = document.getElementById("showcase_container");
407415

408-
for (let {name, description, website, thumbnail} of showcase_list) {
416+
for (let { name, description, website, thumbnail } of showcase_list) {
409417
showcase_container.insertAdjacentHTML("beforeend", showcase_template({
410-
name,
411-
description,
412-
website,
413-
thumbnail
414-
}));
418+
name,
419+
description,
420+
website,
421+
thumbnail
422+
}));
415423
}
416424
</script>
417425
</body>
418426

419-
</html>
427+
</html>

screenshots/nbodywasm.webp

1.36 MB
Binary file not shown.

0 commit comments

Comments
 (0)