forked from SAMBUDAR/Styleka
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
31 lines (27 loc) · 900 Bytes
/
script.js
File metadata and controls
31 lines (27 loc) · 900 Bytes
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
import { app } from "./firebase-Config";
console.log("Firebase Initialized:", app);
const bar = document.getElementById('bar');
const close = document.getElementById('close');
const nav = document.getElementById('navbar');
if(bar){
bar.addEventListener('click' , () => {
nav.classList.add('active');
})
}
if(close){
close.addEventListener('click' , () => {
nav.classList.remove('active');
})
}
function filterProducts() {
const input = document.getElementById("searchBar").value.toLowerCase();
const products = document.querySelectorAll(".pro");
products.forEach(product => {
const name = product.getAttribute("data-name");
if (name.toLowerCase().includes(input)) {
product.style.display = "block";
} else {
product.style.display = "none";
}
});
}