layer = n => array(n).map(i => {
const y = i * h / n
const sw = h / n - 3
const dashes = array(50).map(() => `${expRand(1, 150, 8)|0} ${random(1, 25)|0}`).join(' ')
const offset = randInt(1, 5)
return `<g opacity="1">
<polyline
opacity="0.5"
points="${-10 - offset} ${y + sw/2 + 1 + offset} ${w + 10 - offset} ${y + sw/2 + 1 + offset}"
fill="none"
stroke="black"
stroke-width="${sw}"
stroke-dasharray="${dashes}"
/>
<polyline
points="-10 ${y + sw/2 + 1} ${w + 10} ${y + sw/2 + 1}"
fill="none"
stroke="${palette[randInt(palette.length)]}"
stroke-width="${sw}"
stroke-dasharray="${dashes}"
/>
</g>`
}).join('\n')