-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.js
More file actions
32 lines (28 loc) · 1.06 KB
/
scripts.js
File metadata and controls
32 lines (28 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function openModal(modalId) {
const modal = document.getElementById(modalId);
modal.style.display = "flex";
setTimeout(() => {
modal.classList.add('show');
}, 50);
}
function closeModal(modalId) {
const modal = document.getElementById(modalId);
modal.classList.remove('show');
setTimeout(() => {
modal.style.display = "none";
}, 300);
}
document.getElementById('search-button').addEventListener('click', function() {
// Holen Sie sich den Suchtext
const searchText = document.querySelector('.form-control').value.toLowerCase();
// Durchlaufen Sie alle Kacheln
const tiles = document.querySelectorAll('.category-card');
tiles.forEach(tile => {
const title = tile.querySelector('h2').textContent.toLowerCase();
if (title.includes(searchText)) {
tile.style.display = 'block'; // Zeigen Sie die Kachel an, wenn sie dem Suchtext entspricht
} else {
tile.style.display = 'none'; // Verbergen Sie die Kachel, wenn sie nicht dem Suchtext entspricht
}
});
});