summaryrefslogtreecommitdiff
path: root/WebInterface/wasm/asm-paint/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'WebInterface/wasm/asm-paint/src/lib.rs')
-rw-r--r--WebInterface/wasm/asm-paint/src/lib.rs16
1 files changed, 5 insertions, 11 deletions
diff --git a/WebInterface/wasm/asm-paint/src/lib.rs b/WebInterface/wasm/asm-paint/src/lib.rs
index 462a89d..b6a5840 100644
--- a/WebInterface/wasm/asm-paint/src/lib.rs
+++ b/WebInterface/wasm/asm-paint/src/lib.rs
@@ -8,20 +8,14 @@ macro_rules! console_log {
extern "C" {
#[wasm_bindgen(js_namespace = console)]
fn log(s: &str);
+
+ #[wasm_bindgen(js_namespace = document)]
+ fn write(s: &str);
}
#[wasm_bindgen(start)]
pub fn entry() {
- use web_sys;
- console_log!("hello {} wasm", 42);
-
- let window = web_sys::window().unwrap();
-
- let document = window.document().unwrap();
-
- let body = document.body().unwrap();
-
- //body.set_inner_html("<marquee><h1 style='font-size: 100px'>Hello from WASM</h1></marquee>");
+ console_log!("hello {} wasm", 44);
- body.set_inner_html("oho");
+ write("gooo");
}