Synchronise les contenus glossaire et ajoute les scripts de conversion DOCX/MDX
This commit is contained in:
@@ -68,7 +68,6 @@ const { initialLevel = 1 } = Astro.props;
|
||||
} catch {}
|
||||
}
|
||||
|
||||
// init : storage > initialLevel
|
||||
let start = clampLevel(initialLevel);
|
||||
try {
|
||||
const stored = localStorage.getItem(KEY);
|
||||
@@ -77,13 +76,11 @@ const { initialLevel = 1 } = Astro.props;
|
||||
|
||||
applyLevel(start, { persist: false });
|
||||
|
||||
// clicks
|
||||
wrap.addEventListener("click", (ev) => {
|
||||
const btn = ev.target?.closest?.("button[data-level]");
|
||||
if (!btn) return;
|
||||
ev.preventDefault();
|
||||
|
||||
// ✅ crucial : on capture la position AVANT le reflow lié au changement de niveau
|
||||
captureBeforeLevelSwitch();
|
||||
applyLevel(btn.dataset.level);
|
||||
});
|
||||
@@ -95,6 +92,8 @@ const { initialLevel = 1 } = Astro.props;
|
||||
display: inline-flex;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.level-btn{
|
||||
@@ -106,6 +105,7 @@ const { initialLevel = 1 } = Astro.props;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
transition: filter .12s ease, transform .12s ease, background .12s ease, border-color .12s ease;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.level-btn:hover{
|
||||
@@ -125,4 +125,21 @@ const { initialLevel = 1 } = Astro.props;
|
||||
.level-btn:active{
|
||||
transform: translateY(1px);
|
||||
}
|
||||
</style>
|
||||
|
||||
@media (max-width: 980px){
|
||||
.level-toggle{
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.level-btn{
|
||||
padding: 5px 9px;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 760px){
|
||||
.level-toggle{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user