projectspro20 commited on
Commit
1e92465
·
verified ·
1 Parent(s): 714995a

display some related modules when a course selected and its cost as well as total below

Browse files
Files changed (1) hide show
  1. course-selection.html +382 -5
course-selection.html CHANGED
@@ -67,11 +67,11 @@
67
  </select>
68
  </div>
69
  </div>
70
-
71
  <!-- Modules Selection -->
72
  <div class="bg-white rounded-xl shadow-md overflow-hidden" x-show="selectedCourse">
73
  <div class="px-6 py-4 border-b border-gray-200">
74
- <h2 class="text-xl font-semibold text-gray-800">Select Modules</h2>
 
75
  </div>
76
 
77
  <div class="divide-y divide-gray-200">
@@ -83,18 +83,395 @@
83
  <div>
84
  <label :for="'module-'+module.id" class="text-lg font-medium text-gray-900 cursor-pointer" x-text="module.title"></label>
85
  <p class="mt-1 text-sm text-gray-500" x-text="module.description"></p>
 
 
 
 
86
  </div>
87
  </div>
88
- <div class="text-lg font-medium text-indigo-600" x-text="'$'+module.price"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  </div>
90
  </div>
91
  </template>
92
  </div>
93
  </div>
94
 
95
- <!-- Total Price -->
96
- <div class="mt-8 bg-white rounded-xl shadow-md overflow-hidden" x-show="selectedModules.length > 0">
 
 
 
97
  <div class="p-6">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  <div class="flex justify-between items-center">
99
  <div>
100
  <h3 class="text-lg font-medium text-gray-900">Total Price</h3>
 
67
  </select>
68
  </div>
69
  </div>
 
70
  <!-- Modules Selection -->
71
  <div class="bg-white rounded-xl shadow-md overflow-hidden" x-show="selectedCourse">
72
  <div class="px-6 py-4 border-b border-gray-200">
73
+ <h2 class="text-xl font-semibold text-gray-800">Available Modules</h2>
74
+ <p class="mt-1 text-sm text-gray-500" x-text="'Select modules to add to your learning path'"></p>
75
  </div>
76
 
77
  <div class="divide-y divide-gray-200">
 
83
  <div>
84
  <label :for="'module-'+module.id" class="text-lg font-medium text-gray-900 cursor-pointer" x-text="module.title"></label>
85
  <p class="mt-1 text-sm text-gray-500" x-text="module.description"></p>
86
+ <div class="mt-2 flex items-center text-sm text-gray-500">
87
+ <i data-feather="clock" class="w-4 h-4 mr-1"></i>
88
+ <span x-text="module.duration"></span>
89
+ </div>
90
  </div>
91
  </div>
