{
const app = new PIXI.Application({
width: width,
height: 400,
backgroundColor: 0x1099bb,
resolution: window.devicePixelRatio || 1,
});
invalidation.then(() => app.destroy(true, true));
const container = new PIXI.Container();
app.stage.addChild(container);
const texture = PIXI.Texture.from(await FileAttachment("bunny.png").image());
for (let i=0; i < 25; i++) {
const bunny = new PIXI.Sprite(texture);
bunny.anchor.set(0.5);
container.addChild(bunny);
}
container.x = app.screen.width / 2;
container.y = app.screen.height / 2;
app.ticker.add((delta) => {
container.rotation -= 0.008 * delta
});
return Object.assign(app.view, { style: `width: ${width}px` });
}