{
let isSpinning = true;
let element = DOM.canvas(width, 400);
let illo = new Zdog.Illustration({
element,
dragRotate: true,
onDragStart: () => isSpinning = false,
onDragEnd: () => isSpinning = true
});
new Zdog.Ellipse({
addTo: illo,
diameter: 80,
translate: {z: 40},
stroke: 20,
color: '#636',
});
new Zdog.Rect({
addTo: illo,
width: 80,
height: 80,
translate: {z: -40},
stroke: 12,
color: '#E62',
fill: true,
});
while (true) {
if (isSpinning) illo.rotate.y += 0.03;
illo.updateRenderGraph();
yield element;
}
}