mirror of
https://codeberg.org/demostf/tf-demos-viewer.git
synced 2026-06-03 18:14:11 +02:00
basic setup
This commit is contained in:
parent
4882477d73
commit
ccbf5edad0
6 changed files with 753 additions and 37 deletions
23
js/index.js
23
js/index.js
|
|
@ -1 +1,22 @@
|
|||
import("../pkg/index.js").catch(console.error);
|
||||
import("../pkg/index.js")
|
||||
.then(m => {
|
||||
document.getElementById('file').onchange = e => {
|
||||
let file = e.target.files[0];
|
||||
|
||||
let reader = new FileReader();
|
||||
|
||||
reader.readAsArrayBuffer(file);
|
||||
|
||||
reader.onload = function() {
|
||||
console.log(reader.result);
|
||||
let bytes = new Uint8Array(reader.result);
|
||||
|
||||
m.parse_demo(bytes);
|
||||
};
|
||||
|
||||
reader.onerror = function() {
|
||||
console.log(reader.error);
|
||||
};
|
||||
};
|
||||
})
|
||||
.catch(console.error);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue