import loader from './loader.js';
const board = document.querySelector("div.board");
const form = document.querySelector("form");
const message = document.querySelector("#message");
const ld = new loader(document.getElementById("loader"));

let url = 'https://dwarves.iut-fbleau.fr/foxes/foxes.php';

let foxes;
let size;

let newBoard = ( (size )  => {
	let frag = document.createDocumentFragment();
	for (let i = 0; i< size; i++){
		let div = document.createElement("div");
		for(let j = 0; j < size; j++){
			let span = document.createElement("span");
			span.dataset.num = size*i + j;
			div.appendChild(span);
		}
		frag.appendChild(div);
	}
	board.replaceChildren(frag);
})



form.addEventListener("submit", (async (ev) => {
	ev.preventDefault();
	// TODO
}))


board.addEventListener("click", ( async (ev) => {
    // TODO
}))
