Add option to sideload js

This commit is contained in:
Joshua Ramon Enslin 2025-05-13 14:41:06 +02:00
parent 450f848fac
commit fb518cc56f
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE
2 changed files with 109 additions and 74 deletions

View File

@ -1,4 +1,7 @@
(async function() {
// const response = await fetch('./sample.json');
// const data = await response.json();
const data = {
"size_x" : 8,
@ -28,7 +31,7 @@ const data = {
2: "test",
}
}
};
const wrap = document.createElement("div");
wrap.id = "wrap";
@ -105,3 +108,5 @@ for (const hintId in data.hints) {
hintsArea.appendChild(li);
}
})();

30
sample.json Normal file
View File

@ -0,0 +1,30 @@
{
"size_x" : 8,
"size_y" : 8,
"cells" : {
// x-axis
1 : {
// y-axis
1 : {
"character" : "a",
"hidden" : false,
"hint" : 1,
"in_solution" : 3,
},
2 : {
"character" : "b",
// "hidden" : true,
}
}
},
"hints" : {
1: "hallo",
2: "test",
}
}