From 5b89dfea16b93fca7427f2409b5164652d4a650f Mon Sep 17 00:00:00 2001 From: JotaChina Date: Sun, 30 Nov 2025 18:56:03 -0300 Subject: [PATCH] Upgrade interface do MMPSearch --- _includes/sidebar.html | 2 +- pages/automation.md | 55 +++++++++++++------------------------ pages/bassline.md | 61 +++++++++++++++--------------------------- pages/sample.md | 24 ++++++++--------- 4 files changed, 54 insertions(+), 88 deletions(-) diff --git a/_includes/sidebar.html b/_includes/sidebar.html index 1555400e..ab4031cb 100644 --- a/_includes/sidebar.html +++ b/_includes/sidebar.html @@ -19,7 +19,7 @@ >
  • - Crie seu projeto diff --git a/pages/automation.md b/pages/automation.md index eba50fc2..56c0481a 100644 --- a/pages/automation.md +++ b/pages/automation.md @@ -8,6 +8,7 @@ permalink: /automation/
    + {% include sidebar.html %}

    @@ -22,8 +23,8 @@ permalink: /automation/
    - - Todos as pistas de Automação Disponíveis + + Todas as Automações Disponíveis
    @@ -32,23 +33,16 @@ permalink: /automation/
    {% assign all_automation_string = "" %} - {% for p in site.data.all %} - {% for track in p.tracks %} - {% if track.automation %} - {% for inst in track.automation %} - {% if inst.instrument_name and inst.instrument_name != "" %} - {% unless all_automation_string contains inst.instrument_name %} - {% assign all_automation_string = all_automation_string | append: inst.instrument_name | append: "|||" %} - {% endunless %} - {% endif %} - {% endfor %} - {% elsif track.instrument_name and track.instrument_name != "" %} - {% unless all_automation_string contains track.instrument_name %} - {% assign all_automation_string = all_automation_string | append: track.instrument_name | append: "|||" %} - {% endunless %} - {% endif %} - {% endfor %} + {% if p.tags.automation %} + {% for item in p.tags.automation %} + {% if item != "" %} + {% unless all_automation_string contains item %} + {% assign all_automation_string = all_automation_string | append: item | append: "|||" %} + {% endunless %} + {% endif %} + {% endfor %} + {% endif %} {% endfor %} {% assign unique_automation = all_automation_string | split: "|||" | sort %} @@ -86,20 +80,10 @@ permalink: /automation/
    {% for projeto in site.data.all %} - - {% assign project_insts = "" %} - {% for track in projeto.tracks %} - {% if track.automation %} - {% for inst in track.automation %} - {% assign project_insts = project_insts | append: inst.instrument_name | append: "," %} - {% endfor %} - {% elsif track.instrument_name %} - {% assign project_insts = project_insts | append: track.instrument_name | append: "," %} - {% endif %} - {% endfor %} + {% if projeto.tags.TAG contains "automation" %}
    + data-automation="{{ projeto.tags.automation | join: ',' }}">
    @@ -129,10 +113,9 @@ permalink: /automation/
    - {% assign unique_proj_insts = project_insts | split: "," | uniq %} - {% if unique_proj_insts.size > 0 %} + {% if projeto.tags.automation and projeto.tags.automation.size > 0 %}
    - {% for item in unique_proj_insts %} + {% for item in projeto.tags.automation %} {% if item != "" %} @@ -154,6 +137,7 @@ permalink: /automation/
    + {% endif %} {% endfor %}
    @@ -216,14 +200,13 @@ permalink: /automation/ }); projects.forEach(project => { + // CORREÇÃO: Ler data-automation em vez de data-plugins const projectInstStr = project.getAttribute('data-automation'); - // Cria array de automações deste projeto const projectInsts = projectInstStr.split(',').map(s => s.trim()); if (activeFilters.length === 0) { project.style.display = 'block'; } else { - // Lógica OR: Se tiver pelo menos uma das automações filtradas, exibe const hasMatch = activeFilters.some(filter => projectInsts.includes(filter)); project.style.display = hasMatch ? 'block' : 'none'; } @@ -257,7 +240,7 @@ permalink: /automation/ document.querySelectorAll('.filter-item').forEach(tag => { tag.addEventListener('click', function(e) { e.preventDefault(); - e.stopPropagation(); // Evita clique no card se for dentro dele + e.stopPropagation(); const val = this.getAttribute('data-value'); toggleFilter(val); }); diff --git a/pages/bassline.md b/pages/bassline.md index ff010420..ea1b1f11 100644 --- a/pages/bassline.md +++ b/pages/bassline.md @@ -8,6 +8,7 @@ permalink: /bassline/
    + {% include sidebar.html %}

    @@ -22,8 +23,8 @@ permalink: /bassline/
    - - Todos as Basslines Disponíveis + + Todas as Basslines Disponíveis
    @@ -31,29 +32,22 @@ permalink: /bassline/
    - {% assign all_automation_string = "" %} - + {% assign all_bassline_string = "" %} {% for p in site.data.all %} - {% for track in p.tracks %} - {% if track.bassline %} - {% for inst in track.bassline %} - {% if inst.instrument_name and inst.instrument_name != "" %} - {% unless all_automation_string contains inst.instrument_name %} - {% assign all_automation_string = all_automation_string | append: inst.instrument_name | append: "|||" %} - {% endunless %} - {% endif %} - {% endfor %} - {% elsif track.instrument_name and track.instrument_name != "" %} - {% unless all_automation_string contains track.instrument_name %} - {% assign all_automation_string = all_automation_string | append: track.instrument_name | append: "|||" %} - {% endunless %} - {% endif %} - {% endfor %} + {% if p.tags.bassline %} + {% for item in p.tags.bassline %} + {% if item != "" %} + {% unless all_bassline_string contains item %} + {% assign all_bassline_string = all_bassline_string | append: item | append: "|||" %} + {% endunless %} + {% endif %} + {% endfor %} + {% endif %} {% endfor %} - {% assign unique_automation = all_automation_string | split: "|||" | sort %} + {% assign unique_bassline = all_bassline_string | split: "|||" | sort %} - {% for item in unique_automation %} + {% for item in unique_bassline %} {% if item != "" %} {% for projeto in site.data.all %} - - {% assign project_insts = "" %} - {% for track in projeto.tracks %} - {% if track.bassline %} - {% for inst in track.bassline %} - {% assign project_insts = project_insts | append: inst.instrument_name | append: "," %} - {% endfor %} - {% elsif track.instrument_name %} - {% assign project_insts = project_insts | append: track.instrument_name | append: "," %} - {% endif %} - {% endfor %} + {% if projeto.tags.TAG contains "bassline" %}
    + data-bassline="{{ projeto.tags.bassline | join: ',' }}">
    @@ -129,10 +113,9 @@ permalink: /bassline/
    - {% assign unique_proj_insts = project_insts | split: "," | uniq %} - {% if unique_proj_insts.size > 0 %} + {% if projeto.tags.bassline and projeto.tags.bassline.size > 0 %}
    - {% for item in unique_proj_insts %} + {% for item in projeto.tags.bassline %} {% if item != "" %} @@ -154,6 +137,7 @@ permalink: /bassline/
    + {% endif %} {% endfor %}
    @@ -216,14 +200,13 @@ permalink: /bassline/ }); projects.forEach(project => { + // CORREÇÃO: Ler data-bassline em vez de data-plugins const projectInstStr = project.getAttribute('data-bassline'); - // Cria array de automações deste projeto const projectInsts = projectInstStr.split(',').map(s => s.trim()); if (activeFilters.length === 0) { project.style.display = 'block'; } else { - // Lógica OR: Se tiver pelo menos uma das automações filtradas, exibe const hasMatch = activeFilters.some(filter => projectInsts.includes(filter)); project.style.display = hasMatch ? 'block' : 'none'; } @@ -257,7 +240,7 @@ permalink: /bassline/ document.querySelectorAll('.filter-item').forEach(tag => { tag.addEventListener('click', function(e) { e.preventDefault(); - e.stopPropagation(); // Evita clique no card se for dentro dele + e.stopPropagation(); const val = this.getAttribute('data-value'); toggleFilter(val); }); diff --git a/pages/sample.md b/pages/sample.md index 6d0ad053..1d5d0ee3 100644 --- a/pages/sample.md +++ b/pages/sample.md @@ -31,29 +31,29 @@ permalink: /sample/
    - {% assign all_automation_string = "" %} + {% assign all_sample_string = "" %} {% for p in site.data.all %} {% for track in p.tracks %} {% if track.sample %} {% for inst in track.sample %} - {% if inst.instrument_name and inst.instrument_name != "" %} - {% unless all_automation_string contains inst.instrument_name %} - {% assign all_automation_string = all_automation_string | append: inst.instrument_name | append: "|||" %} + {% if inst.sample_name and inst.sample_name != "" %} + {% unless all_sample_string contains inst.sample_name %} + {% assign all_sample_string = all_sample_string | append: inst.sample_name | append: "|||" %} {% endunless %} {% endif %} {% endfor %} - {% elsif track.instrument_name and track.instrument_name != "" %} - {% unless all_automation_string contains track.instrument_name %} - {% assign all_automation_string = all_automation_string | append: track.instrument_name | append: "|||" %} + {% elsif track.sample_name and track.sample_name != "" %} + {% unless all_sample_string contains track.sample_name %} + {% assign all_sample_string = all_sample_string | append: track.sample_name | append: "|||" %} {% endunless %} {% endif %} {% endfor %} {% endfor %} - {% assign unique_automation = all_automation_string | split: "|||" | sort %} + {% assign unique_sample = all_sample_string | split: "|||" | sort %} - {% for item in unique_automation %} + {% for item in unique_sample %} {% if item != "" %}