illoEX = {
const illo = new Zdog.Illustration({
element: DOM.canvas(width, width / 2),
dragRotate: true
});
illo.element.style.backgroundColor = '#003';
const body = new Zdog.Shape({
addTo: illo,
stroke: 50,
path: [{ y: 0 }, { y: 30 }],
color: '#cfc'
});
const leftEye = new Zdog.Shape({
addTo: body,
translate: { x: -10, z: 20 },
stroke: 5,
color: '#111'
});
const rightEye = leftEye.copy({
translate: { x: 10, z: 20 },
stroke: 10
});
const mouth = new Zdog.Shape({
addTo: body,
color: '#fff',
stroke: 20,
path: [{ x: -5 }, { x: 5 }],
translate: { y: 20, z: 15 }
});
const dots = [];
for (let i = 0; i < 30; i++)
dots.push(
new Zdog.Shape({
addTo: illo,
diameter: 10 * Math.random(),
translate: {
x: (Math.random() - .5) * width,
y: (Math.random() - .5) * width,
z: (Math.random() - .5) * width
},
stroke: 50 * Math.random(),
color: '#ccf',
fill: true
})
);
while (true) {
for (let dot of dots) {
dot.translate.y += 1;
}
illo.rotate.y += .03;
illo.updateRenderGraph();
yield illo.element;
}
}