- 将所有图片路径从绝对路径改为使用 process.env.PUBLIC_URL - 修复 HomePage.tsx 中所有图片引用 - 修复 CoursePage.tsx 中所有图片引用 - 确保图片在 GitHub Pages 上正确加载 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
37 lines
1.0 KiB
JavaScript
37 lines
1.0 KiB
JavaScript
import { Feature } from '../Feature.mjs';
|
|
|
|
let id = 0;
|
|
class ExitAnimationFeature extends Feature {
|
|
constructor() {
|
|
super(...arguments);
|
|
this.id = id++;
|
|
}
|
|
update() {
|
|
if (!this.node.presenceContext)
|
|
return;
|
|
const { isPresent, onExitComplete } = this.node.presenceContext;
|
|
const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {};
|
|
if (!this.node.animationState || isPresent === prevIsPresent) {
|
|
return;
|
|
}
|
|
const exitAnimation = this.node.animationState.setActive("exit", !isPresent);
|
|
if (onExitComplete && !isPresent) {
|
|
exitAnimation.then(() => {
|
|
onExitComplete(this.id);
|
|
});
|
|
}
|
|
}
|
|
mount() {
|
|
const { register, onExitComplete } = this.node.presenceContext || {};
|
|
if (onExitComplete) {
|
|
onExitComplete(this.id);
|
|
}
|
|
if (register) {
|
|
this.unmount = register(this.id);
|
|
}
|
|
}
|
|
unmount() { }
|
|
}
|
|
|
|
export { ExitAnimationFeature };
|