summaryrefslogtreecommitdiff
path: root/WebInterface/wasm/asm-paint/src/lib.rs
blob: 462a89d69c39727abfac586e1f12bd0360f72192 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use wasm_bindgen::prelude::*;

macro_rules! console_log {
    ($($t:tt)*) => (log(&format_args!($($t)*).to_string()))
}

#[wasm_bindgen]
extern "C" {
    #[wasm_bindgen(js_namespace = console)]
    fn log(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>");

    body.set_inner_html("oho");
}