This commit is contained in:
karim hassan
2025-08-18 19:30:47 +00:00
parent dd17d9f4bf
commit e3620c7f42
16 changed files with 562 additions and 0 deletions

12
public/assets/js/app.js Normal file
View File

@@ -0,0 +1,12 @@
async function api(path, opts={}){
const res = await fetch(path, { headers:{ 'content-type':'application/json' }, ...opts });
if (!res.ok) throw new Error(await res.text());
const ct = res.headers.get('content-type')||'';
return ct.includes('application/json')? res.json() : res.text();
}
document.addEventListener('DOMContentLoaded', async ()=>{
try {
const cfg = await api('/api/config');
const el = document.querySelector('.title'); if (el) el.textContent = cfg.siteName || 'Padel24Play';
} catch {}
});