summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--WebInterface/wasm/asm-paint/Cargo.toml1
-rw-r--r--WebInterface/wasm/asm-paint/src/lib.rs11
2 files changed, 12 insertions, 0 deletions
diff --git a/WebInterface/wasm/asm-paint/Cargo.toml b/WebInterface/wasm/asm-paint/Cargo.toml
index c0a7c68..5713415 100644
--- a/WebInterface/wasm/asm-paint/Cargo.toml
+++ b/WebInterface/wasm/asm-paint/Cargo.toml
@@ -9,3 +9,4 @@ crate-type = ["cdylib"]
[dependencies]
wasm-bindgen = "0.2"
+web-sys = {version="0.3.22", features=["Window", "Document", "HtmlElement", "Node", "Element"]}
diff --git a/WebInterface/wasm/asm-paint/src/lib.rs b/WebInterface/wasm/asm-paint/src/lib.rs
index 52ddc8f..462a89d 100644
--- a/WebInterface/wasm/asm-paint/src/lib.rs
+++ b/WebInterface/wasm/asm-paint/src/lib.rs
@@ -12,5 +12,16 @@ extern "C" {
#[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>");
+
+ body.set_inner_html("oho");
}