Skip to content

Commit d7f2a80

Browse files
Merge pull request YueZheng-Sea-angle#39 from invain01/main
fix.修复help页面显示bug,修复每日挑战tag同时启用时Bug
2 parents 474592d + ff26e55 commit d7f2a80

File tree

9 files changed

+27
-17
lines changed

9 files changed

+27
-17
lines changed

src/components/auth/Auth.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
display: flex;
99
justify-content: center;
1010
align-items: center;
11-
z-index: 1000;
11+
z-index: 10000;
1212
}
1313

1414
.auth-modal {

src/components/auth/UserProfile.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
border-radius: 12px;
115115
box-shadow: 0 20px 60px rgba(248, 165, 194, 0.4); /* 使用主题色阴影 */
116116
min-width: 220px;
117-
z-index: 1000;
117+
z-index: 9999;
118118
animation: dropdownSlideIn 0.2s ease-out;
119119
border: 2px solid var(--primary-pink); /* 使用主题色边框 */
120120
backdrop-filter: blur(10px); /* 添加模糊效果 */

src/components/common/GameHelp.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
display: flex;
99
align-items: center;
1010
justify-content: center;
11-
z-index: 1000;
11+
z-index: 10001;
1212
padding: 20px;
1313
}
1414

src/components/common/GameHelp.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import React, { useState } from 'react';
22
import { Button } from './Button';
33
import './GameHelp.css';
4+
import { createPortal } from 'react-dom';
45

56
interface GameHelpProps {
67
onClose?: () => void;
78
}
89

910
export const GameHelp: React.FC<GameHelpProps> = ({ onClose }) => {
10-
return (
11+
return createPortal(
1112
<div className="game-help-modal">
1213
<div className="help-content">
1314
<div className="help-header">
@@ -124,7 +125,8 @@ export const GameHelp: React.FC<GameHelpProps> = ({ onClose }) => {
124125
</div>
125126
)}
126127
</div>
127-
</div>
128+
</div>,
129+
document.body
128130
);
129131
};
130132

@@ -147,4 +149,4 @@ export const GameHelpButton: React.FC = () => {
147149
)}
148150
</>
149151
);
150-
};
152+
};

src/components/common/OriginalImagePreview.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
display: flex;
99
justify-content: center;
1010
align-items: center;
11-
z-index: 1000;
11+
z-index: 10000;
1212
}
1313

1414
.original-image-preview-modal {

src/components/editor/PreviewModal.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
display: flex;
99
align-items: center;
1010
justify-content: center;
11-
z-index: 1000;
11+
z-index: 10000;
1212
backdrop-filter: blur(4px);
1313
}
1414

src/components/game/GameCompletionModal.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
display: flex;
1010
align-items: center;
1111
justify-content: center;
12-
z-index: 1000;
12+
z-index: 10000;
1313
animation: modalFadeIn 0.3s ease-out;
1414
}
1515

src/components/leaderboard/LeaderboardModal.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
display: flex;
1010
justify-content: center;
1111
align-items: center;
12-
z-index: 1000;
12+
z-index: 10000;
1313
}
1414

1515
.leaderboard-modal {

src/pages/DailyChallengeGame.tsx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,27 +110,35 @@ export const DailyChallengeGame: React.FC<DailyChallengeGameProps> = ({
110110

111111
// 检查是否可以放置到该槽位(根据特效规则)
112112
const canPlaceToSlot = useCallback((slotIndex: number) => {
113+
let canPlace = true;
114+
let hasEffects = false;
115+
113116
// 作茧自缚特效:动态解锁机制
114117
if (challenge.effects?.includes('corner_start') || challenge.effects?.includes('作茧自缚')) {
118+
hasEffects = true;
115119
// 如果还没有放置任何拼图块,只能放在角落
116120
if (gameState && gameState.answerGrid.every(slot => slot === null)) {
117-
return isCornerSlot(slotIndex);
121+
canPlace = canPlace && isCornerSlot(slotIndex);
122+
} else {
123+
// 否则检查该槽位是否已解锁
124+
canPlace = canPlace && effectStates.unlockedSlots.has(slotIndex);
118125
}
119-
// 否则检查该槽位是否已解锁
120-
return effectStates.unlockedSlots.has(slotIndex);
121126
}
122127

123128
// 亦步亦趋特效:只能在上次放置的拼图块周围放置
124129
if (challenge.effects?.includes('brightness') || challenge.effects?.includes('亦步亦趋')) {
130+
hasEffects = true;
125131
// 如果还没有放置任何拼图块,可以放在任意位置
126132
if (gameState && gameState.answerGrid.every(slot => slot === null)) {
127-
return true;
133+
canPlace = canPlace && true;
134+
} else {
135+
// 否则检查是否在允许的槽位列表中
136+
canPlace = canPlace && effectStates.stepFollowSlots.has(slotIndex);
128137
}
129-
// 否则检查是否在允许的槽位列表中
130-
return effectStates.stepFollowSlots.has(slotIndex);
131138
}
132139

133-
return true;
140+
// 如果没有启用任何特效,可以直接放置
141+
return hasEffects ? canPlace : true;
134142
}, [challenge.effects, gameState, isCornerSlot, effectStates.unlockedSlots, effectStates.stepFollowSlots]);
135143

136144
// 获取特效CSS类名

0 commit comments

Comments
 (0)