LauraMDB commited on
Commit
64029b7
·
verified ·
1 Parent(s): 13fae48

before the section id="LP" add 4 filters with drop-downs:

Browse files

Language , region, timezone, course

include the default values as follows
Language can be English, French, Italian, Spanish, Mandarin
Time Zone can be US, UK, MX, FR, SG
region can be AMER, EMEA, LATAM
course: MDB100, MDB200, MDB300, DEV400, DEV500, DS120, DS110, DA610

Files changed (3) hide show
  1. index.html +53 -1
  2. script.js +19 -1
  3. style.css +16 -1
index.html CHANGED
@@ -43,9 +43,61 @@
43
  </a>
44
  </div>
45
  </section>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  <!-- Course Paths Section -->
47
  <section id="LP" class="mb-20">
48
- <h2 class="text-3xl font-bold text-gray-800 mb-8 text-center">Choose Your Learning Path</h2>
49
 
50
  <div class="mb-12">
51
  <h3 class="text-xl font-semibold text-gray-800 mb-4">Foundational Courses</h3>
 
43
  </a>
44
  </div>
45
  </section>
46
+ <!-- Filters Section -->
47
+ <section class="mb-8 bg-white p-6 rounded-lg shadow">
48
+ <h2 class="text-xl font-semibold text-gray-800 mb-4">Filter Courses</h2>
49
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
50
+ <div>
51
+ <label class="block text-sm font-medium text-gray-700 mb-1">Language</label>
52
+ <select class="filter-select w-full rounded-md border-gray-300 shadow-sm focus:border-green-500 focus:ring-green-500">
53
+ <option value="">All Languages</option>
54
+ <option value="English">English</option>
55
+ <option value="French">French</option>
56
+ <option value="Italian">Italian</option>
57
+ <option value="Spanish">Spanish</option>
58
+ <option value="Mandarin">Mandarin</option>
59
+ </select>
60
+ </div>
61
+ <div>
62
+ <label class="block text-sm font-medium text-gray-700 mb-1">Region</label>
63
+ <select class="filter-select w-full rounded-md border-gray-300 shadow-sm focus:border-green-500 focus:ring-green-500">
64
+ <option value="">All Regions</option>
65
+ <option value="AMER">AMER</option>
66
+ <option value="EMEA">EMEA</option>
67
+ <option value="LATAM">LATAM</option>
68
+ </select>
69
+ </div>
70
+ <div>
71
+ <label class="block text-sm font-medium text-gray-700 mb-1">Time Zone</label>
72
+ <select class="filter-select w-full rounded-md border-gray-300 shadow-sm focus:border-green-500 focus:ring-green-500">
73
+ <option value="">All Time Zones</option>
74
+ <option value="US">US</option>
75
+ <option value="UK">UK</option>
76
+ <option value="MX">MX</option>
77
+ <option value="FR">FR</option>
78
+ <option value="SG">SG</option>
79
+ </select>
80
+ </div>
81
+ <div>
82
+ <label class="block text-sm font-medium text-gray-700 mb-1">Course</label>
83
+ <select class="filter-select w-full rounded-md border-gray-300 shadow-sm focus:border-green-500 focus:ring-green-500">
84
+ <option value="">All Courses</option>
85
+ <option value="MDB100">MDB100</option>
86
+ <option value="MDB200">MDB200</option>
87
+ <option value="MDB300">MDB300</option>
88
+ <option value="DEV400">DEV400</option>
89
+ <option value="DEV500">DEV500</option>
90
+ <option value="DS120">DS120</option>
91
+ <option value="DS110">DS110</option>
92
+ <option value="DA610">DA610</option>
93
+ </select>
94
+ </div>
95
+ </div>
96
+ </section>
97
+
98
  <!-- Course Paths Section -->
99
  <section id="LP" class="mb-20">
100
+ <h2 class="text-3xl font-bold text-gray-800 mb-8 text-center">Choose Your Learning Path</h2>
101
 
102
  <div class="mb-12">
103
  <h3 class="text-xl font-semibold text-gray-800 mb-4">Foundational Courses</h3>
script.js CHANGED
@@ -521,9 +521,27 @@ function renderUpcomingDates() {
521
  upcomingDatesList.appendChild(dateItem);
522
  });
523
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
524
  // Initialize the page
525
  function init() {
526
- const groupedCourses = groupCoursesByMonth(coursesData);
 
 
 
 
 
527
 
528
  renderCourses(groupedCourses.current, 'current-month-courses');
529
  renderCourses(groupedCourses.next, 'next-month-courses');
 
521
  upcomingDatesList.appendChild(dateItem);
522
  });
523
  }
524
+ // Filter courses based on selected filters
525
+ function filterCourses() {
526
+ const language = document.querySelector('select:nth-of-type(1)').value;
527
+ const region = document.querySelector('select:nth-of-type(2)').value;
528
+ const timezone = document.querySelector('select:nth-of-type(3)').value;
529
+ const course = document.querySelector('select:nth-of-type(4)').value;
530
+
531
+ // Filter logic would go here
532
+ console.log('Filtering by:', {language, region, timezone, course});
533
+ // In a real implementation, you would filter the coursesData array
534
+ // and update the displayed courses
535
+ }
536
+
537
  // Initialize the page
538
  function init() {
539
+ // Add event listeners to filter selects
540
+ document.querySelectorAll('.filter-select').forEach(select => {
541
+ select.addEventListener('change', filterCourses);
542
+ });
543
+
544
+ const groupedCourses = groupCoursesByMonth(coursesData);
545
 
546
  renderCourses(groupedCourses.current, 'current-month-courses');
547
  renderCourses(groupedCourses.next, 'next-month-courses');
style.css CHANGED
@@ -1,6 +1,21 @@
 
1
  /* Custom styles */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  body {
3
- font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
4
  }
5
  /* Course paths styling */
6
  .course-path-card {
 
1
+
2
  /* Custom styles */
3
+ .filter-select {
4
+ border: 1px solid #d1d5db;
5
+ padding: 0.5rem 0.75rem;
6
+ font-size: 0.875rem;
7
+ line-height: 1.25rem;
8
+ transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
9
+ }
10
+
11
+ .filter-select:focus {
12
+ outline: none;
13
+ border-color: #13aa52;
14
+ box-shadow: 0 0 0 3px rgba(19, 170, 82, 0.1);
15
+ }
16
+
17
  body {
18
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
19
  }
20
  /* Course paths styling */
21
  .course-path-card {