Commit 55c50d96 authored by haiyoucuv's avatar haiyoucuv

init

parent bfaef8d4
......@@ -15,6 +15,8 @@ class ReviewPanel extends React.Component {
animationCompleted: false
};
t = 0;
componentDidMount() {
// 延迟启动动画
setTimeout(() => {
......@@ -22,6 +24,10 @@ class ReviewPanel extends React.Component {
}, 200);
}
componentWillUnmount() {
clearTimeout(this.t);
}
startAnimation = () => {
// 逐个显示 item
this.state.itemsVisible.forEach((_, index) => {
......@@ -36,6 +42,9 @@ class ReviewPanel extends React.Component {
if (index === this.state.itemsVisible.length - 1) {
setTimeout(() => {
this.setState({ animationCompleted: true });
this.t = setTimeout(()=>{
this.clickNext();
});
}, 600); // 等待最后一个 item 的动画完成 (0.6s)
}
}, index * 300); // 每个 item 延迟 300ms
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment