create view to select and display course then select modules they want each module will have a respective price, display the total price below then allow it to be saved
Browse files- course-selection.html +207 -0
- create-lesson.html +2 -2
- index.html +8 -8
course-selection.html
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Select Course Modules - LearnFlow</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 |
+
<link href="https://cdn.jsdelivr.net/npm/@tailwindcss/custom-forms@0.2.1/dist/custom-forms.min.css" rel="stylesheet">
|
| 11 |
+
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.8.2/dist/alpine.min.js" defer></script>
|
| 12 |
+
<link rel="stylesheet" href="style.css">
|
| 13 |
+
</head>
|
| 14 |
+
<body class="bg-gray-50 font-sans antialiased">
|
| 15 |
+
<div class="min-h-screen" x-data="courseSelection()">
|
| 16 |
+
<!-- Header -->
|
| 17 |
+
<header class="bg-indigo-700 text-white shadow-lg">
|
| 18 |
+
<div class="container mx-auto px-4 py-6">
|
| 19 |
+
<div class="flex justify-between items-center">
|
| 20 |
+
<div class="flex items-center space-x-2">
|
| 21 |
+
<i data-feather="book-open" class="w-8 h-8"></i>
|
| 22 |
+
<h1 class="text-2xl font-bold">LearnFlow</h1>
|
| 23 |
+
</div>
|
| 24 |
+
<nav class="hidden md:flex space-x-6">
|
| 25 |
+
<a href="index.html" class="hover:text-indigo-200">Dashboard</a>
|
| 26 |
+
<a href="index.html" class="hover:text-indigo-200">Courses</a>
|
| 27 |
+
<a href="index.html" class="hover:text-indigo-200">Progress</a>
|
| 28 |
+
<div class="flex items-center space-x-2">
|
| 29 |
+
<img src="http://static.photos/people/40x40/42" alt="User" class="w-8 h-8 rounded-full">
|
| 30 |
+
<span>John Doe</span>
|
| 31 |
+
</div>
|
| 32 |
+
</nav>
|
| 33 |
+
<button class="md:hidden" @click="mobileMenuOpen = !mobileMenuOpen">
|
| 34 |
+
<i data-feather="menu" class="w-6 h-6"></i>
|
| 35 |
+
</button>
|
| 36 |
+
</div>
|
| 37 |
+
</div>
|
| 38 |
+
</header>
|
| 39 |
+
|
| 40 |
+
<!-- Mobile Menu -->
|
| 41 |
+
<div class="md:hidden bg-indigo-800 text-white" x-show="mobileMenuOpen" x-transition>
|
| 42 |
+
<div class="container mx-auto px-4 py-3 space-y-3">
|
| 43 |
+
<a href="index.html" class="block py-2 hover:text-indigo-200">Dashboard</a>
|
| 44 |
+
<a href="index.html" class="block py-2 hover:text-indigo-200">Courses</a>
|
| 45 |
+
<a href="index.html" class="block py-2 hover:text-indigo-200">Progress</a>
|
| 46 |
+
<div class="flex items-center space-x-2 py-2">
|
| 47 |
+
<img src="http://static.photos/people/40x40/42" alt="User" class="w-8 h-8 rounded-full">
|
| 48 |
+
<span>John Doe</span>
|
| 49 |
+
</div>
|
| 50 |
+
</div>
|
| 51 |
+
</div>
|
| 52 |
+
|
| 53 |
+
<!-- Main Content -->
|
| 54 |
+
<main class="container mx-auto px-4 py-8">
|
| 55 |
+
<div class="max-w-4xl mx-auto">
|
| 56 |
+
<!-- Course Selection -->
|
| 57 |
+
<div class="bg-white rounded-xl shadow-md overflow-hidden mb-8">
|
| 58 |
+
<div class="px-6 py-4 border-b border-gray-200">
|
| 59 |
+
<h2 class="text-xl font-semibold text-gray-800">Select Course</h2>
|
| 60 |
+
</div>
|
| 61 |
+
<div class="p-6">
|
| 62 |
+
<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">
|
| 63 |
+
<option value="">-- Select a Course --</option>
|
| 64 |
+
<option value="webdev">Web Development</option>
|
| 65 |
+
<option value="mobile">Mobile Development</option>
|
| 66 |
+
<option value="datascience">Data Science</option>
|
| 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">
|
| 78 |
+
<template x-for="module in modules" :key="module.id">
|
| 79 |
+
<div class="p-6 hover:bg-gray-50 transition">
|
| 80 |
+
<div class="flex items-center justify-between">
|
| 81 |
+
<div class="flex items-start space-x-4">
|
| 82 |
+
<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">
|
| 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>
|
| 101 |
+
<p class="text-sm text-gray-500" x-text="selectedModules.length + ' modules selected'"></p>
|
| 102 |
+
</div>
|
| 103 |
+
<div class="text-2xl font-bold text-indigo-600" x-text="'$'+totalPrice"></div>
|
| 104 |
+
</div>
|
| 105 |
+
<div class="mt-6">
|
| 106 |
+
<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">
|
| 107 |
+
Save Selection
|
| 108 |
+
</button>
|
| 109 |
+
</div>
|
| 110 |
+
</div>
|
| 111 |
+
</div>
|
| 112 |
+
</div>
|
| 113 |
+
</main>
|
| 114 |
+
|
| 115 |
+
<!-- Footer -->
|
| 116 |
+
<footer class="bg-gray-800 text-white py-8">
|
| 117 |
+
<div class="container mx-auto px-4">
|
| 118 |
+
<div class="grid grid-cols-1 md:grid-cols-4 gap-8">
|
| 119 |
+
<div>
|
| 120 |
+
<h3 class="text-lg font-semibold mb-4">LearnFlow</h3>
|
| 121 |
+
<p class="text-gray-400">Master modern web development with our interactive courses.</p>
|
| 122 |
+
</div>
|
| 123 |
+
<div>
|
| 124 |
+
<h4 class="text-md font-semibold mb-4">Courses</h4>
|
| 125 |
+
<ul class="space-y-2">
|
| 126 |
+
<li><a href="index.html" class="text-gray-400 hover:text-white">Web Development</a></li>
|
| 127 |
+
<li><a href="index.html" class="text-gray-400 hover:text-white">Mobile Apps</a></li>
|
| 128 |
+
<li><a href="index.html" class="text-gray-400 hover:text-white">Data Science</a></li>
|
| 129 |
+
</ul>
|
| 130 |
+
</div>
|
| 131 |
+
<div>
|
| 132 |
+
<h4 class="text-md font-semibold mb-4">Resources</h4>
|
| 133 |
+
<ul class="space-y-2">
|
| 134 |
+
<li><a href="index.html" class="text-gray-400 hover:text-white">Documentation</a></li>
|
| 135 |
+
<li><a href="index.html" class="text-gray-400 hover:text-white">Community</a></li>
|
| 136 |
+
<li><a href="index.html" class="text-gray-400 hover:text-white">Blog</a></li>
|
| 137 |
+
</ul>
|
| 138 |
+
</div>
|
| 139 |
+
<div>
|
| 140 |
+
<h4 class="text-md font-semibold mb-4">Connect</h4>
|
| 141 |
+
<div class="flex space-x-4">
|
| 142 |
+
<a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="twitter"></i></a>
|
| 143 |
+
<a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="facebook"></i></a>
|
| 144 |
+
<a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="linkedin"></i></a>
|
| 145 |
+
<a href="index.html" class="text-gray-400 hover:text-white"><i data-feather="github"></i></a>
|
| 146 |
+
</div>
|
| 147 |
+
</div>
|
| 148 |
+
</div>
|
| 149 |
+
<div class="mt-8 pt-8 border-t border-gray-700 text-center text-gray-400">
|
| 150 |
+
<p>© 2023 LearnFlow. All rights reserved.</p>
|
| 151 |
+
</div>
|
| 152 |
+
</div>
|
| 153 |
+
</footer>
|
| 154 |
+
</div>
|
| 155 |
+
|
| 156 |
+
<script>
|
| 157 |
+
function courseSelection() {
|
| 158 |
+
return {
|
| 159 |
+
selectedCourse: '',
|
| 160 |
+
selectedModules: [],
|
| 161 |
+
modules: [],
|
| 162 |
+
allModules: {
|
| 163 |
+
webdev: [
|
| 164 |
+
{ id: 'webdev-1', title: 'Introduction to Laravel', description: 'Learn the fundamentals of Laravel framework', price: 49 },
|
| 165 |
+
{ id: 'webdev-2', title: 'Laravel Fundamentals', description: 'Master routing, controllers and views', price: 79 },
|
| 166 |
+
{ id: 'webdev-3', title: 'Working with Databases', description: 'Eloquent ORM and database migrations', price: 89 },
|
| 167 |
+
{ id: 'webdev-4', title: 'Authentication & Authorization', description: 'Implement secure user systems', price: 69 }
|
| 168 |
+
],
|
| 169 |
+
mobile: [
|
| 170 |
+
{ id: 'mobile-1', title: 'Flutter Basics', description: 'Introduction to Flutter framework', price: 59 },
|
| 171 |
+
{ id: 'mobile-2', title: 'UI Development', description: 'Building beautiful mobile interfaces', price: 79 },
|
| 172 |
+
{ id: 'mobile-3', title: 'State Management', description: 'Managing app state effectively', price: 89 }
|
| 173 |
+
],
|
| 174 |
+
datascience: [
|
| 175 |
+
{ id: 'ds-1', title: 'Python for Data Science', description: 'Essential Python skills', price: 49 },
|
| 176 |
+
{ id: 'ds-2', title: 'Pandas & NumPy', description: 'Data manipulation and analysis', price: 79 },
|
| 177 |
+
{ id: 'ds-3', title: 'Machine Learning Basics', description: 'Introduction to ML concepts', price: 99 },
|
| 178 |
+
{ id: 'ds-4', title: 'Data Visualization', description: 'Creating insightful visualizations', price: 69 }
|
| 179 |
+
]
|
| 180 |
+
},
|
| 181 |
+
init() {
|
| 182 |
+
feather.replace();
|
| 183 |
+
},
|
| 184 |
+
updateModules() {
|
| 185 |
+
this.selectedModules = [];
|
| 186 |
+
this.modules = this.allModules[this.selectedCourse] || [];
|
| 187 |
+
},
|
| 188 |
+
get totalPrice() {
|
| 189 |
+
return this.selectedModules.reduce((total, moduleId) => {
|
| 190 |
+
const module = this.modules.find(m => m.id === moduleId);
|
| 191 |
+
return total + (module ? module.price : 0);
|
| 192 |
+
}, 0);
|
| 193 |
+
},
|
| 194 |
+
saveSelection() {
|
| 195 |
+
// In a real app, this would send data to a server
|
| 196 |
+
alert(`Success! ${this.selectedModules.length} modules saved with total price $${this.totalPrice}`);
|
| 197 |
+
// Reset form
|
| 198 |
+
this.selectedCourse = '';
|
| 199 |
+
this.selectedModules = [];
|
| 200 |
+
this.modules = [];
|
| 201 |
+
}
|
| 202 |
+
}
|
| 203 |
+
}
|
| 204 |
+
</script>
|
| 205 |
+
<script>feather.replace();</script>
|
| 206 |
+
</body>
|
| 207 |
+
</html>
|
create-lesson.html
CHANGED
|
@@ -22,9 +22,9 @@
|
|
| 22 |
</div>
|
| 23 |
<nav class="hidden md:flex space-x-6">
|
| 24 |
<a href="index.html" class="hover:text-indigo-200">Dashboard</a>
|
| 25 |
-
<a href="
|
| 26 |
<a href="index.html" class="hover:text-indigo-200">Progress</a>
|
| 27 |
-
|
| 28 |
<img src="http://static.photos/people/40x40/42" alt="User" class="w-8 h-8 rounded-full">
|
| 29 |
<span>John Doe</span>
|
| 30 |
</div>
|
|
|
|
| 22 |
</div>
|
| 23 |
<nav class="hidden md:flex space-x-6">
|
| 24 |
<a href="index.html" class="hover:text-indigo-200">Dashboard</a>
|
| 25 |
+
<a href="course-selection.html" class="hover:text-indigo-200">Courses</a>
|
| 26 |
<a href="index.html" class="hover:text-indigo-200">Progress</a>
|
| 27 |
+
<div class="flex items-center space-x-2">
|
| 28 |
<img src="http://static.photos/people/40x40/42" alt="User" class="w-8 h-8 rounded-full">
|
| 29 |
<span>John Doe</span>
|
| 30 |
</div>
|
index.html
CHANGED
|
@@ -34,10 +34,10 @@
|
|
| 34 |
<h1 class="text-2xl font-bold">LearnFlow</h1>
|
| 35 |
</div>
|
| 36 |
<nav class="hidden md:flex space-x-6">
|
| 37 |
-
<a href="
|
| 38 |
-
<a href="
|
| 39 |
-
<a href="
|
| 40 |
-
|
| 41 |
<img src="http://static.photos/people/40x40/42" alt="User" class="w-8 h-8 rounded-full">
|
| 42 |
<span>John Doe</span>
|
| 43 |
</div>
|
|
@@ -52,10 +52,10 @@
|
|
| 52 |
<!-- Mobile Menu -->
|
| 53 |
<div class="md:hidden bg-indigo-800 text-white" x-show="mobileMenuOpen" x-transition>
|
| 54 |
<div class="container mx-auto px-4 py-3 space-y-3">
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
<img src="http://static.photos/people/40x40/42" alt="User" class="w-8 h-8 rounded-full">
|
| 60 |
<span>John Doe</span>
|
| 61 |
</div>
|
|
|
|
| 34 |
<h1 class="text-2xl font-bold">LearnFlow</h1>
|
| 35 |
</div>
|
| 36 |
<nav class="hidden md:flex space-x-6">
|
| 37 |
+
<a href="index.html" class="hover:text-indigo-200">Dashboard</a>
|
| 38 |
+
<a href="course-selection.html" class="hover:text-indigo-200">Courses</a>
|
| 39 |
+
<a href="index.html" class="hover:text-indigo-200">Progress</a>
|
| 40 |
+
<div class="flex items-center space-x-2">
|
| 41 |
<img src="http://static.photos/people/40x40/42" alt="User" class="w-8 h-8 rounded-full">
|
| 42 |
<span>John Doe</span>
|
| 43 |
</div>
|
|
|
|
| 52 |
<!-- Mobile Menu -->
|
| 53 |
<div class="md:hidden bg-indigo-800 text-white" x-show="mobileMenuOpen" x-transition>
|
| 54 |
<div class="container mx-auto px-4 py-3 space-y-3">
|
| 55 |
+
<a href="index.html" class="block py-2 hover:text-indigo-200">Dashboard</a>
|
| 56 |
+
<a href="course-selection.html" class="block py-2 hover:text-indigo-200">Courses</a>
|
| 57 |
+
<a href="index.html" class="block py-2 hover:text-indigo-200">Progress</a>
|
| 58 |
+
<div class="flex items-center space-x-2 py-2">
|
| 59 |
<img src="http://static.photos/people/40x40/42" alt="User" class="w-8 h-8 rounded-full">
|
| 60 |
<span>John Doe</span>
|
| 61 |
</div>
|