🚀 optimize svg with csso

This commit is contained in:
platane
2020-11-04 10:09:02 +01:00
parent 817362d1dd
commit b71cd68bac
5 changed files with 57 additions and 19 deletions

View File

@@ -7,8 +7,11 @@ import { getPathToPose } from "@snk/compute/getPathToPose";
const chain = getBestRoute(grid, snake);
chain.push(...getPathToPose(chain.slice(-1)[0], snake)!);
const svg = createSvg(grid, chain, drawOptions, { frameDuration: 200 });
const container = document.createElement("div");
container.innerHTML = svg;
document.body.appendChild(container);
(async () => {
const svg = await createSvg(grid, chain, drawOptions, { frameDuration: 200 });
const container = document.createElement("div");
container.innerHTML = svg;
document.body.appendChild(container);
})();