-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
27 lines (23 loc) · 829 Bytes
/
script.js
File metadata and controls
27 lines (23 loc) · 829 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
function animarLogo() {
const logo = document.querySelector('header img');
logo.style.animation = 'spin 2s linear infinite';
}
function pesquisar() {
const termoPesquisa = document.getElementById('termo-pesquisa').value.toLowerCase();
const catalogos = document.querySelectorAll('.catalogo');
catalogos.forEach(catalogo => {
const itens = catalogo.querySelectorAll('h3');
let encontrado = false;
itens.forEach(item => {
const textoItem = item.innerText.toLowerCase();
if (textoItem.includes(termoPesquisa)) {
encontrado = true;
}
});
if (encontrado) {
catalogo.style.display = 'block';
} else {
catalogo.style.display = 'none';
}
});
}