testando botões
This commit is contained in:
parent
b78cf024c4
commit
d042cc87f7
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.3.3">Jekyll</generator><link href="/~jotachina/mmpSearch/_site/feed.xml" rel="self" type="application/atom+xml" /><link href="/~jotachina/mmpSearch/_site/" rel="alternate" type="text/html" /><updated>2024-07-28T13:15:01-03:00</updated><id>/~jotachina/mmpSearch/_site/feed.xml</id><title type="html">Your awesome title</title><subtitle>Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description.</subtitle><entry><title type="html">Welcome to Jekyll!</title><link href="/~jotachina/mmpSearch/_site/jekyll/update/2024/07/25/welcome-to-jekyll.html" rel="alternate" type="text/html" title="Welcome to Jekyll!" /><published>2024-07-25T17:06:48-03:00</published><updated>2024-07-25T17:06:48-03:00</updated><id>/~jotachina/mmpSearch/_site/jekyll/update/2024/07/25/welcome-to-jekyll</id><content type="html" xml:base="/~jotachina/mmpSearch/_site/jekyll/update/2024/07/25/welcome-to-jekyll.html"><![CDATA[<p>You’ll find this post in your <code class="language-plaintext highlighter-rouge">_posts</code> directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run <code class="language-plaintext highlighter-rouge">jekyll serve</code>, which launches a web server and auto-regenerates your site when a file is updated.</p>
|
||||
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.3.3">Jekyll</generator><link href="/~jotachina/mmpSearch/_site/feed.xml" rel="self" type="application/atom+xml" /><link href="/~jotachina/mmpSearch/_site/" rel="alternate" type="text/html" /><updated>2024-07-28T13:55:51-03:00</updated><id>/~jotachina/mmpSearch/_site/feed.xml</id><title type="html">Your awesome title</title><subtitle>Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description.</subtitle><entry><title type="html">Welcome to Jekyll!</title><link href="/~jotachina/mmpSearch/_site/jekyll/update/2024/07/25/welcome-to-jekyll.html" rel="alternate" type="text/html" title="Welcome to Jekyll!" /><published>2024-07-25T17:06:48-03:00</published><updated>2024-07-25T17:06:48-03:00</updated><id>/~jotachina/mmpSearch/_site/jekyll/update/2024/07/25/welcome-to-jekyll</id><content type="html" xml:base="/~jotachina/mmpSearch/_site/jekyll/update/2024/07/25/welcome-to-jekyll.html"><![CDATA[<p>You’ll find this post in your <code class="language-plaintext highlighter-rouge">_posts</code> directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run <code class="language-plaintext highlighter-rouge">jekyll serve</code>, which launches a web server and auto-regenerates your site when a file is updated.</p>
|
||||
|
||||
<p>Jekyll requires blog post files to be named according to the following format:</p>
|
||||
|
||||
|
|
|
@ -1,13 +1,25 @@
|
|||
document.addEventListener("DOMContentLoaded", function() {
|
||||
var fileItemsMMP = document.querySelectorAll('#file-list-mmp .file-item');
|
||||
var fileItemsWAV = document.querySelectorAll('#file-list-wav li');
|
||||
var fileItemsWAV = document.querySelectorAll('#file-list-wav .file-wav-item');
|
||||
|
||||
// Função para exibir apenas os arquivos WAV correspondentes aos instrumentos encontrados nos projetos MMP
|
||||
function showWAVFilesByInstrument(selectedInstrument) {
|
||||
fileItemsWAV.forEach(function(item) {
|
||||
var fileName = item.getAttribute('data-file').toLowerCase();
|
||||
if (fileName.includes(selectedInstrument)) {
|
||||
item.style.display = 'block';
|
||||
} else {
|
||||
item.style.display = 'none';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Buscar por instrumento usando o campo de entrada para MMP
|
||||
var searchButton = document.getElementById('search-button');
|
||||
searchButton.addEventListener('click', function() {
|
||||
var searchInput = document.getElementById('instrument-search').value.trim().toLowerCase();
|
||||
if (searchInput === '') {
|
||||
resetSearchMMP();
|
||||
resetSearch();
|
||||
return;
|
||||
}
|
||||
fileItemsMMP.forEach(function(item) {
|
||||
|
@ -29,10 +41,14 @@ document.addEventListener("DOMContentLoaded", function() {
|
|||
document.getElementById('file-list-mmp').style.display = 'block';
|
||||
});
|
||||
|
||||
// Buscar por nome do arquivo WAV
|
||||
// Buscar por nome de arquivo WAV usando o campo de entrada
|
||||
var searchWavButton = document.getElementById('search-wav-button');
|
||||
searchWavButton.addEventListener('click', function() {
|
||||
var searchInput = document.getElementById('file-wav-search').value.trim().toLowerCase();
|
||||
if (searchInput === '') {
|
||||
resetSearch();
|
||||
return;
|
||||
}
|
||||
fileItemsWAV.forEach(function(item) {
|
||||
var fileName = item.querySelector('span').textContent.toLowerCase();
|
||||
if (fileName.includes(searchInput)) {
|
||||
|
@ -45,12 +61,48 @@ document.addEventListener("DOMContentLoaded", function() {
|
|||
document.getElementById('file-list-wav').style.display = 'block';
|
||||
});
|
||||
|
||||
// Função para resetar a busca para arquivos MMP
|
||||
function resetSearchMMP() {
|
||||
// Buscar por instrumento ou nome de arquivo WAV usando o campo de entrada combinado
|
||||
var searchBothButton = document.getElementById('search-both-button');
|
||||
searchBothButton.addEventListener('click', function() {
|
||||
var searchInput = document.getElementById('instrument-wav-search').value.trim().toLowerCase();
|
||||
if (searchInput === '') {
|
||||
resetSearch();
|
||||
return;
|
||||
}
|
||||
// Buscar em arquivos MMP por instrumento
|
||||
fileItemsMMP.forEach(function(item) {
|
||||
var instrumentsList = item.querySelectorAll('.instrument-list .instrument-name');
|
||||
var hasInstrument = false;
|
||||
instrumentsList.forEach(function(instrument) {
|
||||
var instrumentName = instrument.getAttribute('data-instrument').toLowerCase();
|
||||
if (instrumentName.includes(searchInput)) {
|
||||
hasInstrument = true;
|
||||
// Mostrar arquivo WAV correspondente ao instrumento
|
||||
showWAVFilesByInstrument(item.getAttribute('data-file'));
|
||||
}
|
||||
});
|
||||
if (hasInstrument) {
|
||||
item.style.display = 'block';
|
||||
} else {
|
||||
item.style.display = 'none';
|
||||
}
|
||||
});
|
||||
// Exibir as listas de arquivos após a busca
|
||||
document.getElementById('file-list-mmp').style.display = 'block';
|
||||
document.getElementById('file-list-wav').style.display = 'block';
|
||||
});
|
||||
|
||||
// Função para resetar a busca
|
||||
function resetSearch() {
|
||||
fileItemsMMP.forEach(function(item) {
|
||||
item.style.display = 'block';
|
||||
});
|
||||
fileItemsWAV.forEach(function(item) {
|
||||
item.style.display = 'block';
|
||||
});
|
||||
document.getElementById('file-list-mmp').style.display = 'none';
|
||||
document.getElementById('file-list-wav').style.display = 'none';
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
|
10
search.md
10
search.md
|
@ -21,13 +21,19 @@ permalink: /buscas/
|
|||
<div id="search">
|
||||
<label for="instrument-search">Buscar instrumento:</label>
|
||||
<input type="text" id="instrument-search" placeholder="Digite o nome do instrumento...">
|
||||
<button id="search-button">Buscar</button>
|
||||
<button id="search-button">Buscar Projetos</button>
|
||||
</div>
|
||||
|
||||
<div id="search-wav">
|
||||
<label for="file-wav-search">Buscar beat:</label>
|
||||
<input type="text" id="file-wav-search" placeholder="Buscar por nome do arquivo">
|
||||
<button id="search-wav-button">Buscar</button>
|
||||
<button id="search-wav-button">Buscar Beats</button>
|
||||
</div>
|
||||
|
||||
<div id="search-both">
|
||||
<label for="instrument-wav-search">Buscar em Projetos e Beats:</label>
|
||||
<input type="text" id="instrument-wav-search" placeholder="Buscar por instrumento">
|
||||
<button id="search-both-button">Buscar Projetos e Beats</button>
|
||||
</div>
|
||||
|
||||
<ul id="file-list-wav" style="display: none;">
|
||||
|
|
Loading…
Reference in New Issue