Chore: housekeeping

This commit is contained in:
Pieter Vander Vennet 2025-06-19 21:55:28 +02:00
parent 4c001d718e
commit 6f7d94890a
29 changed files with 430 additions and 308 deletions

View file

@ -41,18 +41,19 @@ function genImages(dryrun = false) {
const svgBody = svg
.replace(
"<svg ",
"<svg {...$$$$restProps} on:click on:mouseover on:mouseenter on:mouseleave on:keydown on:focus ",
"<svg {...$$$$restProps} on:click on:mouseover on:mouseenter on:mouseleave on:keydown on:focus "
)
.replace(/\\"/g, "\"")
.replace(/\\"/g, '"')
.replace(/(rgb\(0%,0%,0%\)|#000000|#000)/g, "{color}")
const hasColor = svgBody.indexOf("{color}") >= 0
const svelteCode =
["<script>",
"export " + (hasColor ? "let" : "const") + " color = \"#000000\"",
"</script>",
svgBody].join("\n")
const svelteCode = [
"<script>",
"export " + (hasColor ? "let" : "const") + ' color = "#000000"',
"</script>",
svgBody,
].join("\n")
fs.writeFileSync("./src/assets/svg/" + nameUC + ".svelte", svelteCode, "utf8")
}