add www files
This commit is contained in:
parent
72908de36f
commit
ced2b9be8b
|
@ -0,0 +1,2 @@
|
|||
import("./index.js")
|
||||
.catch(e => console.error("Error importing `index.js`:", e));
|
|
@ -0,0 +1,37 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>NEXRAD Browser</title>
|
||||
<style>
|
||||
.grid-parent {
|
||||
display: grid;
|
||||
grid-template-columns: 2fr .5fr;
|
||||
grid-template-rows: 1fr;
|
||||
grid-column-gap: 5px;
|
||||
grid-row-gap: 0px;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.canvas-container {
|
||||
border-right: 2px solid black;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="grid-parent">
|
||||
<div class="canvas-container">
|
||||
<canvas id="canvas"></canvas>
|
||||
</div>
|
||||
<div>
|
||||
<label for="file">Upload Archive II file</label>
|
||||
<input type="file" id="file" />
|
||||
<button id="go">Load</button>
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script src="bootstrap.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,17 @@
|
|||
import * as wasm from "./wasm/nexrad_browser.js";
|
||||
await wasm.default();
|
||||
wasm.__nxrd_browser_init();
|
||||
|
||||
console.log("[JS] setup event listeners");
|
||||
|
||||
const fileSelector = document.getElementById('file');
|
||||
|
||||
document.getElementById("go").addEventListener("click", (e) => {
|
||||
const file = fileSelector.files[0];
|
||||
const reader = new FileReader();
|
||||
reader.addEventListener('load', (event) => {
|
||||
let data = event.target.result;
|
||||
wasm.load_ar2(data);
|
||||
});
|
||||
reader.readAsArrayBuffer(file);
|
||||
});
|
Loading…
Reference in New Issue