learnflow-course-module-explorer / course-selection.html
projectspro20's picture
display some related modules when a course selected and its cost as well as total below
1e92465 verified
Raw History Blame Contribute Delete
35 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Select Course Modules - LearnFlow</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/@tailwindcss/custom-forms@0.2.1/dist/custom-forms.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.8.2/dist/alpine.min.js" defer></script>
<link rel="stylesheet" href="style.css">
</head>
<body class="bg-gray-50 font-sans antialiased">
<div class="min-h-screen" x-data="courseSelection()">
<!-- Header -->
<header class="bg-indigo-700 text-white shadow-lg">
<div class="container mx-auto px-4 py-6">
<div class="flex justify-between items-center">
<div class="flex items-center space-x-2">
<i data-feather="book-open" class="w-8 h-8"></i>
<h1 class="text-2xl font-bold">LearnFlow</h1>
</div>
<nav class="hidden md:flex space-x-6">
<a href="index.html" class="hover:text-indigo-200">Dashboard</a>
<a href="index.html" class="hover:text-indigo-200">Courses</a>
<a href="index.html" class="hover:text-indigo-200">Progress</a>
<div class="flex items-center space-x-2">
<img src="http://static.photos/people/40x40/42" alt="User" class="w-8 h-8 rounded-full">
<span>John Doe</span>
</div>
</nav>
<button class="md:hidden" @click="mobileMenuOpen = !mobileMenuOpen">
<i data-feather="menu" class="w-6 h-6"></i>
</button>
</div>
</div>
</header>
<!-- Mobile Menu -->
<div class="md:hidden bg-indigo-800 text-white" x-show="mobileMenuOpen" x-transition>
<div class="container mx-auto px-4 py-3 space-y-3">
<a href="index.html" class="block py-2 hover:text-indigo-200">Dashboard</a>
<a href="index.html" class="block py-2 hover:text-indigo-200">Courses</a>
<a href="index.html" class="block py-2 hover:text-indigo-200">Progress</a>
<div class="flex items-center space-x-2 py-2">
<img src="http://static.photos/people/40x40/42" alt="User" class="w-8 h-8 rounded-full">
<span>John Doe</span>
</div>
</div>
</div>
<!-- Main Content -->
<main class="container mx-auto px-4 py-8">
<div class="max-w-4xl mx-auto">
<!-- Course Selection -->
<div class="bg-white rounded-xl shadow-md overflow-hidden mb-8">
<div class="px-6 py-4 border-b border-gray-200">
<h2 class="text-xl font-semibold text-gray-800">Select Course</h2>
</div>
<div class="p-6">
<select x-model="selectedCourse" @change="updateModules()" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
<option value="">-- Select a Course --</option>
<option value="webdev">Web Development</option>
<option value="mobile">Mobile Development</option>
<option value="datascience">Data Science</option>
</select>
</div>
</div>
<!-- Modules Selection -->
<div class="bg-white rounded-xl shadow-md overflow-hidden" x-show="selectedCourse">
<div class="px-6 py-4 border-b border-gray-200">
<h2 class="text-xl font-semibold text-gray-800">Available Modules</h2>
<p class="mt-1 text-sm text-gray-500" x-text="'Select modules to add to your learning path'"></p>
</div>
<div class="divide-y divide-gray-200">
<template x-for="module in modules" :key="module.id">
<div class="p-6 hover:bg-gray-50 transition">
<div class="flex items-center justify-between">
<div class="flex items-start space-x-4">
<input type="checkbox" :id="'module-'+module.id" x-model="selectedModules" :value="module.id" class="mt-1 h-5 w-5 text-indigo-600 rounded focus:ring-indigo-500">
<div>
<label :for="'module-'+module.id" class="text-lg font-medium text-gray-900 cursor-pointer" x-text="module.title"></label>
<p class="mt-1 text-sm text-gray-500" x-text="module.description"></p>
<div class="mt-2 flex items-center text-sm text-gray-500">
<i data-feather="clock" class="w-4 h-4 mr-1"></i>
<span x-text="module.duration"></span>
</div>
</div>
</div>
<div class="text-lg font-medium text-indigo-600" x-text="'
<div class="p-6" x-show="selectedModules.length > 0">
<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">
Enroll Now ($<span x-text="totalPrice"></span>)
</button>
<p class="mt-2 text-center text-sm text-gray-500">
Or <a href="#" @click.prevent="selectedModules = []" class="text-indigo-600 hover:text-indigo-800">clear selection</a>
</p>
</div>
</div>
</main>
<!-- Footer -->
<footer class="bg-gray-800 text-white py-8">
<div class="container mx-auto px-4">
<div class="grid grid-cols-1 md:grid-cols-4 gap-8">
<div>
<h3 class="text-lg font-semibold mb-4">LearnFlow</h3>
<p class="text-gray-400">Master modern web development with our interactive courses.</p>
</div>
<div>
<h4 class="text-md font-semibold mb-4">Courses</h4>
<ul class="space-y-2">
<li><a href="index.html" class="text-gray-400 hover:text-white">Web Development</a></li>
<li><a href="index.html" class="text-gray-400 hover:text-white">Mobile Apps</a></li>
<li><a href="index.html" class="text-gray-400 hover:text-white">Data Science</a></li>
</ul>
</div>
<div>
<h4 class="text-md font-semibold mb-4">Resources</h4>
<ul class="space-y-2">
<li><a href="index.html" class="text-gray-400 hover:text-white">Documentation</a></li>
<li><a href="index.html" class="text-gray-400 hover:text-white">Community</a></li>
<li><a href="index.html" class="text-gray-400 hover:text-white">Blog</a></li>
</ul>
</div>
<div>
<h4 class="text-md font-semibold mb-4">Connect</h4>
<div class="flex space-x-4">
<a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="twitter"></i></a>
<a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="facebook"></i></a>
<a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="linkedin"></i></a>
<a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="github"></i></a>
</div>
</div>
</div>
<div class="mt-8 pt-8 border-t border-gray-700 text-center text-gray-400">
<p>© 2023 LearnFlow. All rights reserved.</p>
</div>
</div>
</footer>
</div>
<script>
function courseSelection() {
return {
selectedCourse: '',
selectedModules: [],
modules: [],
allModules: {
webdev: [
{ id: 'webdev-1', title: 'Introduction to Laravel', description: 'Learn the fundamentals of Laravel framework', price: 49, duration: '2 hours' },
{ id: 'webdev-2', title: 'Laravel Fundamentals', description: 'Master routing, controllers and views', price: 79, duration: '3.5 hours' },
{ id: 'webdev-3', title: 'Working with Databases', description: 'Eloquent ORM and database migrations', price: 89, duration: '4 hours' },
{ id: 'webdev-4', title: 'Authentication & Authorization', description: 'Implement secure user systems', price: 69, duration: '2.5 hours' },
{ id: 'webdev-5', title: 'API Development', description: 'Build RESTful APIs with Laravel', price: 99, duration: '5 hours' }
],
mobile: [
{ id: 'mobile-1', title: 'Flutter Basics', description: 'Introduction to Flutter framework', price: 59, duration: '2 hours' },
{ id: 'mobile-2', title: 'UI Development', description: 'Building beautiful mobile interfaces', price: 79, duration: '3 hours' },
{ id: 'mobile-3', title: 'State Management', description: 'Managing app state effectively', price: 89, duration: '3.5 hours' },
{ id: 'mobile-4', title: 'Firebase Integration', description: 'Connect your app to Firebase', price: 69, duration: '2.5 hours' }
],
datascience: [
{ id: 'ds-1', title: 'Python for Data Science', description: 'Essential Python skills', price: 49, duration: '2 hours' },
{ id: 'ds-2', title: 'Pandas & NumPy', description: 'Data manipulation and analysis', price: 79, duration: '3 hours' },
{ id: 'ds-3', title: 'Machine Learning Basics', description: 'Introduction to ML concepts', price: 99, duration: '4 hours' },
{ id: 'ds-4', title: 'Data Visualization', description: 'Creating insightful visualizations', price: 69, duration: '2.5 hours' },
{ id: 'ds-5', title: 'Advanced ML Techniques', description: 'Deep learning and neural networks', price: 119, duration: '6 hours' }
]
},
init() {
feather.replace();
},
updateModules() {
this.selectedModules = [];
this.modules = this.allModules[this.selectedCourse] || [];
},
get totalPrice() {
return this.selectedModules.reduce((total, moduleId) => {
const module = this.modules.find(m => m.id === moduleId);
return total + (module ? module.price : 0);
}, 0);
},
get totalDuration() {
const totalMinutes = this.selectedModules.reduce((total, moduleId) => {
const module = this.modules.find(m => m.id === moduleId);
if (!module) return total;
const hours = parseFloat(module.duration.split(' ')[0]);
return total + (hours * 60);
}, 0);
const hours = Math.floor(totalMinutes / 60);
const minutes = totalMinutes % 60;
return `${hours}h ${minutes}m total`;
},
saveSelection() {
// In a real app, this would send data to a server
alert(`Success! You've enrolled in ${this.selectedModules.length} modules for ${this.totalPrice}`);
// Reset form
this.selectedCourse = '';
this.selectedModules = [];
this.modules = [];
},
init() {
feather.replace();
// Auto-select first module when course is selected
this.$watch('selectedCourse', (value) => {
if (value && this.modules.length > 0) {
this.selectedModules = [this.modules[0].id];
}
});
}
}
}
</script>
<script>feather.replace();</script>
</body>
</html>+module.price"></div>
</div>
</div>
</template>
</div>
</div>
<!-- Summary Section -->
<div class="mt-8 bg-white rounded-xl shadow-md overflow-hidden" x-show="selectedCourse">
<div class="px-6 py-4 border-b border-gray-200">
<h2 class="text-xl font-semibold text-gray-800">Your Selection</h2>
</div>
<div class="p-6">
<div x-show="selectedModules.length === 0" class="text-center py-4">
<i data-feather="info" class="w-8 h-8 mx-auto text-gray-400"></i>
<p class="mt-2 text-gray-500">No modules selected yet</p>
</div>
<template x-for="moduleId in selectedModules" x-show="selectedModules.length > 0">
<div class="flex justify-between py-2 border-b border-gray-100 last:border-0">
<span x-text="modules.find(m => m.id === moduleId).title"></span>
<span class="text-indigo-600" x-text="'<div class="p-6">
<div class="flex justify-between items-center">
<div>
<h3 class="text-lg font-medium text-gray-900">Total Price</h3>
<p class="text-sm text-gray-500" x-text="selectedModules.length + ' modules selected'"></p>
</div>
<div class="text-2xl font-bold text-indigo-600" x-text="'$'+totalPrice"></div>
</div>
<div class="mt-6">
<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">
Save Selection
</button>
</div>
</div>
</div>
</div>
</main>
<!-- Footer -->
<footer class="bg-gray-800 text-white py-8">
<div class="container mx-auto px-4">
<div class="grid grid-cols-1 md:grid-cols-4 gap-8">
<div>
<h3 class="text-lg font-semibold mb-4">LearnFlow</h3>
<p class="text-gray-400">Master modern web development with our interactive courses.</p>
</div>
<div>
<h4 class="text-md font-semibold mb-4">Courses</h4>
<ul class="space-y-2">
<li><a href="index.html" class="text-gray-400 hover:text-white">Web Development</a></li>
<li><a href="index.html" class="text-gray-400 hover:text-white">Mobile Apps</a></li>
<li><a href="index.html" class="text-gray-400 hover:text-white">Data Science</a></li>
</ul>
</div>
<div>
<h4 class="text-md font-semibold mb-4">Resources</h4>
<ul class="space-y-2">
<li><a href="index.html" class="text-gray-400 hover:text-white">Documentation</a></li>
<li><a href="index.html" class="text-gray-400 hover:text-white">Community</a></li>
<li><a href="index.html" class="text-gray-400 hover:text-white">Blog</a></li>
</ul>
</div>
<div>
<h4 class="text-md font-semibold mb-4">Connect</h4>
<div class="flex space-x-4">
<a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="twitter"></i></a>
<a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="facebook"></i></a>
<a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="linkedin"></i></a>
<a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="github"></i></a>
</div>
</div>
</div>
<div class="mt-8 pt-8 border-t border-gray-700 text-center text-gray-400">
<p>© 2023 LearnFlow. All rights reserved.</p>
</div>
</div>
</footer>
</div>
<script>
function courseSelection() {
return {
selectedCourse: '',
selectedModules: [],
modules: [],
allModules: {
webdev: [
{ id: 'webdev-1', title: 'Introduction to Laravel', description: 'Learn the fundamentals of Laravel framework', price: 49 },
{ id: 'webdev-2', title: 'Laravel Fundamentals', description: 'Master routing, controllers and views', price: 79 },
{ id: 'webdev-3', title: 'Working with Databases', description: 'Eloquent ORM and database migrations', price: 89 },
{ id: 'webdev-4', title: 'Authentication & Authorization', description: 'Implement secure user systems', price: 69 }
],
mobile: [
{ id: 'mobile-1', title: 'Flutter Basics', description: 'Introduction to Flutter framework', price: 59 },
{ id: 'mobile-2', title: 'UI Development', description: 'Building beautiful mobile interfaces', price: 79 },
{ id: 'mobile-3', title: 'State Management', description: 'Managing app state effectively', price: 89 }
],
datascience: [
{ id: 'ds-1', title: 'Python for Data Science', description: 'Essential Python skills', price: 49 },
{ id: 'ds-2', title: 'Pandas & NumPy', description: 'Data manipulation and analysis', price: 79 },
{ id: 'ds-3', title: 'Machine Learning Basics', description: 'Introduction to ML concepts', price: 99 },
{ id: 'ds-4', title: 'Data Visualization', description: 'Creating insightful visualizations', price: 69 }
]
},
init() {
feather.replace();
},
updateModules() {
this.selectedModules = [];
this.modules = this.allModules[this.selectedCourse] || [];
},
get totalPrice() {
return this.selectedModules.reduce((total, moduleId) => {
const module = this.modules.find(m => m.id === moduleId);
return total + (module ? module.price : 0);
}, 0);
},
saveSelection() {
// In a real app, this would send data to a server
alert(`Success! ${this.selectedModules.length} modules saved with total price $${this.totalPrice}`);
// Reset form
this.selectedCourse = '';
this.selectedModules = [];
this.modules = [];
}
}
}
</script>
<script>feather.replace();</script>
</body>
</html>+modules.find(m => m.id === moduleId).price"></span>
</div>
</template>
<div class="mt-4 pt-4 border-t border-gray-200" x-show="selectedModules.length > 0">
<div class="flex justify-between items-center">
<span class="font-medium">Total</span>
<span class="text-xl font-bold text-indigo-600" x-text="'<div class="p-6">
<div class="flex justify-between items-center">
<div>
<h3 class="text-lg font-medium text-gray-900">Total Price</h3>
<p class="text-sm text-gray-500" x-text="selectedModules.length + ' modules selected'"></p>
</div>
<div class="text-2xl font-bold text-indigo-600" x-text="'$'+totalPrice"></div>
</div>
<div class="mt-6">
<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">
Save Selection
</button>
</div>
</div>
</div>
</div>
</main>
<!-- Footer -->
<footer class="bg-gray-800 text-white py-8">
<div class="container mx-auto px-4">
<div class="grid grid-cols-1 md:grid-cols-4 gap-8">
<div>
<h3 class="text-lg font-semibold mb-4">LearnFlow</h3>
<p class="text-gray-400">Master modern web development with our interactive courses.</p>
</div>
<div>
<h4 class="text-md font-semibold mb-4">Courses</h4>
<ul class="space-y-2">
<li><a href="index.html" class="text-gray-400 hover:text-white">Web Development</a></li>
<li><a href="index.html" class="text-gray-400 hover:text-white">Mobile Apps</a></li>
<li><a href="index.html" class="text-gray-400 hover:text-white">Data Science</a></li>
</ul>
</div>
<div>
<h4 class="text-md font-semibold mb-4">Resources</h4>
<ul class="space-y-2">
<li><a href="index.html" class="text-gray-400 hover:text-white">Documentation</a></li>
<li><a href="index.html" class="text-gray-400 hover:text-white">Community</a></li>
<li><a href="index.html" class="text-gray-400 hover:text-white">Blog</a></li>
</ul>
</div>
<div>
<h4 class="text-md font-semibold mb-4">Connect</h4>
<div class="flex space-x-4">
<a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="twitter"></i></a>
<a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="facebook"></i></a>
<a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="linkedin"></i></a>
<a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="github"></i></a>
</div>
</div>
</div>
<div class="mt-8 pt-8 border-t border-gray-700 text-center text-gray-400">
<p>© 2023 LearnFlow. All rights reserved.</p>
</div>
</div>
</footer>
</div>
<script>
function courseSelection() {
return {
selectedCourse: '',
selectedModules: [],
modules: [],
allModules: {
webdev: [
{ id: 'webdev-1', title: 'Introduction to Laravel', description: 'Learn the fundamentals of Laravel framework', price: 49 },
{ id: 'webdev-2', title: 'Laravel Fundamentals', description: 'Master routing, controllers and views', price: 79 },
{ id: 'webdev-3', title: 'Working with Databases', description: 'Eloquent ORM and database migrations', price: 89 },
{ id: 'webdev-4', title: 'Authentication & Authorization', description: 'Implement secure user systems', price: 69 }
],
mobile: [
{ id: 'mobile-1', title: 'Flutter Basics', description: 'Introduction to Flutter framework', price: 59 },
{ id: 'mobile-2', title: 'UI Development', description: 'Building beautiful mobile interfaces', price: 79 },
{ id: 'mobile-3', title: 'State Management', description: 'Managing app state effectively', price: 89 }
],
datascience: [
{ id: 'ds-1', title: 'Python for Data Science', description: 'Essential Python skills', price: 49 },
{ id: 'ds-2', title: 'Pandas & NumPy', description: 'Data manipulation and analysis', price: 79 },
{ id: 'ds-3', title: 'Machine Learning Basics', description: 'Introduction to ML concepts', price: 99 },
{ id: 'ds-4', title: 'Data Visualization', description: 'Creating insightful visualizations', price: 69 }
]
},
init() {
feather.replace();
},
updateModules() {
this.selectedModules = [];
this.modules = this.allModules[this.selectedCourse] || [];
},
get totalPrice() {
return this.selectedModules.reduce((total, moduleId) => {
const module = this.modules.find(m => m.id === moduleId);
return total + (module ? module.price : 0);
}, 0);
},
saveSelection() {
// In a real app, this would send data to a server
alert(`Success! ${this.selectedModules.length} modules saved with total price $${this.totalPrice}`);
// Reset form
this.selectedCourse = '';
this.selectedModules = [];
this.modules = [];
}
}
}
</script>
<script>feather.replace();</script>
</body>
</html>+totalPrice"></span>
</div>
<div class="mt-2 text-sm text-gray-500">
<span x-text="selectedModules.length + ' modules selected'"></span>
<span class="mx-2">•</span>
<span x-text="totalDuration"></span>
</div>
</div>
<div class="p-6">
<div class="flex justify-between items-center">
<div>
<h3 class="text-lg font-medium text-gray-900">Total Price</h3>
<p class="text-sm text-gray-500" x-text="selectedModules.length + ' modules selected'"></p>
</div>
<div class="text-2xl font-bold text-indigo-600" x-text="'$'+totalPrice"></div>
</div>
<div class="mt-6">
<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">
Save Selection
</button>
</div>
</div>
</div>
</div>
</main>
<!-- Footer -->
<footer class="bg-gray-800 text-white py-8">
<div class="container mx-auto px-4">
<div class="grid grid-cols-1 md:grid-cols-4 gap-8">
<div>
<h3 class="text-lg font-semibold mb-4">LearnFlow</h3>
<p class="text-gray-400">Master modern web development with our interactive courses.</p>
</div>
<div>
<h4 class="text-md font-semibold mb-4">Courses</h4>
<ul class="space-y-2">
<li><a href="index.html" class="text-gray-400 hover:text-white">Web Development</a></li>
<li><a href="index.html" class="text-gray-400 hover:text-white">Mobile Apps</a></li>
<li><a href="index.html" class="text-gray-400 hover:text-white">Data Science</a></li>
</ul>
</div>
<div>
<h4 class="text-md font-semibold mb-4">Resources</h4>
<ul class="space-y-2">
<li><a href="index.html" class="text-gray-400 hover:text-white">Documentation</a></li>
<li><a href="index.html" class="text-gray-400 hover:text-white">Community</a></li>
<li><a href="index.html" class="text-gray-400 hover:text-white">Blog</a></li>
</ul>
</div>
<div>
<h4 class="text-md font-semibold mb-4">Connect</h4>
<div class="flex space-x-4">
<a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="twitter"></i></a>
<a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="facebook"></i></a>
<a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="linkedin"></i></a>
<a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="github"></i></a>
</div>
</div>
</div>
<div class="mt-8 pt-8 border-t border-gray-700 text-center text-gray-400">
<p>© 2023 LearnFlow. All rights reserved.</p>
</div>
</div>
</footer>
</div>
<script>
function courseSelection() {
return {
selectedCourse: '',
selectedModules: [],
modules: [],
allModules: {
webdev: [
{ id: 'webdev-1', title: 'Introduction to Laravel', description: 'Learn the fundamentals of Laravel framework', price: 49 },
{ id: 'webdev-2', title: 'Laravel Fundamentals', description: 'Master routing, controllers and views', price: 79 },
{ id: 'webdev-3', title: 'Working with Databases', description: 'Eloquent ORM and database migrations', price: 89 },
{ id: 'webdev-4', title: 'Authentication & Authorization', description: 'Implement secure user systems', price: 69 }
],
mobile: [
{ id: 'mobile-1', title: 'Flutter Basics', description: 'Introduction to Flutter framework', price: 59 },
{ id: 'mobile-2', title: 'UI Development', description: 'Building beautiful mobile interfaces', price: 79 },
{ id: 'mobile-3', title: 'State Management', description: 'Managing app state effectively', price: 89 }
],
datascience: [
{ id: 'ds-1', title: 'Python for Data Science', description: 'Essential Python skills', price: 49 },
{ id: 'ds-2', title: 'Pandas & NumPy', description: 'Data manipulation and analysis', price: 79 },
{ id: 'ds-3', title: 'Machine Learning Basics', description: 'Introduction to ML concepts', price: 99 },
{ id: 'ds-4', title: 'Data Visualization', description: 'Creating insightful visualizations', price: 69 }
]
},
init() {
feather.replace();
},
updateModules() {
this.selectedModules = [];
this.modules = this.allModules[this.selectedCourse] || [];
},
get totalPrice() {
return this.selectedModules.reduce((total, moduleId) => {
const module = this.modules.find(m => m.id === moduleId);
return total + (module ? module.price : 0);
}, 0);
},
saveSelection() {
// In a real app, this would send data to a server
alert(`Success! ${this.selectedModules.length} modules saved with total price $${this.totalPrice}`);
// Reset form
this.selectedCourse = '';
this.selectedModules = [];
this.modules = [];
}
}
}
</script>
<script>feather.replace();</script>
</body>
</html>