Jaouadart commited on
Commit
136ce4f
·
verified ·
1 Parent(s): 650bb27

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +109 -0
index.html CHANGED
@@ -545,6 +545,7 @@
545
  <li><a href="#" onclick="setPage('fruits'); closeSidebar();">الفواكه</a></li>
546
  <li><a href="#" onclick="setPage('vegetables'); closeSidebar();">الخضروات</a></li>
547
  <li><a href="#" onclick="setPage('months'); closeSidebar();">الشهور</a></li>
 
548
  <li><a href="#" onclick="setPage('gameMenu'); closeSidebar();">ألعاب تعليمية</a></li>
549
  <li><a href="#" onclick="showAboutInfo(); closeSidebar();">حول التطبيق</a></li>
550
  <li><a href="#" onclick="showContactInfo(); closeSidebar();">تواصل معنا</a></li>
@@ -807,6 +808,16 @@
807
  { word: 'ديسمبر', image: 'https://placehold.co/400x400/FFB74D/FFFFFF?text=ديسمبر', audio: 'audio/december.mp3' }
808
  ];
809
 
 
 
 
 
 
 
 
 
 
 
810
  const familyData = [
811
  { word: 'أمي', image: 'https://source.unsplash.com/400x400/?mother,woman', audio: 'audio/mother.mp3' },
812
  { word: 'أبي', image: 'https://source.unsplash.com/400x400/?father,man', audio: 'audio/father.mp3' },
@@ -898,6 +909,15 @@
898
  { word: 'أسود', color: '#263238', audio: 'audio/black.mp3' },
899
  { word: 'أبيض', color: '#F8F9FA', audio: 'audio/white.mp3' }
900
  ];
 
 
 
 
 
 
 
 
 
901
 
902
  // Story Data
903
  const storiesData = [
@@ -1016,6 +1036,8 @@
1016
  renderInteractivePage(appContainer, vegetablesData, 'خضروات');
1017
  } else if (currentPage === 'months') {
1018
  renderInteractivePage(appContainer, monthsData, 'شهور');
 
 
1019
  } else if (currentPage === 'family') {
1020
  renderInteractivePage(appContainer, familyData, 'عائلة');
1021
  } else if (currentPage === 'bodyParts') {
@@ -1032,6 +1054,8 @@
1032
  renderGuessingGame(appContainer);
1033
  } else if (currentGame === 'shadow') {
1034
  renderShadowGame(appContainer);
 
 
1035
  }
1036
 
1037
  const savedTheme = localStorage.getItem('theme') || 'amurs';
@@ -1097,6 +1121,9 @@
1097
  </a>
1098
  <a class="card" onclick="setPage('months')" style="background-image: url('https://source.unsplash.com/400x400/?calendar,months');">
1099
  <span class="card-text">الشهور</span>
 
 
 
1100
  </a>
1101
  <a class="card" onclick="setPage('gameMenu')" style="background-image: url('https://source.unsplash.com/400x400/?game,fun');">
1102
  <span class="card-text">ألعاب تعليمية</span>
@@ -1196,6 +1223,9 @@
1196
  <a class="card" onclick="setGame('shadow')" style="background-image: url('https://source.unsplash.com/400x400/?shadow,puzzle');">
1197
  <span class="card-text">لعبة الظل</span>
1198
  </a>
 
 
 