92
+ <div class="text-lg font-medium text-indigo-600" x-text="'
93
+ <div class="p-6" x-show="selectedModules.length > 0">
94
+ <button @click="saveSelection()" class="w-full px-6 py-3 bg-indigo-600 rounded-lg text-white font-medium hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition">
95
+ Enroll Now ($<span x-text="totalPrice"></span>)
96
+ </button>
97
+ <p class="mt-2 text-center text-sm text-gray-500">
98
+ Or <a href="#" @click.prevent="selectedModules = []" class="text-indigo-600 hover:text-indigo-800">clear selection</a>
99
+ </p>
100
+ </div>
101
+ </div>
102
+ </main>
103
+
104
+ <!-- Footer -->
105
+ <footer class="bg-gray-800 text-white py-8">
106
+ <div class="container mx-auto px-4">
107
+ <div class="grid grid-cols-1 md:grid-cols-4 gap-8">
108
+ <div>
109
+ <h3 class="text-lg font-semibold mb-4">LearnFlow</h3>
110
+ <p class="text-gray-400">Master modern web development with our interactive courses.</p>
111
+ </div>
112
+ <div>
113
+ <h4 class="text-md font-semibold mb-4">Courses</h4>
114
+ <ul class="space-y-2">
115
+ <li><a href="index.html" class="text-gray-400 hover:text-white">Web Development</a></li>
116
+ <li><a href="index.html" class="text-gray-400 hover:text-white">Mobile Apps</a></li>
117
+ <li><a href="index.html" class="text-gray-400 hover:text-white">Data Science</a></li>
118
+ </ul>
119
+ </div>
120
+ <div>
121
+ <h4 class="text-md font-semibold mb-4">Resources</h4>
122
+ <ul class="space-y-2">
123
+ <li><a href="index.html" class="text-gray-400 hover:text-white">Documentation</a></li>
124
+ <li><a href="index.html" class="text-gray-400 hover:text-white">Community</a></li>
125
+ <li><a href="index.html" class="text-gray-400 hover:text-white">Blog</a></li>
126
+ </ul>
127
+ </div>
128
+ <div>
129
+ <h4 class="text-md font-semibold mb-4">Connect</h4>
130
+ <div class="flex space-x-4">
131
+ <a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="twitter"></i></a>
132
+ <a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="facebook"></i></a>
133
+ <a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="linkedin"></i></a>
134
+ <a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="github"></i></a>
135
+ </div>
136
+ </div>
137
+ </div>
138
+ <div class="mt-8 pt-8 border-t border-gray-700 text-center text-gray-400">
139
+ <p>© 2023 LearnFlow. All rights reserved.</p>
140
+ </div>
141
+ </div>
142
+ </footer>
143
+ </div>
144
+
145
+ <script>
146
+ function courseSelection() {
147
+ return {
148
+ selectedCourse: '',
149
+ selectedModules: [],
150
+ modules: [],
151
+ allModules: {
152
+ webdev: [
153
+ { id: 'webdev-1', title: 'Introduction to Laravel', description: 'Learn the fundamentals of Laravel framework', price: 49, duration: '2 hours' },
154
+ { id: 'webdev-2', title: 'Laravel Fundamentals', description: 'Master routing, controllers and views', price: 79, duration: '3.5 hours' },
155
+ { id: 'webdev-3', title: 'Working with Databases', description: 'Eloquent ORM and database migrations', price: 89, duration: '4 hours' },
156
+ { id: 'webdev-4', title: 'Authentication & Authorization', description: 'Implement secure user systems', price: 69, duration: '2.5 hours' },
157
+ { id: 'webdev-5', title: 'API Development', description: 'Build RESTful APIs with Laravel', price: 99, duration: '5 hours' }
158
+ ],
159
+ mobile: [
160
+ { id: 'mobile-1', title: 'Flutter Basics', description: 'Introduction to Flutter framework', price: 59, duration: '2 hours' },
161
+ { id: 'mobile-2', title: 'UI Development', description: 'Building beautiful mobile interfaces', price: 79, duration: '3 hours' },
162
+ { id: 'mobile-3', title: 'State Management', description: 'Managing app state effectively', price: 89, duration: '3.5 hours' },
163
+ { id: 'mobile-4', title: 'Firebase Integration', description: 'Connect your app to Firebase', price: 69, duration: '2.5 hours' }
164
+ ],
165
+ datascience: [
166
+ { id: 'ds-1', title: 'Python for Data Science', description: 'Essential Python skills', price: 49, duration: '2 hours' },
167
+ { id: 'ds-2', title: 'Pandas & NumPy', description: 'Data manipulation and analysis', price: 79, duration: '3 hours' },
168
+ { id: 'ds-3', title: 'Machine Learning Basics', description: 'Introduction to ML concepts', price: 99, duration: '4 hours' },
169
+ { id: 'ds-4', title: 'Data Visualization', description: 'Creating insightful visualizations', price: 69, duration: '2.5 hours' },
170
+ { id: 'ds-5', title: 'Advanced ML Techniques', description: 'Deep learning and neural networks', price: 119, duration: '6 hours' }
171
+ ]
172
+ },
173
+ init() {
174
+ feather.replace();
175
+ },
176
+ updateModules() {
177
+ this.selectedModules = [];
178
+ this.modules = this.allModules[this.selectedCourse] || [];
179
+ },
180
+ get totalPrice() {
181
+ return this.selectedModules.reduce((total, moduleId) => {
182
+ const module = this.modules.find(m => m.id === moduleId);
183
+ return total + (module ? module.price : 0);
184
+ }, 0);
185
+ },
186
+ get totalDuration() {
187
+ const totalMinutes = this.selectedModules.reduce((total, moduleId) => {
188
+ const module = this.modules.find(m => m.id === moduleId);
189
+ if (!module) return total;
190
+ const hours = parseFloat(module.duration.split(' ')[0]);
191
+ return total + (hours * 60);
192
+ }, 0);
193
+
194
+ const hours = Math.floor(totalMinutes / 60);
195
+ const minutes = totalMinutes % 60;
196
+ return `${hours}h ${minutes}m total`;
197
+ },
198
+ saveSelection() {
199
+ // In a real app, this would send data to a server
200
+ alert(`Success! You've enrolled in ${this.selectedModules.length} modules for ${this.totalPrice}`);
201
+ // Reset form
202
+ this.selectedCourse = '';
203
+ this.selectedModules = [];
204
+ this.modules = [];
205
+ },
206
+ init() {
207
+ feather.replace();
208
+ // Auto-select first module when course is selected
209
+ this.$watch('selectedCourse', (value) => {
210
+ if (value && this.modules.length > 0) {
211
+ this.selectedModules = [this.modules[0].id];
212
+ }
213
+ });
214
+ }
215
+ }
216
+ }
217
+ </script>
218
+ <script>feather.replace();</script>
219
+ </body>
220
+ </html>+module.price"></div>
221
  </div>
