mixsy/index.js

28 lines
730 B
JavaScript
Raw Normal View History

2020-08-23 11:19:20 +00:00
import init, {load_main, load_additional, merge} from './pkg/mixsy.js';
2020-07-03 13:57:07 +00:00
async function run() {
await init();
2020-08-23 11:19:20 +00:00
const main = document.getElementById('a');
const additional = document.getElementById('b');
const output = document.getElementById('c');
const merge_button = document.getElementById('merge');
main.addEventListener('change', () => {
console.debug(load_main(main.value));
});
additional.addEventListener('change', () => {
console.debug(load_additional(additional.value));
});
function mix() {
output.value = merge();
}
merge_button.addEventListener('click', mix);
merge_button.addEventListener('touchend', mix);
2020-07-03 13:57:07 +00:00
}
run();