Spaces:
Running
Running
Update index.html
Browse files- index.html +108 -41
index.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
<!DOCTYPE html>
|
| 2 |
<html lang="ar" dir="rtl">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
|
@@ -121,10 +121,10 @@
|
|
| 121 |
<audio id="story-audio" controls style="display:none;"></audio>
|
| 122 |
<audio id="click-sound" src="audio/click_2.mp3" preload="auto"></audio>
|
| 123 |
<audio id="success-sound" src="audio/Correct and Incorrect sound effect - right or wrong(M4A_128K)(2).mp3" preload="auto"></audio>
|
| 124 |
-
<audio id="error-sound" src="audio/Correct and Incorrect sound effect - right or wrong(M4A_128K)(3).
|
| 125 |
<audio id="background-music" src="audio/Funny Kids _ Children_s Music (Instrumental Music For Kids)(M4A_128K).m4a" preload="auto" loop></audio>
|
| 126 |
<script>
|
| 127 |
-
// --- 1. تعريف الأيقونات كـ SVG نصي ---
|
| 128 |
|
| 129 |
const ICONS = {
|
| 130 |
Home: (cls) => `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="${cls}"><path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>`,
|
|
@@ -166,7 +166,7 @@
|
|
| 166 |
};
|
| 167 |
|
| 168 |
|
| 169 |
-
// --- 2. بيانات التطبيق الثابتة ---
|
| 170 |
|
| 171 |
const APP_NAME = "Tifawin";
|
| 172 |
const APP_NAME_LETTERS = "TIMMUZIT";
|
|
@@ -185,10 +185,12 @@
|
|
| 185 |
{ name: "طاقم تطوان للتعابير", role: "تسجيل فصول السنة" }
|
| 186 |
];
|
| 187 |
|
|
|
|
| 188 |
const tifinaghData = [
|
| 189 |
-
{ letter: 'ⴰ', word_tifinagh: '', word_arabic: 'جدار
|
| 190 |
-
{ letter: 'ⴱ', word_tifinagh: '', word_arabic: 'فراشة
|
| 191 |
-
{ letter: 'ⴳ', word_tifinagh: '', word_arabic: 'دخان
|
|
|
|
| 192 |
];
|
| 193 |
|
| 194 |
const animalsData = [
|
|
@@ -203,11 +205,10 @@
|
|
| 203 |
|
| 204 |
const LEARNING_DATA = {
|
| 205 |
tifinaghLetters: tifinaghData.map(item => {
|
| 206 |
-
const parts = item.word_arabic.split('-');
|
| 207 |
return {
|
| 208 |
-
main: item.letter,
|
| 209 |
-
word:
|
| 210 |
-
transliteration:
|
| 211 |
imageUrl: item.image,
|
| 212 |
audioUrl: item.audio,
|
| 213 |
};
|
|
@@ -219,20 +220,21 @@
|
|
| 219 |
imageUrl: item.image,
|
| 220 |
audioUrl: item.audio,
|
| 221 |
})),
|
| 222 |
-
tools: [{ main: 'ⴰⴽⵕⵕⴰⵊ', word: 'قلم رصاص', imageUrl: 'images/37b71533177feb9d55d55efba947309e.jpg', audioUrl: 'audio/schoolSupplies/pencil.mp3' }],
|
| 223 |
-
fruits: [{ main: 'ⵜⴰⴷⴼⴼⵓⵢⵜ', word: 'تفاحة', imageUrl: 'images/da1da4f2015a32322f547ae5fff5236c.jpg', audioUrl: 'audio/fruits/apple.mp3' }],
|
| 224 |
-
vegetables: [{ main: 'ⵜⴰⵎⴰⵟⵉⵛⵜ', word: 'طماطم', imageUrl: 'images/6056d9839a962b5a78cddc402ef88c09.jpg', audioUrl: 'audio/vegetables/tomato.mp3' }],
|
| 225 |
-
animals: animalsData.map(item => ({ main: item.word_tifinagh, word: item.word_arabic, imageUrl: item.image, audioUrl: item.audio })),
|
| 226 |
-
body: [{ main: 'ⵉⵅⴼ', word: 'الرأس', imageUrl: 'images/33dda7fe89cfd5526918246dae320059.jpg', audioUrl: 'audio/bodyParts/head.mp3' }],
|
| 227 |
-
days: [{ main: 'ⴰⵢⵏⴰⵙ', word: 'الاثنين', imageUrl: 'images/37b71533177feb9d55d55efba947309e.jpg', audioUrl: 'audio/days/monday.mp3' }],
|
| 228 |
-
months: [{ main: 'ⵉⵏⵏⴰⵢⵔ', word: 'يناير', imageUrl: 'images/
|
| 229 |
-
family: [{ main: 'ⵉⵎⵎⵉ', word: 'أمي', imageUrl: 'images/5957c378462b920ceb24f6aa294b5100.jpg', audioUrl: 'audio/family/mother.mp3' }],
|
| 230 |
-
colors: [{ main: 'ⴰⵣⴳⴳⵯⴰⵖ', word: 'أحمر', imageUrl: 'images/b008721ac76def4ddfdbdb51fc82d320.jpg', audioUrl: 'audio/colors/red.mp3', colorClass: 'bg-red-600' }],
|
| 231 |
-
seasons: [{ main: 'ⵜⴰⴳⵔⵙⵜ', word: 'الشتاء', imageUrl: 'images/b2d331ea13a2df600219904dabd028fa.jpg', audioUrl: 'audio/AUD-20250926-WA0003.opus' }],
|
| 232 |
-
games: [{ main: "أسد صغير شجاع", word: "في غابة بعيدة، عاش أسد صغير اسمه سمير...", imageUrl: "images/Screenshot_20250927_141840_One Read.jpg", audioUrl: null }],
|
| 233 |
-
stories: [{ main: "السلحفاة والأرنب", word: "في غابة خضراء، قرر أرنب وسلحفاة...", imageUrl: "images/73b552bd0d3472c121adccc68a5bbb7f.jpg", audioUrl: null }],
|
| 234 |
};
|
| 235 |
|
|
|
|
| 236 |
const CATEGORIES = [
|
| 237 |
{ id: 'tifinaghLetters', title: 'تعلم الحروف', subtitle: 'ⴰ, ⴱ, ⴳ...', iconName: 'AArrowUp', imageUrl: 'images/6e318d538a2d8f0b5ad685db558ffe4e.jpg' },
|
| 238 |
{ id: 'numbers', title: 'تعلم الأرقام', subtitle: '0, 1, 2...', iconName: 'Hash', imageUrl: 'images/0751e273c2de27e4b04dfeb7ee99b448.jpg' },
|
|
@@ -251,7 +253,7 @@
|
|
| 251 |
];
|
| 252 |
|
| 253 |
|
| 254 |
-
// --- 3. إدارة حالة التطبيق ---
|
| 255 |
|
| 256 |
const appState = {
|
| 257 |
currentScreen: 'welcome',
|
|
@@ -265,7 +267,7 @@
|
|
| 265 |
isBackgroundMusicPlaying: false,
|
| 266 |
};
|
| 267 |
|
| 268 |
-
//
|
| 269 |
|
| 270 |
/** يشغل صوت النقر على زر */
|
| 271 |
const playClickSound = () => {
|
|
@@ -276,7 +278,7 @@
|
|
| 276 |
}
|
| 277 |
};
|
| 278 |
|
| 279 |
-
/** 🚨
|
| 280 |
const playSuccessSound = () => {
|
| 281 |
const audio = document.getElementById('success-sound');
|
| 282 |
if (audio && !appState.isAppMuted) {
|
|
@@ -285,7 +287,7 @@
|
|
| 285 |
}
|
| 286 |
};
|
| 287 |
|
| 288 |
-
/** 🚨
|
| 289 |
const playErrorSound = () => {
|
| 290 |
const audio = document.getElementById('error-sound');
|
| 291 |
if (audio && !appState.isAppMuted) {
|
|
@@ -375,6 +377,8 @@
|
|
| 375 |
renderApp();
|
| 376 |
};
|
| 377 |
|
|
|
|
|
|
|
| 378 |
// دالة تبديل حالة القائمة الجانبية
|
| 379 |
window.toggleMenu = () => {
|
| 380 |
setState({ isMenuOpen: !appState.isMenuOpen });
|
|
@@ -430,6 +434,8 @@
|
|
| 430 |
|
| 431 |
// --- 5. مكونات الواجهة المشتركة (رأس الصفحة وتذييلها) ---
|
| 432 |
|
|
|
|
|
|
|
| 433 |
const renderHeader = () => {
|
| 434 |
const headerElement = document.getElementById('app-header');
|
| 435 |
const categoryMeta = CATEGORIES.find(c => c.id === appState.selectedCategory);
|
|
@@ -504,12 +510,12 @@
|
|
| 504 |
`;
|
| 505 |
};
|
| 506 |
|
| 507 |
-
|
| 508 |
// --- 6. شاشة 1: شاشة الترحيب (Welcome Screen) ---
|
|
|
|
| 509 |
const renderWelcomeScreen = () => {
|
| 510 |
const content = document.getElementById('app-content');
|
| 511 |
|
| 512 |
-
const logoImage = '
|
| 513 |
const appTagline = "رفيق طفلك لتعلم اللغة الأمازيغية (تيفيناغ)";
|
| 514 |
|
| 515 |
const copyrightText = "TIFIWIN-AZIZIJAOUAD@2025";
|
|
@@ -563,9 +569,9 @@
|
|
| 563 |
</div>
|
| 564 |
`;
|
| 565 |
};
|
| 566 |
-
|
| 567 |
|
| 568 |
// --- 7. شاشة 2: الشاشة الرئيسية (Home Screen) ---
|
|
|
|
| 569 |
const renderHomeScreen = () => {
|
| 570 |
const content = document.getElementById('app-content');
|
| 571 |
|
|
@@ -626,6 +632,20 @@
|
|
| 626 |
};
|
| 627 |
|
| 628 |
// --- 8. شاشة 3 و 4: شاشة التعلم العامة (Learning Screen) ---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 629 |
const renderLearningScreen = () => {
|
| 630 |
const categoryId = appState.selectedCategory;
|
| 631 |
const content = document.getElementById('app-content');
|
|
@@ -647,6 +667,7 @@
|
|
| 647 |
|
| 648 |
const currentItem = data[appState.currentIndex];
|
| 649 |
const isColorsCategory = categoryId === 'colors';
|
|
|
|
| 650 |
const isRecordingActive = appState.isRecording;
|
| 651 |
|
| 652 |
window.playAudio = () => {
|
|
@@ -692,16 +713,55 @@
|
|
| 692 |
}
|
| 693 |
|
| 694 |
let mainWordDisplay = currentItem.main;
|
| 695 |
-
let secondaryText = currentItem.
|
| 696 |
|
| 697 |
-
|
| 698 |
-
|
| 699 |
-
|
| 700 |
-
|
| 701 |
-
|
| 702 |
-
|
| 703 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 704 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 705 |
const micAction = isRecordingActive ? 'stopRecording()' : 'startRecording()';
|
| 706 |
const micButtonClass = isRecordingActive
|
| 707 |
? 'bg-red-600 hover:bg-red-700 shadow-2xl shadow-red-400/70 animate-pulse'
|
|
@@ -722,10 +782,15 @@
|
|
| 722 |
</div>
|
| 723 |
|
| 724 |
<div class="mt-1 text-center text-white">
|
| 725 |
-
<p class="
|
| 726 |
-
|
|
|
|
| 727 |
${secondaryText}
|
| 728 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 729 |
</div>
|
| 730 |
</div>
|
| 731 |
|
|
@@ -759,8 +824,10 @@
|
|
| 759 |
</div>
|
| 760 |
`;
|
| 761 |
};
|
| 762 |
-
|
| 763 |
// --- 9. شاشة الإعدادات (Settings Screen) ---
|
|
|
|
|
|
|
| 764 |
const renderSettingsScreen = () => {
|
| 765 |
const content = document.getElementById('app-content');
|
| 766 |
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
<html lang="ar" dir="rtl">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
|
|
|
| 121 |
<audio id="story-audio" controls style="display:none;"></audio>
|
| 122 |
<audio id="click-sound" src="audio/click_2.mp3" preload="auto"></audio>
|
| 123 |
<audio id="success-sound" src="audio/Correct and Incorrect sound effect - right or wrong(M4A_128K)(2).mp3" preload="auto"></audio>
|
| 124 |
+
<audio id="error-sound" src="audio/Correct and Incorrect sound effect - right or wrong(M4A_128K)(3).mpad" preload="auto"></audio>
|
| 125 |
<audio id="background-music" src="audio/Funny Kids _ Children_s Music (Instrumental Music For Kids)(M4A_128K).m4a" preload="auto" loop></audio>
|
| 126 |
<script>
|
| 127 |
+
// --- 1. تعريف الأيقونات كـ SVG نصي (Icons) ---
|
| 128 |
|
| 129 |
const ICONS = {
|
| 130 |
Home: (cls) => `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="${cls}"><path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>`,
|
|
|
|
| 166 |
};
|
| 167 |
|
| 168 |
|
| 169 |
+
// --- 2. بيانات التطبيق الثابتة (Static Data) ---
|
| 170 |
|
| 171 |
const APP_NAME = "Tifawin";
|
| 172 |
const APP_NAME_LETTERS = "TIMMUZIT";
|
|
|
|
| 185 |
{ name: "طاقم تطوان للتعابير", role: "تسجيل فصول السنة" }
|
| 186 |
];
|
| 187 |
|
| 188 |
+
// 🚨 UPDATED: تم فصل الكلمة الأمازيغية (word_tifinagh) عن الترجمة العربية
|
| 189 |
const tifinaghData = [
|
| 190 |
+
{ letter: 'ⴰ', word_tifinagh: 'ⴰⴳⴰⴷⵉⵔ', word_arabic: 'جدار', image: 'images/2947c16d27f8042f7d60783c6808519a.jpg', audio: 'audio/aman.mp3' },
|
| 191 |
+
{ letter: 'ⴱ', word_tifinagh: 'ⵉⴱⵔⴱⵉⵍⵍⵓ', word_arabic: 'فراشة', image: 'images/3fd6beebd231e2f325469a40b0831b59.jpg', audio: 'audio/barbi.mp3' },
|
| 192 |
+
{ letter: 'ⴳ', word_tifinagh: 'ⴰⴳⴳⵓ', word_arabic: 'دخان', image: 'images/c0094eb5dcc49d7cce573d42f270d8de.jpg', audio: 'audio/ca.mp3' },
|
| 193 |
+
{ letter: 'ⵢ', word_tifinagh: 'ⴰⵢⴷⵉ', word_arabic: 'كلب', image: 'images/124419894dcfde81ffbca1e072804c71.jpg', audio: 'audio/dog.mp3' },
|
| 194 |
];
|
| 195 |
|
| 196 |
const animalsData = [
|
|
|
|
| 205 |
|
| 206 |
const LEARNING_DATA = {
|
| 207 |
tifinaghLetters: tifinaghData.map(item => {
|
|
|
|
| 208 |
return {
|
| 209 |
+
main: item.letter, // ⴰ الحرف المستهدف
|
| 210 |
+
word: item.word_arabic.trim(), // جدار (الترجمة العربية)
|
| 211 |
+
transliteration: item.word_tifinagh.trim(), // ⴰⴳⴰⴷⵉⵔ (الكلمة الأمازيغية للتلوين)
|
| 212 |
imageUrl: item.image,
|
| 213 |
audioUrl: item.audio,
|
| 214 |
};
|
|
|
|
| 220 |
imageUrl: item.image,
|
| 221 |
audioUrl: item.audio,
|
| 222 |
})),
|
| 223 |
+
tools: [{ main: 'ⴰⴽⵕⵕⴰⵊ', word: 'قلم رصاص', transliteration: 'قلم رصاص', imageUrl: 'images/37b71533177feb9d55d55efba947309e.jpg', audioUrl: 'audio/schoolSupplies/pencil.mp3' }],
|
| 224 |
+
fruits: [{ main: 'ⵜⴰⴷⴼⴼⵓⵢⵜ', word: 'تفاحة', transliteration: 'ⵜⴰⴷⴼⴼⵓⵢⵜ', imageUrl: 'images/da1da4f2015a32322f547ae5fff5236c.jpg', audioUrl: 'audio/fruits/apple.mp3' }],
|
| 225 |
+
vegetables: [{ main: 'ⵜⴰⵎⴰⵟⵉⵛⵜ', word: 'طماطم', transliteration: 'ⵜⴰⵎⴰⵟⵉⵛⵜ', imageUrl: 'images/6056d9839a962b5a78cddc402ef88c09.jpg', audioUrl: 'audio/vegetables/tomato.mp3' }],
|
| 226 |
+
animals: animalsData.map(item => ({ main: item.word_tifinagh, word: item.word_arabic, transliteration: item.word_tifinagh, imageUrl: item.image, audioUrl: item.audio })),
|
| 227 |
+
body: [{ main: 'ⵉⵅⴼ', word: 'الرأس', transliteration: 'ⵉⵅⴼ', imageUrl: 'images/33dda7fe89cfd5526918246dae320059.jpg', audioUrl: 'audio/bodyParts/head.mp3' }],
|
| 228 |
+
days: [{ main: 'ⴰⵢⵏⴰⵙ', word: 'الاثنين', transliteration: 'ⴰⵢⵏⴰⵙ', imageUrl: 'images/37b71533177feb9d55d55efba947309e.jpg', audioUrl: 'audio/days/monday.mp3' }],
|
| 229 |
+
months: [{ main: 'ⵉⵏⵏⴰⵢⵔ', word: 'يناير', transliteration: 'ⵉⵏⵏⴰⵢⵔ', imageUrl: 'images/b26681eaa5caacbf1c7bfb1f12f546def.jpg', audioUrl: 'audio/months/january.mp3' }],
|
| 230 |
+
family: [{ main: 'ⵉⵎⵎⵉ', word: 'أمي', transliteration: 'ⵉⵎⵎⵉ', imageUrl: 'images/5957c378462b920ceb24f6aa294b5100.jpg', audioUrl: 'audio/family/mother.mp3' }],
|
| 231 |
+
colors: [{ main: 'ⴰⵣⴳⴳⵯⴰⵖ', word: 'أحمر', transliteration: 'ⴰⵣⴳⴳⵯⴰⵖ', imageUrl: 'images/b008721ac76def4ddfdbdb51fc82d320.jpg', audioUrl: 'audio/colors/red.mp3', colorClass: 'bg-red-600' }],
|
| 232 |
+
seasons: [{ main: 'ⵜⴰⴳⵔⵙⵜ', word: 'الشتاء', transliteration: 'ⵜⴰⴳⵔⵙⵜ', imageUrl: 'images/b2d331ea13a2df600219904dabd028fa.jpg', audioUrl: 'audio/AUD-20250926-WA0003.opus' }],
|
| 233 |
+
games: [{ main: "أسد صغير شجاع", word: "في غابة بعيدة، عاش أسد صغير اسمه سمير...", transliteration: "قصة", imageUrl: "images/Screenshot_20250927_141840_One Read.jpg", audioUrl: null }],
|
| 234 |
+
stories: [{ main: "السلحفاة والأرنب", word: "في غابة خضراء، قرر أرنب وسلحفاة...", transliteration: "قصة", imageUrl: "images/73b552bd0d3472c121adccc68a5bbb7f.jpg", audioUrl: null }],
|
| 235 |
};
|
| 236 |
|
| 237 |
+
// ... (بقية تعريفات الفئات CATEGORIES - لم تتغير) ...
|
| 238 |
const CATEGORIES = [
|
| 239 |
{ id: 'tifinaghLetters', title: 'تعلم الحروف', subtitle: 'ⴰ, ⴱ, ⴳ...', iconName: 'AArrowUp', imageUrl: 'images/6e318d538a2d8f0b5ad685db558ffe4e.jpg' },
|
| 240 |
{ id: 'numbers', title: 'تعلم الأرقام', subtitle: '0, 1, 2...', iconName: 'Hash', imageUrl: 'images/0751e273c2de27e4b04dfeb7ee99b448.jpg' },
|
|
|
|
| 253 |
];
|
| 254 |
|
| 255 |
|
| 256 |
+
// --- 3. إدارة حالة التطبيق (State Management) ---
|
| 257 |
|
| 258 |
const appState = {
|
| 259 |
currentScreen: 'welcome',
|
|
|
|
| 267 |
isBackgroundMusicPlaying: false,
|
| 268 |
};
|
| 269 |
|
| 270 |
+
// ... (بقية الدوال المساعدة مثل playClickSound, playSuccessSound, playErrorSound, toggleBackgroundMusic - لم تتغير) ...
|
| 271 |
|
| 272 |
/** يشغل صوت النقر على زر */
|
| 273 |
const playClickSound = () => {
|
|
|
|
| 278 |
}
|
| 279 |
};
|
| 280 |
|
| 281 |
+
/** 🚨 يشغل صوت النجاح */
|
| 282 |
const playSuccessSound = () => {
|
| 283 |
const audio = document.getElementById('success-sound');
|
| 284 |
if (audio && !appState.isAppMuted) {
|
|
|
|
| 287 |
}
|
| 288 |
};
|
| 289 |
|
| 290 |
+
/** 🚨 يشغل صوت الخطأ */
|
| 291 |
const playErrorSound = () => {
|
| 292 |
const audio = document.getElementById('error-sound');
|
| 293 |
if (audio && !appState.isAppMuted) {
|
|
|
|
| 377 |
renderApp();
|
| 378 |
};
|
| 379 |
|
| 380 |
+
// ... (بقية دوال التحكم في القائمة والتسجيل و submitUsername - لم تتغير) ...
|
| 381 |
+
|
| 382 |
// دالة تبديل حالة القائمة الجانبية
|
| 383 |
window.toggleMenu = () => {
|
| 384 |
setState({ isMenuOpen: !appState.isMenuOpen });
|
|
|
|
| 434 |
|
| 435 |
// --- 5. مكونات الواجهة المشتركة (رأس الصفحة وتذييلها) ---
|
| 436 |
|
| 437 |
+
// ... (دوال renderHeader و renderFooter - لم تتغير) ...
|
| 438 |
+
|
| 439 |
const renderHeader = () => {
|
| 440 |
const headerElement = document.getElementById('app-header');
|
| 441 |
const categoryMeta = CATEGORIES.find(c => c.id === appState.selectedCategory);
|
|
|
|
| 510 |
`;
|
| 511 |
};
|
| 512 |
|
|
|
|
| 513 |
// --- 6. شاشة 1: شاشة الترحيب (Welcome Screen) ---
|
| 514 |
+
// ... (دالة renderWelcomeScreen - لم تتغير) ...
|
| 515 |
const renderWelcomeScreen = () => {
|
| 516 |
const content = document.getElementById('app-content');
|
| 517 |
|
| 518 |
+
const logoImage = 'images/placeholder_logo.png';
|
| 519 |
const appTagline = "رفيق طفلك لتعلم اللغة الأمازيغية (تيفيناغ)";
|
| 520 |
|
| 521 |
const copyrightText = "TIFIWIN-AZIZIJAOUAD@2025";
|
|
|
|
| 569 |
</div>
|
| 570 |
`;
|
| 571 |
};
|
|
|
|
| 572 |
|
| 573 |
// --- 7. شاشة 2: الشاشة الرئيسية (Home Screen) ---
|
| 574 |
+
// ... (دالة renderHomeScreen - لم تتغير) ...
|
| 575 |
const renderHomeScreen = () => {
|
| 576 |
const content = document.getElementById('app-content');
|
| 577 |
|
|
|
|
| 632 |
};
|
| 633 |
|
| 634 |
// --- 8. شاشة 3 و 4: شاشة التعلم العامة (Learning Screen) ---
|
| 635 |
+
|
| 636 |
+
// 🚨 NEW: دالة مساعدة لتلوين الحرف داخل الكلمة
|
| 637 |
+
const highlightLetterInWord = (word, letter) => {
|
| 638 |
+
if (!word || !letter) return word;
|
| 639 |
+
|
| 640 |
+
// إنشاء تعبير نمطي للبحث عن جميع تكرارات الحرف (global flag g)
|
| 641 |
+
// ويتم تغليف الحرف في وسم <span> باللون الأحمر
|
| 642 |
+
const regex = new RegExp(letter, 'g');
|
| 643 |
+
|
| 644 |
+
// يتم استخدام تلوين Tailwind CSS
|
| 645 |
+
return word.replace(regex, `<span class="text-red-500 dark:text-red-400 font-extrabold">${letter}</span>`);
|
| 646 |
+
};
|
| 647 |
+
|
| 648 |
+
|
| 649 |
const renderLearningScreen = () => {
|
| 650 |
const categoryId = appState.selectedCategory;
|
| 651 |
const content = document.getElementById('app-content');
|
|
|
|
| 667 |
|
| 668 |
const currentItem = data[appState.currentIndex];
|
| 669 |
const isColorsCategory = categoryId === 'colors';
|
| 670 |
+
const isTifinaghLetters = categoryId === 'tifinaghLetters'; // 🚨 NEW
|
| 671 |
const isRecordingActive = appState.isRecording;
|
| 672 |
|
| 673 |
window.playAudio = () => {
|
|
|
|
| 713 |
}
|
| 714 |
|
| 715 |
let mainWordDisplay = currentItem.main;
|
| 716 |
+
let secondaryText = currentItem.transliteration; // الكلمة الأمازيغية
|
| 717 |
|
| 718 |
+
// 🚨 NEW LOGIC: منطق تلوين الحروف وإضافة الزوايا
|
| 719 |
+
let cornerElementHTML = '';
|
| 720 |
+
let mainWordClasses = 'text-3xl font-black mb-1 drop-shadow-lg leading-tight';
|
| 721 |
+
|
| 722 |
+
if (isTifinaghLetters) {
|
| 723 |
+
const targetLetter = currentItem.main;
|
| 724 |
+
|
| 725 |
+
// 1. تلوين الحرف الرئيسي (البطاقة الكبيرة) باللون الأحمر
|
| 726 |
+
mainWordDisplay = `<span class="text-red-500 dark:text-red-400 font-extrabold text-5xl">${targetLetter}</span>`;
|
| 727 |
+
mainWordClasses = 'text-5xl font-black mb-1 drop-shadow-lg leading-tight';
|
| 728 |
+
|
| 729 |
+
// 2. تلوين الحرف داخل الكلمة الأمازيغية (secondaryText)
|
| 730 |
+
if (currentItem.transliteration) {
|
| 731 |
+
secondaryText = highlightLetterInWord(currentItem.transliteration, targetLetter);
|
| 732 |
+
}
|
| 733 |
|
| 734 |
+
// 3. إضافة الحرف التكراري في الزاوية العلوية اليسرى
|
| 735 |
+
const cornerTextLeft = `${targetLetter}ⵢⴰ`;
|
| 736 |
+
cornerElementHTML += `
|
| 737 |
+
<div class="absolute top-0 left-0 p-3 bg-white/20 backdrop-blur-sm rounded-tl-3xl rounded-br-3xl shadow-md text-white">
|
| 738 |
+
<h2 class="font-black text-4xl icon-shadow text-yellow-300">
|
| 739 |
+
${cornerTextLeft}
|
| 740 |
+
</h2>
|
| 741 |
+
</div>
|
| 742 |
+
`;
|
| 743 |
+
|
| 744 |
+
// 4. الحرف في الزاوية العلوية اليمنى (الحرف الكبير الأصلي)
|
| 745 |
+
cornerElementHTML += `
|
| 746 |
+
<div class="absolute top-0 right-0 p-3 bg-white/20 backdrop-blur-sm rounded-tr-3xl rounded-bl-3xl shadow-md text-white">
|
| 747 |
+
<h2 class="font-black text-4xl icon-shadow">
|
| 748 |
+
${targetLetter}
|
| 749 |
+
</h2>
|
| 750 |
+
</div>
|
| 751 |
+
`;
|
| 752 |
+
|
| 753 |
+
} else {
|
| 754 |
+
// Logic for other categories
|
| 755 |
+
const cornerText = currentItem.main.length > 3 ? categoryMeta.title : currentItem.main;
|
| 756 |
+
cornerElementHTML = `
|
| 757 |
+
<div class="absolute top-0 right-0 p-3 bg-white/20 backdrop-blur-sm rounded-tr-3xl rounded-bl-3xl shadow-md text-white">
|
| 758 |
+
<h2 class="font-black text-xl icon-shadow">
|
| 759 |
+
${cornerText}
|
| 760 |
+
</h2>
|
| 761 |
+
</div>
|
| 762 |
+
`;
|
| 763 |
+
}
|
| 764 |
+
|
| 765 |
const micAction = isRecordingActive ? 'stopRecording()' : 'startRecording()';
|
| 766 |
const micButtonClass = isRecordingActive
|
| 767 |
? 'bg-red-600 hover:bg-red-700 shadow-2xl shadow-red-400/70 animate-pulse'
|
|
|
|
| 782 |
</div>
|
| 783 |
|
| 784 |
<div class="mt-1 text-center text-white">
|
| 785 |
+
<p class="${mainWordClasses}">${mainWordDisplay}</p>
|
| 786 |
+
|
| 787 |
+
<p class="text-2xl font-black mb-1 drop-shadow-lg leading-tight ${isTifinaghLetters ? 'mt-3' : ''}">
|
| 788 |
${secondaryText}
|
| 789 |
</p>
|
| 790 |
+
|
| 791 |
+
<p class="text-sm font-medium opacity-80 italic drop-shadow-sm mt-1">
|
| 792 |
+
${currentItem.word}
|
| 793 |
+
</p>
|
| 794 |
</div>
|
| 795 |
</div>
|
| 796 |
|
|
|
|
| 824 |
</div>
|
| 825 |
`;
|
| 826 |
};
|
| 827 |
+
|
| 828 |
// --- 9. شاشة الإعدادات (Settings Screen) ---
|
| 829 |
+
// ... (بقية الدوال - لم تتغير) ...
|
| 830 |
+
|
| 831 |
const renderSettingsScreen = () => {
|
| 832 |
const content = document.getElementById('app-content');
|
| 833 |
|