3 ms·
This way of creating SVG with JS template strings is really nice: svg`<svg width="${w}" height="${h}">... ${array(500).map(i => `<circle transform="tr
by liminal 6y ago
This way of creating SVG with JS template strings is really nice:
svg`<svg width="${w}" height="${h}">...
${array(500).map(i => `<circle
transform="translate(${w / 2}, ${h / 2}) rotate(${randInt(360)})"
cx="0"
cy="0"
r="${50 + i * 3}"
fill="none"
stroke="${palette[randInt(1, palette.length)]}"
stroke-width="${randInt(2, 32)}"
stroke-dasharray="${array(200).map(() => randInt(800)).join(' ')}"
/>`).join('\n')}
...
https://observablehq.com/@makio135/generating-svgs/4 https://observablehq.com/@makio135/generating-svgs/4
Also, if anyone is doing creative/visual coding on another platform and tracking their work with Git, check out Git Gallery. It integrates with the code revisions to let you visually track changes: https://github.com/thatcort/git-gallery https://github.com/thatcort/git-gallery