smooth scrolls throughout
This commit is contained in:
parent
0adabad94d
commit
c4faadf48e
@ -169,12 +169,10 @@ const displayedScenarios = scenarios.slice(0, maxDisplayed);
|
||||
targetedInput.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
// Switch to grid view and scroll to results
|
||||
const gridToggle = document.querySelector('.view-toggle[data-view="grid"]');
|
||||
if (gridToggle) {
|
||||
gridToggle.click();
|
||||
// Use consolidated scroll utility
|
||||
window.scrollToElementById('tools-grid');
|
||||
setTimeout(() => window.scrollToElementById('tools-grid'), 200);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -92,7 +92,7 @@ const phases = data.phases;
|
||||
Beitragen
|
||||
</a>
|
||||
|
||||
<a href="#filters-section" class="btn btn-secondary">
|
||||
<button onclick="window.scrollToElementById('filters-section')" class="btn btn-secondary">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||
<path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path>
|
||||
<polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline>
|
||||
@ -407,7 +407,7 @@ const phases = data.phases;
|
||||
|
||||
if (firstMatch) {
|
||||
console.log(`Found ${matchCount} occurrences of tool, highlighting all and scrolling to first`);
|
||||
window.scrollToElement(firstMatch, { block: 'center' });
|
||||
window.scrollToElement(firstMatch);
|
||||
} else {
|
||||
console.warn('Tool chip not found in matrix:', toolName);
|
||||
// Fallback to matrix container
|
||||
|
@ -54,7 +54,7 @@ knowledgebaseEntries.sort((a: any, b: any) => a.title.localeCompare(b.title));
|
||||
|
||||
<div class="flex gap-4 justify-center flex-wrap">
|
||||
<ContributionButton type="write" variant="primary" text="Artikel schreiben" style="padding: 0.75rem 1.5rem;" />
|
||||
<a href="#kb-entries" class="btn btn-secondary" style="padding: 0.75rem 1.5rem;">
|
||||
<button onclick="window.scrollToElementById('kb-entries')" class="btn btn-secondary" style="padding: 0.75rem 1.5rem;">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="margin-right: 0.5rem;">
|
||||
<circle cx="11" cy="11" r="8"/>
|
||||
<line x1="21" y1="21" x2="16.65" y2="16.65"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user