-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
31 lines (25 loc) · 1.22 KB
/
Copy pathscript.js
File metadata and controls
31 lines (25 loc) · 1.22 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
26
27
28
29
30
31
function setLanguage(lang) {
const isEnglish = lang === 'en';
// Títulos
document.getElementById('titulo-es').style.display = isEnglish ? 'none' : 'block';
document.getElementById('titulo-en').style.display = isEnglish ? 'block' : 'none';
// Subtítulos
document.getElementById('sub-es').style.display = isEnglish ? 'none' : 'block';
document.getElementById('sub-en').style.display = isEnglish ? 'block' : 'none';
// Botones de directorio
document.getElementById('link-es').style.display = isEnglish ? 'none' : 'inline-block';
document.getElementById('link-en').style.display = isEnglish ? 'inline-block' : 'none';
// Botones de WhatsApp
document.getElementById('wa-es').style.display = isEnglish ? 'none' : 'inline-flex';
document.getElementById('wa-en').style.display = isEnglish ? 'inline-flex' : 'none';
}
// Registrar Service Worker
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('service-worker.js')
.then((registration) => {
console.log('🔒 Service Worker registrado con éxito:', registration.scope);
})
.catch((error) => {
console.log('❌ Error al registrar Service Worker:', error);
});
}