mixsy/index.js

28 lines
730 B
JavaScript

import init, {load_main, load_additional, merge} from './pkg/mixsy.js';
async function run() {
await init();
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);
}
run();