Mudanças entre as edições de "Widget:Droflax"
Ir para navegação
Ir para pesquisar
(Página substituída por '<!DOCTYPE html> <html lang="pt-BR"> <head> <meta charset="UTF-8"> <title>Botões de Idioma - Wiki GLA</title> <style> body { font-family: Arial, sans-se...') Etiqueta: Substituído |
|||
| Linha 1: | Linha 1: | ||
<!DOCTYPE html> | <!DOCTYPE html> | ||
<html lang="pt-BR"> | <html lang="pt-BR"> | ||
<head> | <head> | ||
<meta charset="UTF-8"> | <meta charset="UTF-8"> | ||
<title> | <title>Botões de Idioma - Wiki GLA</title> | ||
<style> | <style> | ||
body { | body { | ||
font-family: Arial, sans-serif; | |||
font-family: sans-serif; | padding: 40px; | ||
background-color: #f9f9f9; | |||
} | } | ||
. | .language-buttons { | ||
position: fixed; | |||
top: 20px; | |||
right: 20px; | |||
display: flex; | display: flex; | ||
gap: 10px; | gap: 10px; | ||
background-color: #ffffffcc; | |||
padding: 6px 10px; | |||
background- | |||
padding | |||
border-radius: 8px; | border-radius: 8px; | ||
box-shadow: 0 0 6px rgba(0, 0, 0, 0.2); | |||
z-index: 999; | |||
} | } | ||
. | .language-buttons a img { | ||
width: 40px; | |||
width: | |||
height: 28px; | height: 28px; | ||
border-radius: 6px; | |||
border: 1px solid #ccc; | |||
transition: transform 0.2s ease; | |||
transition: | object-fit: cover; | ||
} | } | ||
. | .language-buttons a img:hover { | ||
transform: scale(1.1); | |||
cursor: pointer; | |||
border-color: #888; | |||
transform: scale(1. | |||
} | } | ||
</style> | </style> | ||
</head> | </head> | ||
<body> | <body> | ||
<div class="language-buttons"> | |||
<a href="#" onclick="goToLang('pt')" title="Português"> | |||
<img src="https://upload.wikimedia.org/wikipedia/en/0/05/Flag_of_Brazil.svg" alt="Português"> | |||
</a> | |||
<a href="#" onclick="goToLang('en')" title="English"> | |||
<img src="https://upload.wikimedia.org/wikipedia/en/a/a4/Flag_of_the_United_States.svg" alt="English"> | |||
</a> | |||
<a href="#" onclick="goToLang('es')" title="Español"> | |||
<img src="https://upload.wikimedia.org/wikipedia/en/9/9a/Flag_of_Spain.svg" alt="Español"> | |||
</a> | |||
<a href="#" onclick="goToLang('pl')" title="Polski"> | |||
<img src="https://upload.wikimedia.org/wikipedia/en/1/12/Flag_of_Poland.svg" alt="Polski"> | |||
</a> | |||
< | |||
< | |||
</ | |||
< | |||
< | |||
</ | |||
< | |||
< | |||
</ | |||
< | |||
< | |||
</ | |||
</div> | </div> | ||
<script> | <script> | ||
const | const pageMap = { | ||
'Chefões': { | |||
en: 'Bosses', | |||
es: 'Jefes', | |||
pl: 'Bossowie', | |||
pt: 'Chefões' | |||
}, | |||
'Bosses': { | |||
pt: 'Chefões', | |||
es: 'Jefes', | |||
pl: 'Bossowie', | |||
en: 'Bosses' | |||
} | }, | ||
'Jefes': { | |||
pt: 'Chefões', | |||
en: 'Bosses', | |||
pl: 'Bossowie', | |||
es: 'Jefes' | |||
}, | |||
'Bossowie': { | |||
pt: 'Chefões', | |||
en: 'Bosses', | |||
es: 'Jefes', | |||
pl: 'Bossowie' | |||
}, | |||
'Página_em_Português': { | |||
en: 'Page_in_English', | |||
} | es: 'Pagina_en_Espanol', | ||
pl: 'Strona_po_Polsku', | |||
pt: 'Página_em_Português' | |||
} | } | ||
}; | }; | ||
function goToLang(lang) { | |||
const path = window.location.pathname; | |||
const currentPage = decodeURIComponent(path.split('/').pop()); | |||
const mapping = pageMap[currentPage]; | |||
if (mapping && mapping[lang]) { | |||
const newPage = mapping[lang]; | |||
const newPath = path.replace(currentPage, encodeURIComponent(newPage)); | |||
window.location.pathname = newPath; | |||
} else { | } else { | ||
alert('Tradução não disponível para esta página.'); | |||
} | } | ||
} | } | ||
</script> | </script> | ||
</body> | </body> | ||
</html> | </html> | ||
Edição das 23h24min de 27 de junho de 2025
<!DOCTYPE html> <html lang="pt-BR"> <head>
<meta charset="UTF-8">
<title>Botões de Idioma - Wiki GLA</title>
<style>
body {
font-family: Arial, sans-serif;
padding: 40px;
background-color: #f9f9f9;
}
.language-buttons {
position: fixed;
top: 20px;
right: 20px;
display: flex;
gap: 10px;
background-color: #ffffffcc;
padding: 6px 10px;
border-radius: 8px;
box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
z-index: 999;
}
.language-buttons a img {
width: 40px;
height: 28px;
border-radius: 6px;
border: 1px solid #ccc;
transition: transform 0.2s ease;
object-fit: cover;
}
.language-buttons a img:hover {
transform: scale(1.1);
cursor: pointer;
border-color: #888;
}
</style>
</head> <body>
<script>
const pageMap = {
'Chefões': {
en: 'Bosses',
es: 'Jefes',
pl: 'Bossowie',
pt: 'Chefões'
},
'Bosses': {
pt: 'Chefões',
es: 'Jefes',
pl: 'Bossowie',
en: 'Bosses'
},
'Jefes': {
pt: 'Chefões',
en: 'Bosses',
pl: 'Bossowie',
es: 'Jefes'
},
'Bossowie': {
pt: 'Chefões',
en: 'Bosses',
es: 'Jefes',
pl: 'Bossowie'
},
'Página_em_Português': {
en: 'Page_in_English',
es: 'Pagina_en_Espanol',
pl: 'Strona_po_Polsku',
pt: 'Página_em_Português'
}
};
function goToLang(lang) {
const path = window.location.pathname;
const currentPage = decodeURIComponent(path.split('/').pop());
const mapping = pageMap[currentPage];
if (mapping && mapping[lang]) {
const newPage = mapping[lang];
const newPath = path.replace(currentPage, encodeURIComponent(newPage));
window.location.pathname = newPath;
} else {
alert('Tradução não disponível para esta página.');
}
}
</script>
</body> </html>