-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
77 lines (58 loc) · 1.79 KB
/
index.html
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
<title>Ekke - Main</title>
<style type="text/css">
#applications
{
width: 100%;
display: flex;
}
.application-button
{
border: dashed 2px white;
padding: 1rem;
}
</style>
</head>
<body>
<h1>Ekke Application Framework</h1>
<div id="applications">
</div>
<!--
This is the JS generated by the `wasm-pack` build command
The script here will define a `wasm_bindgen` global where all
functionality can be accessed such as instantiation and the actual
functions (examples below).
You can customize the name of the file here with the `out-name` CLI flag
to `wasm-bindgen`. You can also customize the name of the global exported
here with the `no-modules-global` flag.
-->
<script src='pkg/ekke_core_frontend.js'></script>
<script>
// Import functionality from the wasm module, but note that it's not quite
// ready to be used just yet.
//
const {} = wasm_bindgen;
async function run()
{
// First up we need to actually load the wasm file, so we use the
// exported global to inform it where the wasm file is located on the
// server, and then we wait on the returned promise to wait for the
// wasm to be loaded.
//
// Note that instead of a string here you can also pass in an instance
// of `WebAssembly.Module` which allows you to compile your own module.
//
await wasm_bindgen( 'pkg/ekke_core_frontend_bg.wasm' );
// And afterwards we can use all the functionality defined in wasm.
//
// const result = add( 1, 2 );
// console.log( `1 + 2 = ${result}` );
// if( result !== 3 )
// throw new Error( "wasm addition doesn't work!" );
}
run();
</script>
</body>
</html>