UI overhaul

This commit is contained in:
overcuriousity
2025-07-27 17:31:15 +02:00
parent 0d22210040
commit 0adabad94d
7 changed files with 192 additions and 104 deletions

View File

@@ -192,14 +192,14 @@ const phases = data.phases;
const methodologySection = document.getElementById('methodology-section');
if (methodologySection) {
methodologySection.classList.add('active');
methodologySection.scrollIntoView({ behavior: 'smooth', block: 'start' });
window.scrollToElementById('methodology-section');
}
} else if (approach === 'targeted') {
// Show targeted scenarios section
const targetedSection = document.getElementById('targeted-section');
if (targetedSection) {
targetedSection.classList.add('active');
targetedSection.scrollIntoView({ behavior: 'smooth', block: 'start' });
window.scrollToElementById('targeted-section');
}
}
};
@@ -213,13 +213,13 @@ const phases = data.phases;
card.classList.remove('active');
});
// Add active class to selected phase card (use actual phase ID)
// Add active class to selected phase card
const selectedCard = document.querySelector(`.phase-card.phase-${phase}`);
if (selectedCard) {
selectedCard.classList.add('active');
}
// Use existing phase filter functionality with correct phase ID
// Use existing phase filter functionality
const existingPhaseButton = document.querySelector(`[data-phase="${phase}"]`);
if (existingPhaseButton && !existingPhaseButton.classList.contains('active')) {
existingPhaseButton.click();
@@ -231,13 +231,8 @@ const phases = data.phases;
gridToggle.click();
}
// Scroll to results after a short delay
setTimeout(() => {
const toolsGrid = document.getElementById('tools-grid');
if (toolsGrid) {
toolsGrid.scrollIntoView({ behavior: 'smooth', block: 'start' });
}
}, 300);
// Scroll to results using consolidated utility
window.scrollToElementById('tools-grid');
};
document.addEventListener('DOMContentLoaded', () => {
@@ -367,7 +362,7 @@ const phases = data.phases;
if (targetCard) {
console.log('Found target card, scrolling...');
targetCard.scrollIntoView({ behavior: 'smooth', block: 'center' });
window.scrollToElement(targetCard, { block: 'center' });
targetCard.style.animation = 'highlight-flash 2s ease-out';
setTimeout(() => {
@@ -377,6 +372,8 @@ const phases = data.phases;
}, 2000);
} else {
console.warn('Tool card not found in grid:', toolName);
// Fallback to tools grid
window.scrollToElementById('tools-grid');
}
}, 300);
}, 200);
@@ -410,9 +407,11 @@ const phases = data.phases;
if (firstMatch) {
console.log(`Found ${matchCount} occurrences of tool, highlighting all and scrolling to first`);
firstMatch.scrollIntoView({ behavior: 'smooth', block: 'center' });
window.scrollToElement(firstMatch, { block: 'center' });
} else {
console.warn('Tool chip not found in matrix:', toolName);
// Fallback to matrix container
window.scrollToElementById('matrix-container');
}
}, 500);
};