222
  </div>
223
  </template>
224
  </div>
225
  </div>
226
 
227
+ <!-- Summary Section -->
228
+ <div class="mt-8 bg-white rounded-xl shadow-md overflow-hidden" x-show="selectedCourse">
229
+ <div class="px-6 py-4 border-b border-gray-200">
230
+ <h2 class="text-xl font-semibold text-gray-800">Your Selection</h2>
231
+ </div>
232
  <div class="p-6">
233
+ <div x-show="selectedModules.length === 0" class="text-center py-4">
234
+ <i data-feather="info" class="w-8 h-8 mx-auto text-gray-400"></i>
235
+ <p class="mt-2 text-gray-500">No modules selected yet</p>
236
+ </div>
237
+ <template x-for="moduleId in selectedModules" x-show="selectedModules.length > 0">
238
+ <div class="flex justify-between py-2 border-b border-gray-100 last:border-0">
239
+ <span x-text="modules.find(m => m.id === moduleId).title"></span>
240
+ <span class="text-indigo-600" x-text="'<div class="p-6">
241
+ <div class="flex justify-between items-center">
242
+ <div>
243
+ <h3 class="text-lg font-medium text-gray-900">Total Price</h3>
244
+ <p class="text-sm text-gray-500" x-text="selectedModules.length + ' modules selected'"></p>
245
+ </div>
246
+ <div class="text-2xl font-bold text-indigo-600" x-text="'$'+totalPrice"></div>
247
+ </div>
248
+ <div class="mt-6">
249
+ <button @click="saveSelection()" class="w-full px-6 py-3 bg-indigo-600 rounded-lg text-white font-medium hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition">
250
+ Save Selection
251
+ </button>
252
+ </div>
253
+ </div>
254
+ </div>
255
+ </div>
256
+ </main>
257
+
258
+ <!-- Footer -->
259
+ <footer class="bg-gray-800 text-white py-8">
260
+ <div class="container mx-auto px-4">
261
+ <div class="grid grid-cols-1 md:grid-cols-4 gap-8">
262
+ <div>
263
+ <h3 class="text-lg font-semibold mb-4">LearnFlow</h3>
264
+ <p class="text-gray-400">Master modern web development with our interactive courses.</p>
265
+ </div>
266
+ <div>
267
+ <h4 class="text-md font-semibold mb-4">Courses</h4>
268
+ <ul class="space-y-2">
269
+ <li><a href="index.html" class="text-gray-400 hover:text-white">Web Development</a></li>
270
+ <li><a href="index.html" class="text-gray-400 hover:text-white">Mobile Apps</a></li>
271
+ <li><a href="index.html" class="text-gray-400 hover:text-white">Data Science</a></li>
272
+ </ul>
273
+ </div>
274
+ <div>
275
+ <h4 class="text-md font-semibold mb-4">Resources</h4>
276
+ <ul class="space-y-2">
277
+ <li><a href="index.html" class="text-gray-400 hover:text-white">Documentation</a></li>
278
+ <li><a href="index.html" class="text-gray-400 hover:text-white">Community</a></li>
279
+ <li><a href="index.html" class="text-gray-400 hover:text-white">Blog</a></li>
280
+ </ul>
281
+ </div>
282
+ <div>
283
+ <h4 class="text-md font-semibold mb-4">Connect</h4>
284
+ <div class="flex space-x-4">
285
+ <a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="twitter"></i></a>
286
+ <a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="facebook"></i></a>
287
+ <a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="linkedin"></i></a>
288
+ <a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="github"></i></a>
289
+ </div>
290
+ </div>
291
+ </div>
292
+ <div class="mt-8 pt-8 border-t border-gray-700 text-center text-gray-400">
293
+ <p>© 2023 LearnFlow. All rights reserved.</p>
294
+ </div>
295
+ </div>
296
+ </footer>
297
+ </div>
298
+
299
+ <script>
300
+ function courseSelection() {
301
+ return {
302
+ selectedCourse: '',
303
+ selectedModules: [],
304
+ modules: [],
305
+ allModules: {
306
+ webdev: [
307
+ { id: 'webdev-1', title: 'Introduction to Laravel', description: 'Learn the fundamentals of Laravel framework', price: 49 },
308
+ { id: 'webdev-2', title: 'Laravel Fundamentals', description: 'Master routing, controllers and views', price: 79 },
309
+ { id: 'webdev-3', title: 'Working with Databases', description: 'Eloquent ORM and database migrations', price: 89 },
310
+ { id: 'webdev-4', title: 'Authentication & Authorization', description: 'Implement secure user systems', price: 69 }
311
+ ],
312
+ mobile: [
313
+ { id: 'mobile-1', title: 'Flutter Basics', description: 'Introduction to Flutter framework', price: 59 },
314
+ { id: 'mobile-2', title: 'UI Development', description: 'Building beautiful mobile interfaces', price: 79 },
315
+ { id: 'mobile-3', title: 'State Management', description: 'Managing app state effectively', price: 89 }
316
+ ],
317
+ datascience: [
318
+ { id: 'ds-1', title: 'Python for Data Science', description: 'Essential Python skills', price: 49 },
319
+ { id: 'ds-2', title: 'Pandas & NumPy', description: 'Data manipulation and analysis', price: 79 },
320
+ { id: 'ds-3', title: 'Machine Learning Basics', description: 'Introduction to ML concepts', price: 99 },
321
+ { id: 'ds-4', title: 'Data Visualization', description: 'Creating insightful visualizations', price: 69 }
322
+ ]
323
+ },
324
+ init() {
325
+ feather.replace();
326
+ },
327
+ updateModules() {
328
+ this.selectedModules = [];
329
+ this.modules = this.allModules[this.selectedCourse] || [];
330
+ },
331
+ get totalPrice() {
332
+ return this.selectedModules.reduce((total, moduleId) => {
333
+ const module = this.modules.find(m => m.id === moduleId);
334
+ return total + (module ? module.price : 0);
335
+ }, 0);
336
+ },
337
+ saveSelection() {
338
+ // In a real app, this would send data to a server
339
+ alert(`Success! ${this.selectedModules.length} modules saved with total price $${this.totalPrice}`);
340
+ // Reset form
341
+ this.selectedCourse = '';
342
+ this.selectedModules = [];
343
+ this.modules = [];
344
+ }
345
+ }
346
+ }
347
+ </script>
348
+ <script>feather.replace();</script>
349
+ </body>
350
+ </html>+modules.find(m => m.id === moduleId).price"></span>
351
+ </div>
352
+ </template>
353
+ <div class="mt-4 pt-4 border-t border-gray-200" x-show="selectedModules.length > 0">
354
+ <div class="flex justify-between items-center">
355
+ <span class="font-medium">Total</span>
356
+ <span class="text-xl font-bold text-indigo-600" x-text="'<div class="p-6">
357
+ <div class="flex justify-between items-center">
358
+ <div>
359
+ <h3 class="text-lg font-medium text-gray-900">Total Price</h3>
360
+ <p class="text-sm text-gray-500" x-text="selectedModules.length + ' modules selected'"></p>
361
+ </div>
362
+ <div class="text-2xl font-bold text-indigo-600" x-text="'$'+totalPrice"></div>
363
+ </div>
364
+ <div class="mt-6">
365
+ <button @click="saveSelection()" class="w-full px-6 py-3 bg-indigo-600 rounded-lg text-white font-medium hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition">
366
+ Save Selection
367
+ </button>
368
+ </div>
369
+ </div>
370
+ </div>
371
+ </div>
372
+ </main>
373
+
374
+ <!-- Footer -->
375
+ <footer class="bg-gray-800 text-white py-8">
376
+ <div class="container mx-auto px-4">
377
+ <div class="grid grid-cols-1 md:grid-cols-4 gap-8">
378
+ <div>
379
+ <h3 class="text-lg font-semibold mb-4">LearnFlow</h3>
380
+ <p class="text-gray-400">Master modern web development with our interactive courses.</p>
381
+ </div>
382
+ <div>
383
+ <h4 class="text-md font-semibold mb-4">Courses</h4>
384
+ <ul class="space-y-2">
385
+ <li><a href="index.html" class="text-gray-400 hover:text-white">Web Development</a></li>
386
+ <li><a href="index.html" class="text-gray-400 hover:text-white">Mobile Apps</a></li>
387
+ <li><a href="index.html" class="text-gray-400 hover:text-white">Data Science</a></li>
388
+ </ul>
389
+ </div>
390
+ <div>
391
+ <h4 class="text-md font-semibold mb-4">Resources</h4>
392
+ <ul class="space-y-2">
393
+ <li><a href="index.html" class="text-gray-400 hover:text-white">Documentation</a></li>
394
+ <li><a href="index.html" class="text-gray-400 hover:text-white">Community</a></li>
395
+ <li><a href="index.html" class="text-gray-400 hover:text-white">Blog</a></li>
396
+ </ul>
397
+ </div>
398
+ <div>
399
+ <h4 class="text-md font-semibold mb-4">Connect</h4>
400
+ <div class="flex space-x-4">
401
+ <a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="twitter"></i></a>
402
+ <a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="facebook"></i></a>
403
+ <a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="linkedin"></i></a>
404
+ <a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="github"></i></a>
405
+ </div>
406
+ </div>
407
+ </div>
408
+ <div class="mt-8 pt-8 border-t border-gray-700 text-center text-gray-400">
409
+ <p>© 2023 LearnFlow. All rights reserved.</p>
410
+ </div>
411
+ </div>
412
+ </footer>
413
+ </div>
414
+
415
+ <script>
416
+ function courseSelection() {
417
+ return {
418
+ selectedCourse: '',
419
+ selectedModules: [],
420
+ modules: [],
421
+ allModules: {
422
+ webdev: [
423
+ { id: 'webdev-1', title: 'Introduction to Laravel', description: 'Learn the fundamentals of Laravel framework', price: 49 },
424
+ { id: 'webdev-2', title: 'Laravel Fundamentals', description: 'Master routing, controllers and views', price: 79 },
425
+ { id: 'webdev-3', title: 'Working with Databases', description: 'Eloquent ORM and database migrations', price: 89 },
426
+ { id: 'webdev-4', title: 'Authentication & Authorization', description: 'Implement secure user systems', price: 69 }
427
+ ],
428
+ mobile: [
429
+ { id: 'mobile-1', title: 'Flutter Basics', description: 'Introduction to Flutter framework', price: 59 },
430
+ { id: 'mobile-2', title: 'UI Development', description: 'Building beautiful mobile interfaces', price: 79 },
431
+ { id: 'mobile-3', title: 'State Management', description: 'Managing app state effectively', price: 89 }
432
+ ],
433
+ datascience: [
434
+ { id: 'ds-1', title: 'Python for Data Science', description: 'Essential Python skills', price: 49 },
435
+ { id: 'ds-2', title: 'Pandas & NumPy', description: 'Data manipulation and analysis', price: 79 },
436
+ { id: 'ds-3', title: 'Machine Learning Basics', description: 'Introduction to ML concepts', price: 99 },
437
+ { id: 'ds-4', title: 'Data Visualization', description: 'Creating insightful visualizations', price: 69 }
438
+ ]
439
+ },
440
+ init() {
441
+ feather.replace();
442
+ },
443
+ updateModules() {
444
+ this.selectedModules = [];
445
+ this.modules = this.allModules[this.selectedCourse] || [];
446
+ },
447
+ get totalPrice() {
448
+ return this.selectedModules.reduce((total, moduleId) => {
449
+ const module = this.modules.find(m => m.id === moduleId);
450
+ return total + (module ? module.price : 0);
451
+ }, 0);
452
+ },
453
+ saveSelection() {
454
+ // In a real app, this would send data to a server
455
+ alert(`Success! ${this.selectedModules.length} modules saved with total price $${this.totalPrice}`);
456
+ // Reset form
457
+ this.selectedCourse = '';
458
+ this.selectedModules = [];
459
+ this.modules = [];
460
+ }
461
+ }
462
+ }
463
+ </script>
464
+ <script>feather.replace();</script>
465
+ </body>
466
+ </html>+totalPrice"></span>
467
+ </div>
468
+ <div class="mt-2 text-sm text-gray-500">
469
+ <span x-text="selectedModules.length + ' modules selected'"></span>
470
+ <span class="mx-2">•</span>
471
+ <span x-text="totalDuration"></span>
472
+ </div>
473
+ </div>
474
+ <div class="p-6">
475
  <div class="flex justify-between items-center">
476
  <div>
477
  <h3 class="text-lg font-medium text-gray-900">Total Price</h3>