mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-08-26 02:27:11 +00:00
feat(website): technical SEO and UI/UX accessibility improvements
- Add LCP image preload for hero mascot - Add HowTo structured data schema (3-step install guide) - Update SoftwareApplication schema with screenshot + image fields - Add glassmorphic :focus-visible outlines for keyboard accessibility - Add content-visibility: auto to heavy offscreen sections for INP - Expand lang-init.js auto-redirect to all 6 supported languages - Remove impressum/datenschutz from sitemap.xml (noindex conflict)
This commit is contained in:
+31
-23
@@ -1,22 +1,30 @@
|
||||
(function() {
|
||||
var html = document.documentElement;
|
||||
var path = window.location.pathname;
|
||||
|
||||
|
||||
// Mapping of browser language codes to KoalaSync locale directories
|
||||
var langMap = {
|
||||
'de': 'de',
|
||||
'fr': 'fr',
|
||||
'es': 'es',
|
||||
'pt': 'pt-BR',
|
||||
'ru': 'ru'
|
||||
};
|
||||
|
||||
// Check if we are on the root index page (either "/" or "/index.html" at the root)
|
||||
var isRootIndex = path === '/' || path === '/index.html' || path === '';
|
||||
|
||||
|
||||
if (isRootIndex) {
|
||||
var savedLang = localStorage.getItem('koala_lang');
|
||||
var browserLang = navigator.language.startsWith('de') ? 'de' : 'en';
|
||||
var preferredLang = savedLang || browserLang;
|
||||
|
||||
if (preferredLang === 'de') {
|
||||
// Redirect to German version
|
||||
window.location.replace('de/');
|
||||
var browserLang = navigator.language.split('-')[0];
|
||||
var preferredLang = savedLang || langMap[browserLang] || 'en';
|
||||
|
||||
if (preferredLang !== 'en') {
|
||||
window.location.replace(preferredLang + '/');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var htmlClasses = html.className.split(' ');
|
||||
var activeLang = null;
|
||||
var hasStaticLang = false;
|
||||
@@ -28,38 +36,38 @@
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (hasStaticLang) {
|
||||
localStorage.setItem('koala_lang', activeLang);
|
||||
} else {
|
||||
var savedLang = localStorage.getItem('koala_lang');
|
||||
var browserLang = navigator.language.startsWith('de') ? 'de' : 'en';
|
||||
activeLang = savedLang || browserLang;
|
||||
|
||||
var browserLang = navigator.language.split('-')[0];
|
||||
activeLang = savedLang || langMap[browserLang] || 'en';
|
||||
|
||||
// Dynamic utility pages currently only support English and German markup.
|
||||
// Fallback to English for any other language preference (e.g. fr, es) to avoid bilingual text duplication.
|
||||
// Fallback to English for any other language to avoid bilingual text duplication.
|
||||
if (activeLang !== 'de') {
|
||||
activeLang = 'en';
|
||||
}
|
||||
|
||||
|
||||
html.classList.add('lang-' + activeLang);
|
||||
html.lang = activeLang;
|
||||
}
|
||||
|
||||
|
||||
// Update titles dynamically based on page
|
||||
var isIndex = path === '/' || path.endsWith('index.html') || path.split('/').pop() === '';
|
||||
var isJoin = path.includes('join');
|
||||
|
||||
|
||||
if (isIndex) {
|
||||
var titles = {
|
||||
en: 'KoalaSync | Real-time Video Synchronization for Friends',
|
||||
de: 'KoalaSync | Echtzeit-Video-Synchronisation für Freunde'
|
||||
var titles = {
|
||||
en: 'KoalaSync | Real-time Video Synchronization for Friends',
|
||||
de: 'KoalaSync | Echtzeit-Video-Synchronisation für Freunde'
|
||||
};
|
||||
document.title = titles[activeLang] || titles.en;
|
||||
} else if (isJoin) {
|
||||
var titles = {
|
||||
en: 'Join Room | KoalaSync',
|
||||
de: 'Raum beitreten | KoalaSync'
|
||||
var titles = {
|
||||
en: 'Join Room | KoalaSync',
|
||||
de: 'Raum beitreten | KoalaSync'
|
||||
};
|
||||
document.title = titles[activeLang] || titles.en;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user