iyadomry commited on
Commit
673b722
·
verified ·
1 Parent(s): 38d76fc

write web page teach kids math 6-8 years in arabic language

Browse files
Files changed (2) hide show
  1. README.md +8 -5
  2. index.html +246 -18
README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Math Magic For Little Einsteins
3
- emoji: 🌖
4
- colorFrom: indigo
5
- colorTo: gray
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
1
  ---
2
+ title: Math Magic for Little Einsteins 🧮✨
3
+ colorFrom: purple
4
+ colorTo: yellow
5
+ emoji: 🐳
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite-v3
10
  ---
11
 
12
+ # Welcome to your new DeepSite project!
13
+ This project was created with [DeepSite](https://deepsite.hf.co).
index.html CHANGED
@@ -1,19 +1,247 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
1
+ <!DOCTYPE html>
2
+ <html lang="ar" dir="rtl">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>سحر الرياضيات للأطفال</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <script src="https://unpkg.com/feather-icons"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
10
+ <style>
11
+ @import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;700&display=swap');
12
+ body {
13
+ font-family: 'Tajawal', sans-serif;
14
+ }
15
+ .math-bubble {
16
+ animation: float 3s ease-in-out infinite;
17
+ }
18
+ @keyframes float {
19
+ 0%, 100% { transform: translateY(0); }
20
+ 50% { transform: translateY(-10px); }
21
+ }
22
+ .correct-answer {
23
+ animation: celebrate 0.5s ease;
24
+ }
25
+ @keyframes celebrate {
26
+ 0% { transform: scale(1); }
27
+ 50% { transform: scale(1.2); }
28
+ 100% { transform: scale(1); }
29
+ }
30
+ </style>
31
+ </head>
32
+ <body class="bg-gradient-to-b from-blue-100 to-purple-100 min-h-screen">
33
+ <div class="container mx-auto px-4 py-8">
34
+ <!-- Header -->
35
+ <header class="text-center mb-10">
36
+ <h1 class="text-4xl font-bold text-purple-700 mb-2">سحر الرياضيات 🧮</h1>
37
+ <p class="text-lg text-gray-600">تعلم الرياضيات بطريقة ممتعة وسهلة!</p>
38
+ <div class="w-24 h-2 bg-yellow-400 mx-auto mt-2 rounded-full"></div>
39
+ </header>
40
+
41
+ <!-- Main Content -->
42
+ <main>
43
+ <!-- Hero Section -->
44
+ <section class="bg-white rounded-2xl shadow-lg p-6 mb-10 text-center">
45
+ <div class="flex justify-center mb-6">
46
+ <div class="math-bubble bg-blue-500 text-white w-20 h-20 rounded-full flex items-center justify-center text-3xl font-bold">+</div>
47
+ <div class="math-bubble bg-green-500 text-white w-20 h-20 rounded-full flex items-center justify-center text-3xl font-bold mx-4">-</div>
48
+ <div class="math-bubble bg-yellow-500 text-white w-20 h-20 rounded-full flex items-center justify-center text-3xl font-bold">×</div>
49
+ </div>
50
+ <h2 class="text-2xl font-bold text-gray-800 mb-4">مرحباً بكم في عالم الرياضيات السحري!</h2>
51
+ <p class="text-gray-600 mb-6">هنا سنتعلم معاً الأعداد والجمع والطرح بطريقة سهلة وممتعة</p>
52
+ <button onclick="startLearning()" class="bg-purple-600 hover:bg-purple-700 text-white font-bold py-3 px-8 rounded-full text-lg transition duration-300 shadow-lg">
53
+ ابدأ التعلم الآن <i data-feather="arrow-left" class="mr-2"></i>
54
+ </button>
55
+ </section>
56
+
57
+ <!-- Learning Section (hidden by default) -->
58
+ <section id="learningSection" class="hidden bg-white rounded-2xl shadow-lg p-6">
59
+ <div class="flex justify-between items-center mb-6">
60
+ <h2 class="text-2xl font-bold text-gray-800">دعونا نتعلم!</h2>
61
+ <span id="score" class="bg-green-100 text-green-800 px-3 py-1 rounded-full font-bold">النقاط: 0</span>
62
+ </div>
63
+
64
+ <!-- Numbers Learning -->
65
+ <div id="numbersSection" class="mb-8">
66
+ <h3 class="text-xl font-semibold text-blue-600 mb-4 flex items-center">
67
+ <i data-feather="hash" class="mr-2"></i> تعلم الأعداد من 1 إلى 10
68
+ </h3>
69
+ <div class="grid grid-cols-2 sm:grid-cols-5 gap-4">
70
+ <!-- Numbers will be generated here -->
71
+ </div>
72
+ </div>
73
+
74
+ <!-- Addition Practice -->
75
+ <div id="additionSection" class="mb-8">
76
+ <h3 class="text-xl font-semibold text-green-600 mb-4 flex items-center">
77
+ <i data-feather="plus" class="mr-2"></i> تدرب على الجمع
78
+ </h3>
79
+ <div class="bg-blue-50 rounded-xl p-4">
80
+ <div id="additionQuestion" class="text-3xl font-bold text-center mb-4">؟ + ؟ =</div>
81
+ <div class="grid grid-cols-3 gap-3 max-w-xs mx-auto">
82
+ <!-- Answer options will be generated here -->
83
+ </div>
84
+ </div>
85
+ </div>
86
+
87
+ <!-- Subtraction Practice -->
88
+ <div id="subtractionSection" class="mb-8">
89
+ <h3 class="text-xl font-semibold text-yellow-600 mb-4 flex items-center">
90
+ <i data-feather="minus" class="mr-2"></i> تدرب على الطرح
91
+ </h3>
92
+ <div class="bg-green-50 rounded-xl p-4">
93
+ <div id="subtractionQuestion" class="text-3xl font-bold text-center mb-4">؟ - ؟ =</div>
94
+ <div class="grid grid-cols-3 gap-3 max-w-xs mx-auto">
95
+ <!-- Answer options will be generated here -->
96
+ </div>
97
+ </div>
98
+ </div>
99
+
100
+ <!-- Celebration -->
101
+ <div id="celebration" class="hidden text-center py-6">
102
+ <div class="text-5xl mb-4">🎉</div>
103
+ <h3 class="text-2xl font-bold text-purple-700 mb-2">أحسنت!</h3>
104
+ <p class="text-gray-600">لقد أكملت درس الرياضيات بنجاح!</p>
105
+ </div>
106
+ </section>
107
+ </main>
108
+
109
+ <!-- Footer -->
110
+ <footer class="text-center mt-12 text-gray-500 text-sm">
111
+ <p>صمم بحب لمساعدة الأطفال على تعلم الرياضيات</p>
112
+ </footer>
113
+ </div>
114
+
115
+ <script>
116
+ // Initialize feather icons
117
+ feather.replace();
118
+
119
+ // Generate numbers 1-10
120
+ const numbersContainer = document.querySelector('#numbersSection .grid');
121
+ for (let i = 1; i <= 10; i++) {
122
+ const numberDiv = document.createElement('div');
123
+ numberDiv.className = 'bg-purple-100 text-purple-700 rounded-lg p-4 text-center cursor-pointer transition hover:bg-purple-200 flex flex-col items-center';
124
+ numberDiv.innerHTML = `
125
+ <span class="text-3xl font-bold">${i}</span>
126
+ <span class="text-sm mt-1">${convertToArabicNumerals(i)}</span>
127
+ `;
128
+ numberDiv.addEventListener('click', () => {
129
+ numberDiv.classList.add('bg-purple-300', 'correct-answer');
130
+ setTimeout(() => {
131
+ numberDiv.classList.remove('bg-purple-300', 'correct-answer');
132
+ }, 500);
133
+ });
134
+ numbersContainer.appendChild(numberDiv);
135
+ }
136
+
137
+ // Math questions
138
+ function generateAdditionQuestion() {
139
+ const num1 = Math.floor(Math.random() * 5) + 1;
140
+ const num2 = Math.floor(Math.random() * 5) + 1;
141
+ const correctAnswer = num1 + num2;
142
+
143
+ document.getElementById('additionQuestion').textContent = `${num1} + ${num2} = ?`;
144
+
145
+ const optionsContainer = document.querySelector('#additionSection .grid');
146
+ optionsContainer.innerHTML = '';
147
+
148
+ // Generate 3 answer options (1 correct, 2 wrong)
149
+ let options = [correctAnswer];
150
+ while (options.length < 3) {
151
+ const randomOption = Math.floor(Math.random() * 10) + 1;
152
+ if (!options.includes(randomOption)) {
153
+ options.push(randomOption);
154
+ }
155
+ }
156
+
157
+ // Shuffle options
158
+ options = options.sort(() => Math.random() - 0.5);
159
+
160
+ options.forEach(option => {
161
+ const optionBtn = document.createElement('button');
162
+ optionBtn.className = 'bg-blue-200 hover:bg-blue-300 text-blue-800 font-bold py-3 rounded-lg transition';
163
+ optionBtn.textContent = option;
164
+ optionBtn.addEventListener('click', function() {
165
+ if (parseInt(this.textContent) === correctAnswer) {
166
+ this.classList.add('bg-green-300', 'text-green-800', 'correct-answer');
167
+ updateScore(5);
168
+ setTimeout(() => {
169
+ generateAdditionQuestion();
170
+ }, 1000);
171
+ } else {
172
+ this.classList.add('bg-red-300', 'text-red-800');
173
+ }
174
+ });
175
+ optionsContainer.appendChild(optionBtn);
176
+ });
177
+ }
178
+
179
+ function generateSubtractionQuestion() {
180
+ const num1 = Math.floor(Math.random() * 5) + 5;
181
+ const num2 = Math.floor(Math.random() * num1) + 1;
182
+ const correctAnswer = num1 - num2;
183
+
184
+ document.getElementById('subtractionQuestion').textContent = `${num1} - ${num2} = ?`;
185
+
186
+ const optionsContainer = document.querySelector('#subtractionSection .grid');
187
+ optionsContainer.innerHTML = '';
188
+
189
+ // Generate 3 answer options (1 correct, 2 wrong)
190
+ let options = [correctAnswer];
191
+ while (options.length < 3) {
192
+ const randomOption = Math.floor(Math.random() * 5) + 1;
193
+ if (!options.includes(randomOption)) {
194
+ options.push(randomOption);
195
+ }
196
+ }
197
+
198
+ // Shuffle options
199
+ options = options.sort(() => Math.random() - 0.5);
200
+
201
+ options.forEach(option => {
202
+ const optionBtn = document.createElement('button');
203
+ optionBtn.className = 'bg-green-200 hover:bg-green-300 text-green-800 font-bold py-3 rounded-lg transition';
204
+ optionBtn.textContent = option;
205
+ optionBtn.addEventListener('click', function() {
206
+ if (parseInt(this.textContent) === correctAnswer) {
207
+ this.classList.add('bg-green-300', 'text-green-800', 'correct-answer');
208
+ updateScore(5);
209
+ setTimeout(() => {
210
+ generateSubtractionQuestion();
211
+ }, 1000);
212
+ } else {
213
+ this.classList.add('bg-red-300', 'text-red-800');
214
+ }
215
+ });
216
+ optionsContainer.appendChild(optionBtn);
217
+ });
218
+ }
219
+
220
+ // Helper function to convert numbers to Arabic numerals
221
+ function convertToArabicNumerals(num) {
222
+ const arabicNumerals = ['٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩', '١٠'];
223
+ return arabicNumerals[num];
224
+ }
225
+
226
+ // Score system
227
+ let score = 0;
228
+ function updateScore(points) {
229
+ score += points;
230
+ document.getElementById('score').textContent = `النقاط: ${score}`;
231
+
232
+ if (score >= 30) {
233
+ document.getElementById('learningSection').classList.add('hidden');
234
+ document.getElementById('celebration').classList.remove('hidden');
235
+ }
236
+ }
237
+
238
+ // Start learning function
239
+ function startLearning() {
240
+ document.querySelector('main > section:first-child').classList.add('hidden');
241
+ document.getElementById('learningSection').classList.remove('hidden');
242
+ generateAdditionQuestion();
243
+ generateSubtractionQuestion();
244
+ }
245
+ </script>
246
+ </body>
247
  </html>