1199
  `;
1200
  container.appendChild(gameMenu);
1201
  }
@@ -1469,7 +1499,86 @@
1469
  }
1470
  }
1471
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1472
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1473
  // Main app control
1474
  function setPage(page) {
1475
  currentPage = page;
 
545
  <li><a href="#" onclick="setPage('fruits'); closeSidebar();">الفواكه</a></li>
546
  <li><a href="#" onclick="setPage('vegetables'); closeSidebar();">الخضروات</a></li>
547
  <li><a href="#" onclick="setPage('months'); closeSidebar();">الشهور</a></li>
548
+ <li><a href="#" onclick="setPage('days'); closeSidebar();">أيام الأسبوع</a></li>
549
  <li><a href="#" onclick="setPage('gameMenu'); closeSidebar();">ألعاب تعليمية</a></li>
550
  <li><a href="#" onclick="showAboutInfo(); closeSidebar();">حول التطبيق</a></li>
551
  <li><a href="#" onclick="showContactInfo(); closeSidebar();">تواصل معنا</a></li>
 
808
  { word: 'ديسمبر', image: 'https://placehold.co/400x400/FFB74D/FFFFFF?text=ديسمبر', audio: 'audio/december.mp3' }
809
  ];
810
 
811
+ const daysData = [
812
+ { word: 'الاثنين', image: 'https://source.unsplash.com/400x400/?monday', audio: 'audio/monday.mp3' },
813
+ { word: 'الثلاثاء', image: 'https://source.unsplash.com/400x400/?tuesday', audio: 'audio/tuesday.mp3' },
814
+ { word: 'الأربعاء', image: 'https://source.unsplash.com/400x400/?wednesday', audio: 'audio/wednesday.mp3' },
815
+ { word: 'الخميس', image: 'https://source.unsplash.com/400x400/?thursday', audio: 'audio/thursday.mp3' },
816
+ { word: 'الجمعة', image: 'https://source.unsplash.com/400x400/?friday', audio: 'audio/friday.mp3' },
817
+ { word: 'السبت', image: 'https://source.unsplash.com/400x400/?saturday', audio: 'audio/saturday.mp3' },
818
+ { word: 'الأحد', image: 'https://source.unsplash.com/400x400/?sunday', audio: 'audio/sunday.mp3' }
819
+ ];
820
+
821
  const familyData = [
822
  { word: 'أمي', image: 'https://source.unsplash.com/400x400/?mother,woman', audio: 'audio/mother.mp3' },
823
  { word: 'أبي', image: 'https://source.unsplash.com/400x400/?father,man', audio: 'audio/father.mp3' },
 
909
  { word: 'أسود', color: '#263238', audio: 'audio/black.mp3' },
910
  { word: 'أبيض', color: '#F8F9FA', audio: 'audio/white.mp3' }
911
  ];
912
+
913
+ // New letter game data
914
+ const letterGameData = [
915
+ { letter: 'أ', words: ['أسد', 'أرنب', 'أزرق'], audio: ['audio/lion.mp3', 'audio/rabbit.mp3', 'audio/blue.mp3'] },
916
+ { letter: 'ب', words: ['بقرة', 'بطة', 'بيت'], audio: ['audio/cow.mp3', 'audio/duck.mp3', 'audio/house.mp3'] },
917
+ { letter: 'ت', words: ['تفاح', 'تمر', 'تاج'], audio: ['audio/apple.mp3', 'audio/dates.mp3', 'audio/crown.mp3'] },
918
+ { letter: 'د', words: ['ديك', 'دب', 'دراجة'], audio: ['audio/rooster.mp3', 'audio/bear.mp3', 'audio/bike.mp3'] },
919
+ ];
920
+
921
 
922
  // Story Data
923
  const storiesData = [
 
1036
  renderInteractivePage(appContainer, vegetablesData, 'خضروات');
1037
  } else if (currentPage === 'months') {
1038
  renderInteractivePage(appContainer, monthsData, 'شهور');
1039
+ } else if (currentPage === 'days') {
1040
+ renderInteractivePage(appContainer, daysData, 'أيام الأسبوع');
1041
  } else if (currentPage === 'family') {
1042
  renderInteractivePage(appContainer, familyData, 'عائلة');
1043
  } else if (currentPage === 'bodyParts') {
 
1054
  renderGuessingGame(appContainer);
1055
  } else if (currentGame === 'shadow') {
1056
  renderShadowGame(appContainer);
1057
+ } else if (currentGame === 'letterGame') {
1058
+ renderLetterGame(appContainer);
1059
  }
1060
 
1061
  const savedTheme = localStorage.getItem('theme') || 'amurs';
 
1121
  </a>
1122
  <a class="card" onclick="setPage('months')" style="background-image: url('https://source.unsplash.com/400x400/?calendar,months');">
1123
  <span class="card-text">الشهور</span>
1124
+ </a>
1125
+ <a class="card" onclick="setPage('days')" style="background-image: url('https://source.unsplash.com/400x400/?calendar,days');">
1126
+ <span class="card-text">أيام الأسبوع</span>
1127
  </a>
1128
  <a class="card" onclick="setPage('gameMenu')" style="background-image: url('https://source.unsplash.com/400x400/?game,fun');">
1129
  <span class="card-text">ألعاب تعليمية</span>
 
1223
  <a class="card" onclick="setGame('shadow')" style="background-image: url('https://source.unsplash.com/400x400/?shadow,puzzle');">
1224
  <span class="card-text">لعبة الظل</span>
1225
  </a>
1226
+ <a class="card" onclick="setGame('letterGame')" style="background-image: url('https://source.unsplash.com/400x400/?alphabet,letters,game');">
1227
+ <span class="card-text">لعبة الحروف</span>
1228
+ </a>
1229
  `;
