Compare commits

...

2 Commits

Author SHA1 Message Date
Nonimart
cd9959dfc6 STYLE Updating text-decoration when hovered (lighter)
All checks were successful
continuous-integration/drone/push Build is passing
2025-06-24 13:01:49 +02:00
Nonimart
6d12445569 REFACTOR Fixing duplicate handleSmoothScrollToTitle function 2025-06-24 12:55:43 +02:00
4 changed files with 6 additions and 21 deletions

View File

@ -4,6 +4,7 @@
&:hover {
@apply underline underline-offset-8;
text-decoration-thickness: 1px;
@apply decoration-neutral-400;
&:after {
transform: translate(0px, -2px) scale(1.1);

View File

@ -34,7 +34,7 @@
.sommaire-index a:hover,
.footnotes-index a:hover {
@apply text-carhop-green-800 underline-offset-8 underline;
@apply text-carhop-green-800 underline-offset-8 underline decoration-neutral-400;
text-decoration-thickness: 1px;
}
}

View File

@ -69,12 +69,6 @@ function observeSommaireLinks(): void {
}
}
function handleSmoothScrollToTitle(targetId: string): void {
const targetElement = document.querySelector(`#${targetId}`);
if (!targetElement) return;
targetElement.scrollIntoView({ behavior: 'smooth' });
}
function toggleActiveChapterLinkInIndexPanel(targetId: string): void {
const sommaireLinks: NodeListOf<Element> = document.querySelectorAll('.sommaire-index li a');

View File

@ -1,16 +1,6 @@
export function handleSmoothScrollToTitle(): void {
const sommaireTitles: NodeListOf<Element> = document.querySelectorAll('.sommaire-index li a');
for (const title of sommaireTitles) {
title.addEventListener('click', (e) => {
e.preventDefault();
export function handleSmoothScrollToTitle(targetId: string): void {
const targetElement = document.querySelector(`#${targetId}`);
if (!targetElement) return;
const target = title.getAttribute('href');
if (!target) return;
const targetElement = document.querySelector(target);
if (!targetElement) return;
targetElement.scrollIntoView({ behavior: 'smooth' });
});
}
targetElement.scrollIntoView({ behavior: 'smooth' });
}