-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfocusMode.js
More file actions
25 lines (22 loc) · 1.06 KB
/
Copy pathfocusMode.js
File metadata and controls
25 lines (22 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
document.addEventListener("DOMContentLoaded", () => {
const focusBtn = document.getElementById("focus-mode-btn");
if (focusBtn) {
focusBtn.addEventListener("click", () => {
const isFocusMode = document.body.classList.toggle("focus-mode");
const lang = window.currentLang || 'pt';
const trans = window.translations || {
pt: { focus_mode: "Modo Foco", restore_interface: "Restaurar Interface" },
en: { focus_mode: "Focus Mode", restore_interface: "Restore Interface" }
};
if (isFocusMode) {
focusBtn.setAttribute("data-i18n", "restore_interface");
focusBtn.textContent = trans[lang].restore_interface;
focusBtn.setAttribute("aria-label", trans[lang].restore_interface);
} else {
focusBtn.setAttribute("data-i18n", "focus_mode");
focusBtn.textContent = trans[lang].focus_mode;
focusBtn.setAttribute("aria-label", trans[lang].focus_mode);
}
});
}
});