Von:
-
+
📁
👍 Likes
diff --git a/index.php b/index.php
index 0c2be41..6064334 100644
--- a/index.php
+++ b/index.php
@@ -56,6 +56,7 @@ if ($pfad === "deleteAccount") {
+
EduForge
diff --git a/js/filter.js b/js/filter.js
new file mode 100644
index 0000000..ba972a0
--- /dev/null
+++ b/js/filter.js
@@ -0,0 +1,29 @@
+
+function initFilter() {
+ const filterSelect = document.getElementById('category-filter');
+ const listContainer = document.querySelector('.s-res-list');
+
+ if (!filterSelect || !listContainer) return;
+
+ filterSelect.addEventListener('change', function() {
+ const selectedCategory = this.value;
+ const cards = listContainer.querySelectorAll('.s-res-item');
+
+ cards.forEach(card => {
+ const cardCategory = card.getAttribute('data-category') || '';
+
+ if (selectedCategory === 'all' || cardCategory === selectedCategory) {
+ card.style.display = 'flex';
+ } else {
+ card.style.display = 'none';
+ }
+ });
+ });
+}
+
+// ist das DOM bereits vollständig aufgebaut?
+if (document.readyState === 'loading') {
+ document.addEventListener('DOMContentLoaded', initFilter);
+} else {
+ initSorter();
+}
\ No newline at end of file