1230
  container.appendChild(gameMenu);
1231
  }
 
1499
  }
1500
  }
1501
  }
1502
+
1503
+ // Letter Game Logic
1504
+ let letterGameCurrentIndex = 0;
1505
+ let letterGameScore = 0;
1506
+
1507
+ function renderLetterGame(container) {
1508
+ const gameContainer = document.createElement('div');
1509
+ gameContainer.id = 'game-container';
1510
+ gameContainer.innerHTML = `
1511
+ <div class="text-xl font-bold mb-4 text-[#263238]">اختر الكلمات التي تبدأ بالحرف</div>
1512
+ <div id="letter-game-score" class="text-xl font-bold mb-4 text-[#263238]">النتيجة: 0</div>
1513
+ <div id="letter-game-question" class="question-box"></div>
1514
+ <button id="letter-game-start-btn" class="game-button" onclick="startLetterGame()">ابدأ</button>
1515
+ `;
1516
+ container.appendChild(gameContainer);
1517
+ startLetterGame();
1518
+ }
1519
+
1520
+ function startLetterGame() {
1521
+ letterGameCurrentIndex = 0;
1522
+ letterGameScore = 0;
1523
+ updateLetterGameScore();
1524
+ displayLetterGameQuestion();
1525
+ }
1526
+
1527
+ function displayLetterGameQuestion() {
1528
+ const questionBox = document.getElementById('letter-game-question');
1529
+ const startBtn = document.getElementById('letter-game-start-btn');
1530
+
1531
+ if (!questionBox || !startBtn) return;
1532
 
1533
+ if (letterGameCurrentIndex >= letterGameData.length) {
1534
+ questionBox.innerHTML = `
1535
+ <div class="text-2xl font-bold">انتهت اللعبة!</div>
1536
+ <div class="mt-4 text-xl">لقد حصلت على ${letterGameScore} من ${letterGameData.length}</div>
1537
+ <button class="game-button mt-4" onclick="startLetterGame()">إعادة اللعبة</button>
1538
+ `;
1539
+ startBtn.style.display = 'none';
1540
+ return;
1541
+ }
1542
+
1543
+ startBtn.style.display = 'none';
1544
+ const question = letterGameData[letterGameCurrentIndex];
1545
+
1546
+ const allWords = shuffleArray([...question.words, 'ورد', 'قلم', 'سماء']).slice(0, 4);
1547
+
1548
+ const optionsHtml = allWords.map(word => `
1549
+ <button class="option-button" onclick="checkLetterGameAnswer(this, '${word}', '${question.letter}')">${word}</button>
1550
+ `).join('');
1551
+
1552
+ questionBox.innerHTML = `
1553
+ <div class="text-2xl font-bold mb-4">الحرف: <span class="text-[#FFB74D]">${question.letter}</span></div>
1554
+ <div class="options-grid">
1555
+ ${optionsHtml}
1556
+ </div>
1557
+ `;
1558
+ }
1559
+
1560
+ function checkLetterGameAnswer(button, selectedWord, correctLetter) {
1561
+ const isCorrect = selectedWord.startsWith(correctLetter);
1562
+ if (isCorrect) {
1563
+ button.classList.add('correct');
1564
+ letterGameScore++;
1565
+ } else {
1566
+ button.classList.add('wrong');
1567
+ }
1568
+
1569
+ updateLetterGameScore();
1570
+
1571
+ setTimeout(() => {
1572
+ letterGameCurrentIndex++;
1573
+ displayLetterGameQuestion();
1574
+ }, 1000);
1575
+ }
1576
+
1577
+ function updateLetterGameScore() {
1578
+ const scoreElement = document.getElementById('letter-game-score');
1579
+ if (scoreElement) scoreElement.innerText = `النتيجة: ${letterGameScore}`;
1580
+ }
1581
+
1582
  // Main app control
1583
  function setPage(page) {
1584
  currentPage = page;