fix: add transition effect to language switch

Apply transitioning class during language toggle to prevent
content flash when switching between English and German.
This commit is contained in:
2025-12-30 20:48:40 +01:00
parent 0de964e831
commit 7be193444c

View File

@@ -118,6 +118,10 @@ function toggleExpectedResult() {
async function toggleLanguage() {
const currentLang = getLanguage();
const newLang = currentLang === "en" ? "de" : "en";
// Add transition class before any updates
elements.editorSection?.classList.add("transitioning");
setLanguage(newLang);
applyTranslations();
@@ -138,6 +142,11 @@ async function toggleLanguage() {
}
updateProgressDisplay();
// Remove transition class after all updates
requestAnimationFrame(() => {
elements.editorSection?.classList.remove("transitioning");
});
}
// ================= HINT SYSTEM =================