diff --git a/pages/projetos.html b/pages/projetos.html
index d8ae2618..d7c67354 100755
--- a/pages/projetos.html
+++ b/pages/projetos.html
@@ -482,9 +482,9 @@ permalink: /projetos/
.clickable-tag { font-size: 0.6rem; height: 1.5em; border: 1px solid #cfe8fc; text-decoration: none; padding: 0 6px; transition: all 0.2s ease; }
.clickable-tag:hover { background-color: #3273dc !important; color: #fff !important; border-color: #3273dc !important; transform: translateY(-1px); }
- /* TAG HIGHLIGHT */
+ /* TAG HIGHLIGHT (Amarelo) */
.clickable-tag.is-matched-tag {
- background-color: #ffdd57 !important; /* Amarelo */
+ background-color: #ffdd57 !important;
color: #363636 !important;
border-color: #ffcc00 !important;
box-shadow: 0 0 5px rgba(255, 200, 0, 0.5);
@@ -492,6 +492,15 @@ permalink: /projetos/
transform: scale(1.05);
}
+ /* PATTERN HIGHLIGHT (Amarelo para o Grid) */
+ .pattern-mini-grid.is-highlighted {
+ border-color: #ffcc00 !important;
+ background-color: #fffdf5;
+ box-shadow: 0 0 0 1px #ffcc00;
+ transform: scale(1.15);
+ z-index: 5;
+ }
+
.border-tag { border: 1px solid #dbdbdb; color: #555; }
/* Botões de Limpar Grupo */
@@ -527,6 +536,7 @@ permalink: /projetos/
background-color: #fff;
margin-right: 2px;
vertical-align: middle;
+ transition: all 0.2s ease;
}
.mini-step {
width: 3px;
@@ -772,19 +782,6 @@ document.addEventListener('DOMContentLoaded', function () {
});
}
- function updateActiveSidebar() {
- activeSidebar = { instruments: [], plugins: [], samples: [], bassline: [], automation: [], keys: [], genres: [] };
- document.querySelectorAll('.filter-checkbox').forEach(bx => {
- if(bx.checked) {
- activeSidebar[bx.dataset.category].push(bx.value);
- if(bx.parentElement.classList.contains('tag')) bx.parentElement.classList.add('is-checked');
- } else {
- if(bx.parentElement.classList.contains('tag')) bx.parentElement.classList.remove('is-checked');
- }
- });
- applyGlobalFilters();
- }
-
function applyGlobalFilters() {
let visibleCount = 0;
let minBpm = parseInt(inputMin.value);
@@ -839,19 +836,24 @@ document.addEventListener('DOMContentLoaded', function () {
const fullMeta = [pName, pBpm, pInsts, pPlugins, pTagsIA].join(' ').toLowerCase();
const matchText = searchText === "" || fullMeta.includes(searchText);
- // MATCH PATTERN: Projeto deve ter TODOS os chunks desenhados
const matchPattern = activePatternChunks.length === 0 || activePatternChunks.every(chunk => pPatterns.includes(chunk));
if (matchInst && matchPlugin && matchSample && matchBassline && matchAuto && matchBpm && matchText && matchGenres && matchKeys && matchStars && matchPattern) {
item.style.display = 'block';
visibleCount++;
- // Highlight Logic
+ // 1. Reset Highlight States
const clickableTags = item.querySelectorAll('.clickable-tag');
clickableTags.forEach(t => t.classList.remove('is-matched-tag'));
+
+ const patternGrids = item.querySelectorAll('.pattern-mini-grid');
+ patternGrids.forEach(g => g.classList.remove('is-highlighted'));
- if(hasActiveTypeFilter) {
+ // 2. Logic: Open correct details and Highlight Tags/Patterns
+ if(hasActiveTypeFilter || activePatternChunks.length > 0) {
item.querySelectorAll('details').forEach(d => d.open = false);
+
+ // Highlight Text Tags (Instruments, Plugins, etc)
clickableTags.forEach(tagEl => {
const tagVal = (tagEl.dataset.tagValue || "").trim().toLowerCase();
const isFilterMatch = allActiveTags.has(tagVal);
@@ -863,7 +865,32 @@ document.addEventListener('DOMContentLoaded', function () {
if(parentDetails) parentDetails.open = true;
}
});
+
+ // Highlight Patterns
+ if (activePatternChunks.length > 0) {
+ let hasPatternMatch = false;
+ patternGrids.forEach(grid => {
+ // title="Pattern: 1010" -> extract "1010"
+ const title = grid.getAttribute('title') || "";
+ const patVal = title.replace("Pattern: ", "").trim();
+
+ if (activePatternChunks.includes(patVal)) {
+ grid.classList.add('is-highlighted');
+ hasPatternMatch = true;
+ }
+ });
+
+ if (hasPatternMatch) {
+ // Find the Rhythm details block (closest to the grid)
+ if(patternGrids.length > 0) {
+ const parentDet = patternGrids[0].closest('details');
+ if(parentDet) parentDet.open = true;
+ }
+ }
+ }
+
} else {
+ // Default view: Open Instruments only
item.querySelectorAll('details').forEach(d => d.open = false);
const instDetail = item.querySelector('details:first-of-type');
if(instDetail) instDetail.open = true;