add model load fade in

This commit is contained in:
artie 2023-10-30 01:13:24 +01:00
parent 144113efde
commit 9ded734f03

View File

@ -49,9 +49,12 @@
motionPreload: MotionPreloadStrategy.NONE, motionPreload: MotionPreloadStrategy.NONE,
} }
); );
app.stage.addChild(model as unknown as PIXI.DisplayObject);
canvas.style.cursor = "pointer"; app.stage.on("childAdded", () => {
canvas.style.opacity = "1";
canvas.style.cursor = "pointer";
});
app.stage.addChild(model as unknown as PIXI.DisplayObject);
model.internalModel.motionManager.state.shouldRequestIdleMotion = () => model.internalModel.motionManager.state.shouldRequestIdleMotion = () =>
false; false;
@ -78,5 +81,5 @@
bind:this={canvas} bind:this={canvas}
on:pointerdown={() => model.motion("Tap")} on:pointerdown={() => model.motion("Tap")}
id="live2d" id="live2d"
class="cursor-pointer left-0 bottom-0 fixed lg:w-96 w-44" class="cursor-pointer left-0 bottom-0 fixed lg:w-96 w-44 opacity-0 transition-opacity"
/> />