|
|
|
@ -44,13 +44,15 @@ const add = () => {
|
|
|
|
|
|
|
|
|
|
const load = (e) => {
|
|
|
|
|
let files = e.target.files
|
|
|
|
|
new Promise.all(files.forEach(async (file) =>{
|
|
|
|
|
Promise.all(files.forEach(async (file) =>{
|
|
|
|
|
const reader = new FileReader()
|
|
|
|
|
reader.readAsText(file)
|
|
|
|
|
reader.onloadend = (e) => {
|
|
|
|
|
if (e.target.readyState == FileReader.DONE) {
|
|
|
|
|
try {
|
|
|
|
|
let scene = JSON.parse(reader.result)
|
|
|
|
|
// convert base64 to blob to avoid DOM lag during drag and drop
|
|
|
|
|
// bc base64 bloat the html document so much!
|
|
|
|
|
scenes.value.push(scene)
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.log(e)
|
|
|
|
|