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) => {
|
targetedInput.addEventListener('keydown', (e) => {
|
||||||
if (e.key === 'Enter') {
|
if (e.key === 'Enter') {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
// Switch to grid view and scroll to results
|
|
||||||
const gridToggle = document.querySelector('.view-toggle[data-view="grid"]');
|
const gridToggle = document.querySelector('.view-toggle[data-view="grid"]');
|
||||||
if (gridToggle) {
|
if (gridToggle) {
|
||||||
gridToggle.click();
|
gridToggle.click();
|
||||||
// Use consolidated scroll utility
|
setTimeout(() => window.scrollToElementById('tools-grid'), 200);
|
||||||
window.scrollToElementById('tools-grid');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -92,7 +92,7 @@ const phases = data.phases;
|
|||||||
Beitragen
|
Beitragen
|
||||||
</a>
|
</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">
|
<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>
|
<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>
|
<polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline>
|
||||||
@ -407,7 +407,7 @@ const phases = data.phases;
|
|||||||
|
|
||||||
if (firstMatch) {
|
if (firstMatch) {
|
||||||
console.log(`Found ${matchCount} occurrences of tool, highlighting all and scrolling to first`);
|
console.log(`Found ${matchCount} occurrences of tool, highlighting all and scrolling to first`);
|
||||||
window.scrollToElement(firstMatch, { block: 'center' });
|
window.scrollToElement(firstMatch);
|
||||||
} else {
|
} else {
|
||||||
console.warn('Tool chip not found in matrix:', toolName);
|
console.warn('Tool chip not found in matrix:', toolName);
|
||||||
// Fallback to matrix container
|
// 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">
|
<div class="flex gap-4 justify-center flex-wrap">
|
||||||
<ContributionButton type="write" variant="primary" text="Artikel schreiben" style="padding: 0.75rem 1.5rem;" />
|
<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;">
|
<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"/>
|
<circle cx="11" cy="11" r="8"/>
|
||||||
<line x1="21" y1="21" x2="16.65" y2="16.65"/>
|
<line x1="21" y1="21" x2="16.65" y2="16.65"/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user