|
4 | 4 | <meta charset="UTF-8"> |
5 | 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
6 | 6 | <title>Mystery AI: Detective</title> |
| 7 | + <link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🕵️</text></svg>"> |
7 | 8 | <style>:root { |
8 | 9 | --primary: #1a2639; |
9 | 10 | --secondary: #3e4a61; |
@@ -1459,26 +1460,24 @@ <h3>The Truth</h3> |
1459 | 1460 | caseDescription: caseData.caseDescription, |
1460 | 1461 | crimeSceneImage: caseData.crimeSceneImage || 0, |
1461 | 1462 | // Replace the current suspect mapping code with this enhanced version: |
1462 | | - suspects: caseData.suspects.map(suspect => { |
1463 | | - // Enhanced gender detection with a more comprehensive check |
| 1463 | + suspects: caseData.suspects.map((suspect, index) => { |
| 1464 | + // Enhanced gender detection |
1464 | 1465 | const isFemale = |
1465 | 1466 | suspect.name.includes("Ms.") || |
1466 | 1467 | suspect.name.includes("Mrs.") || |
1467 | 1468 | suspect.name.includes("Miss") || |
1468 | 1469 | /\b(she|her|woman|girl|female|daughter|sister)\b/i.test(suspect.description) || |
1469 | 1470 | /\b(she|her|woman|girl|female|daughter|sister)\b/i.test(suspect.name); |
1470 | 1471 |
|
1471 | | - // Simplify the image selection by creating separate arrays |
1472 | | - const maleImages = [0, 2, 4, 6]; // Even indices for male images |
1473 | | - const femaleImages = [1, 3, 5, 7]; // Odd indices for female images |
1474 | | - |
1475 | | - // Choose a random index from the appropriate gender array |
1476 | | - const imageIndices = isFemale ? femaleImages : maleImages; |
1477 | | - const randomIndex = imageIndices[Math.floor(Math.random() * imageIndices.length)]; |
| 1472 | + // Create unique image mapping by assigning images sequentially based on gender |
| 1473 | + // Female suspects get odd indices (1, 3, 5, 7), male suspects get even indices (0, 2, 4, 6) |
| 1474 | + const imageIndex = isFemale ? |
| 1475 | + 1 + (2 * (index % 4)) : // For females: 1, 3, 5, 7 |
| 1476 | + 0 + (2 * (index % 4)); // For males: 0, 2, 4, 6 |
1478 | 1477 |
|
1479 | 1478 | return { |
1480 | 1479 | ...suspect, |
1481 | | - imageUrl: characterImages[randomIndex] |
| 1480 | + imageUrl: characterImages[imageIndex] |
1482 | 1481 | }; |
1483 | 1482 | }), |
1484 | 1483 | currentSuspect: null, |
|
0 commit comments