double_pendulum_wasm/lib.rs
1//! WASM implementation of a double pendulum simulation
2//!
3//! See README.md for installation / build instructions.
4//! This implementation is just a stub for now.
5
6use wasm_bindgen::prelude::*;
7
8#[wasm_bindgen(start)]
9fn main() -> Result<(), JsValue> {
10 let window = web_sys::window().expect("No global `window` exists");
11 let document = window.document().expect("No `document` on `window`");
12 let body = document.body().expect("Document should have a body");
13
14 let content = document.create_element("p")?;
15 content.set_inner_html("Hoi vanuit rust!");
16
17 body.append_child(&content)?;
18
19 Ok(())
20}