{
let s = height / 10;
let q = s * 2;
let sq1 = svg`<polygon points="${-q},${-q} ${-q},${q} ${q},${q} ${q},${-q}"
fill=none stroke=black stroke-width=${s} >`;
let c1 = svg`<circle r=${s * 0.8} />`;
let g1 = svg`<g
transform="translate(${width / 2},${height / 2})rotate(45)">${sq1}${c1}`;
let isoclip = svg`<defs>
<clipPath id=isoclip>
<rect x=${-s * 2.5} y=${-s * 2.5} width=${s * 5} height=${
s * 5
} transform="rotate(45)" />
</clipPath>
</defs>`;
let iso1 = svg`<rect x=${s * 0.25} y=${s * 0.25}
width=${s * 3} height=${s * 3} clip-path=url(#isoclip)
transform="translate(${width / 2 - s * 4.2},${height / 2 - s * 4.2})" />`;
let iso2 = svg`<rect x=${s * 0.25} y=${s * 0.25}
width=${s * 3} height=${s * 3} clip-path=url(#isoclip)
transform="translate(${width / 2 + s * 4.2},${
height / 2 + s * 4.2
})rotate(180)" />`;
let iso3 = svg`<rect x=${s * 0.25} y=${s * 0.25}
width=${s * 3} height=${s * 3} clip-path=url(#isoclip)
transform="translate(${width / 2 + s * 4.2},${
height / 2 - s * 4.2
})rotate(90)" />`;
let iso4 = svg`<rect x=${s * 0.25} y=${s * 0.25}
width=${s * 3} height=${s * 3} clip-path=url(#isoclip)
transform="translate(${width / 2 - s * 4.2},${
height / 2 + s * 4.2
})rotate(-90)" />`;
// The two side rectangles
let left = svg`<rect x=${s} y=${s}
width=${s} height=${height - s * 2} />`;
let right = svg`<rect x=${width - s * 2} y=${s}
width=${s} height=${height - s * 2} />`;
while (true)
for (let { angle, circle_radius, d1, d2, h } of animation(
{
angle: [
[0, 0],
[120, 45]
],
circle_radius: [
[0, 0],
[150, 0],
[151, s * 0.8]
],
d1: [
[0, s * 3],
[180, s * 3],
[300, s * 0.25]
],
d2: [
[0, s * 3],
[300, s * 3],
[420, s * 0.25]
],
h: [
[0, height - s * 2],
[460, height - s * 2],
[560, 0],
[800, 0]
]
},
0.5
)) {
g1.setAttribute(
"transform",
`translate(${width / 2},${height / 2})rotate(${angle})`
);
c1.setAttribute("r", circle_radius);
iso1.setAttribute("x", d1);
iso1.setAttribute("y", d1);
iso2.setAttribute("x", d1);
iso2.setAttribute("y", d1);
iso3.setAttribute("x", d2);
iso3.setAttribute("y", d2);
iso4.setAttribute("x", d2);
iso4.setAttribute("y", d2);
left.setAttribute("y", s + h);
left.setAttribute("height", height - s * 2 - h);
right.setAttribute("height", height - s * 2 - h);
yield svg`<svg width=${width} height=${height}>
${isoclip}${g1}${iso1}${iso2}${iso3}${iso4}${left}${right} </svg>`;
}
}