- index.html with bottom tabbar (Map/Chats/Profile/Settings) - Telegram WebApp SDK auth via /api/v1/auth/telegram - Consent gate on first login (4 checkboxes) - Map view with Leaflet (OSM) + nearby users + radius selector - Chat list + single chat with WebSocket realtime - Profile editing (drinks, activities, purposes) - Review screen with stars + anonymous toggle - User reviews list with stats - User profile (public) with rating, write/block/report - Legal pages (TERMS / PRIVACY / DISCLAIMER)
33 lines
801 B
JavaScript
33 lines
801 B
JavaScript
// Telegram WebApp SDK обёртки
|
|
const TG = window.Telegram?.WebApp;
|
|
if (TG) {
|
|
TG.ready();
|
|
TG.expand();
|
|
}
|
|
|
|
window.TG_APP = {
|
|
initData: TG?.initData || '',
|
|
initDataUnsafe: TG?.initDataUnsafe || {},
|
|
user: TG?.initDataUnsafe?.user || null,
|
|
colorScheme: TG?.colorScheme || 'light',
|
|
|
|
isAvailable: !!TG,
|
|
|
|
close: () => TG?.close(),
|
|
sendData: (data) => TG?.sendData(JSON.stringify(data)),
|
|
haptic: (type) => {
|
|
try {
|
|
TG?.HapticFeedback?.impactOccurred(type || 'light');
|
|
} catch (e) {}
|
|
},
|
|
showAlert: (msg) => {
|
|
if (TG?.showAlert) TG.showAlert(msg);
|
|
else alert(msg);
|
|
},
|
|
showConfirm: (msg) => {
|
|
if (TG?.showConfirm) return new Promise((r) => TG.showConfirm(msg, r));
|
|
return Promise.resolve(confirm(msg));
|
|
},
|
|
|
|
theme: () => TG?.themeParams || {},
|
|
}; |