Compare commits
2 Commits
4e66d244ee
...
cd9959dfc6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd9959dfc6 | ||
|
|
6d12445569 |
|
|
@ -4,6 +4,7 @@
|
||||||
&:hover {
|
&:hover {
|
||||||
@apply underline underline-offset-8;
|
@apply underline underline-offset-8;
|
||||||
text-decoration-thickness: 1px;
|
text-decoration-thickness: 1px;
|
||||||
|
@apply decoration-neutral-400;
|
||||||
&:after {
|
&:after {
|
||||||
transform: translate(0px, -2px) scale(1.1);
|
transform: translate(0px, -2px) scale(1.1);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
.sommaire-index a:hover,
|
.sommaire-index a:hover,
|
||||||
.footnotes-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;
|
text-decoration-thickness: 1px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
function toggleActiveChapterLinkInIndexPanel(targetId: string): void {
|
||||||
const sommaireLinks: NodeListOf<Element> = document.querySelectorAll('.sommaire-index li a');
|
const sommaireLinks: NodeListOf<Element> = document.querySelectorAll('.sommaire-index li a');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,6 @@
|
||||||
export function handleSmoothScrollToTitle(): void {
|
export function handleSmoothScrollToTitle(targetId: string): void {
|
||||||
const sommaireTitles: NodeListOf<Element> = document.querySelectorAll('.sommaire-index li a');
|
const targetElement = document.querySelector(`#${targetId}`);
|
||||||
for (const title of sommaireTitles) {
|
|
||||||
title.addEventListener('click', (e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
const target = title.getAttribute('href');
|
|
||||||
if (!target) return;
|
|
||||||
|
|
||||||
const targetElement = document.querySelector(target);
|
|
||||||
if (!targetElement) return;
|
if (!targetElement) return;
|
||||||
|
|
||||||
targetElement.scrollIntoView({ behavior: 'smooth' });
|
targetElement.scrollIntoView({ behavior: 'smooth' });
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user