-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.html
More file actions
249 lines (226 loc) · 12.2 KB
/
Copy pathdev.html
File metadata and controls
249 lines (226 loc) · 12.2 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
<title>TWA — Каталог курсов (dev)</title>
<!-- Font Awesome (иконки) -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="assets/css/style.css" />
<link rel="stylesheet" href="assets/css/dev.css" />
<script src="https://telegram.org/js/telegram-web-app.js"></script>
<script>
const tg = window.Telegram.WebApp;
tg.ready();
if (tg.isVersionAtLeast && tg.isVersionAtLeast('6.1')) {
tg.BackButton.hide();
}
</script>
</head>
<body>
<!-- header with compact search -->
<div class="topbar">
<div class="search-wrap">
<div class="search" role="search">
<i class="fa-solid fa-magnifying-glass"></i>
<input id="searchInput" placeholder="Поиск курса или категории..." autocomplete="off" />
</div>
<div id="suggestBox" aria-hidden="true"></div>
</div>
</div>
<div class="banner-wrap">
<div id="banner-carousel">
<div class="banner" style="background: radial-gradient(87.56% 85.19% at 87.37% -15.14%, rgb(83, 255, 214) 0%, rgba(51, 169, 255, 0) 100%), radial-gradient(67.94% 70.77% at 0% 100%, rgb(113, 195, 255) 0%, rgb(93, 99, 255) 100%);" onclick="window.location.href='pages/banner1.html'">
<div class="banner-text">
<div class="banner-title">🔥 Неделя тренировок для новых пользователей</div>
<div class="banner-subtitle">Подробнее ></div>
</div>
<img class="banner-icon" src="assets/img/banner1.png" alt="Неделя тренировок">
</div>
<div class="banner" style="background: linear-gradient(to right, #7B4FFF, #8E2DE2, #9C2ACE)" onclick="window.location.href='pages/banner2.html'">
<div class="banner-text">
<div class="banner-title">🎯 Для тех, кто знает чего хочет</div>
<div class="banner-subtitle">Подробнее ></div>
</div>
<img class="banner-icon" src="assets/img/banner2.png" alt="Месяц тренировок">
</div>
<div class="banner" style="background-image: linear-gradient(45deg, #FFD700, #CD853F)" onclick="window.location.href='pages/banner3.html'">
<div class="banner-text">
<div class="banner-title">🎯 Возможность заработка для владельцев каналов</div>
<div class="banner-subtitle">Подробнее ></div>
</div>
<img class="banner-icon" src="assets/img/banner3.png" alt="Заработать">
</div>
</div>
<!-- Индикаторы карусели (только в dev) -->
<div class="banner-dots" aria-hidden="true">
<span class="banner-dot active"></span>
<span class="banner-dot"></span>
<span class="banner-dot"></span>
</div>
</div>
<div id="catWrap">
<div id="categories" aria-label="Категории"></div>
</div>
<main class="container">
<section id="page-catalog" class="page active">
<div id="catalogQuickFilters" class="catalog-quick-filters" aria-label="Быстрые фильтры">
<button type="button" class="catalog-filter-chip active" data-filter="all">Все</button>
<button type="button" class="catalog-filter-chip" data-filter="bookmarks">В закладках</button>
<button type="button" class="catalog-filter-chip" data-filter="watched">Просмотрено</button>
</div>
<div class="controls">
<div class="small-muted" id="countInfo">Загрузка...</div>
</div>
<div id="courses" class="courses"></div>
</section>
<section id="page-leaderboard" class="page">
<h2 style="margin:0 0 8px 0">Участники</h2>
<div id="leaderboardMeBlock" class="leaderboard-me-block" style="display:none"></div>
<div class="leaderboard-header leaderboard-row">
<span class="leaderboard-rank">#</span>
<span class="leaderboard-username">Ник</span>
<span class="leaderboard-rating">Рейтинг</span>
<span class="leaderboard-level">Уровень</span>
<span class="leaderboard-belt">Пояс</span>
</div>
<div id="leaderboardList" class="leaderboard-list"></div>
</section>
<section id="page-profile" class="page">
<div class="profile-page">
<!-- Hero -->
<div class="profile-hero">
<div class="profile-hero-firework" aria-hidden="true"></div>
<button type="button" id="profileEditBtn" class="profile-edit-icon-btn profile-edit-icon-btn--hero" title="Редактировать" aria-label="Редактировать">
<i class="fa-solid fa-pen"></i>
</button>
<div id="profileAvatar" class="profile-avatar"></div>
<h1 id="profileName" class="profile-name">Загрузка...</h1>
<div id="profileBadges" class="profile-badges"></div>
</div>
<!-- Рейтинг (светлый золотой, выше остальных плашек) -->
<div class="profile-rating-card">
<div class="profile-block-header">
<span class="profile-rating-title">Текущий рейтинг</span>
<button type="button" class="profile-hint-btn" data-hint="rating" title="Подсказка" aria-label="Что такое рейтинг">
<i class="fa-solid fa-circle-question"></i>
</button>
</div>
<div class="profile-rating-bar-wrap">
<div class="profile-rating-bar">
<div class="profile-rating-fill" id="profileRatingFill" style="width:0%"></div>
<span class="profile-rating-value" id="profileRating">0</span>
</div>
</div>
</div>
<!-- Небольшие плашки: просмотрено + уровень -->
<div class="profile-stats-compact">
<div class="profile-mini-card profile-mini-card--watched">
<div class="profile-block-header">
<span class="profile-mini-label">Курсов просмотрено</span>
<button type="button" class="profile-hint-btn" data-hint="watched" title="Подсказка" aria-label="Что такое курсов просмотрено">
<i class="fa-solid fa-circle-question"></i>
</button>
</div>
<div class="profile-mini-bar">
<div id="profileProgressFill" class="profile-mini-fill" style="width:0%"></div>
</div>
</div>
<div id="profileLevelBlock" class="profile-mini-card profile-mini-card--level" style="display:none">
<div class="profile-block-header profile-block-header--level">
<span class="profile-mini-level" id="profileLevelText">Уровень 1</span>
<button type="button" class="profile-hint-btn" data-hint="level" title="Подсказка" aria-label="Что такое уровень">
<i class="fa-solid fa-circle-question"></i>
</button>
</div>
</div>
</div>
<!-- Подложка и попап подсказки (общий для всех блоков) -->
<div id="profileHintBackdrop" class="profile-hint-backdrop" aria-hidden="true"></div>
<div id="profileHintPopover" class="profile-hint-popover" role="dialog" aria-hidden="true">
<div class="profile-hint-popover-inner">
<p id="profileHintText" class="profile-hint-text"></p>
<button type="button" class="profile-hint-close" aria-label="Закрыть"><i class="fa-solid fa-times"></i></button>
</div>
</div>
<!-- Закладки -->
<div class="profile-stats-grid">
<div class="profile-stat-card">
<div class="profile-stat-value" id="profileBookmarksCount">0</div>
<div class="profile-stat-label">В закладках</div>
</div>
</div>
<!-- Achievements -->
<div class="profile-section">
<h2 class="profile-section-title">Достижения</h2>
<div id="profileAchievements" class="profile-achievements"></div>
</div>
<!-- Belt form (редактирование) -->
<div id="profileBeltFormWrap" class="profile-section profile-belt-section">
<div id="profileBeltForm" class="profile-belt-form">
<h3 class="profile-form-title">Пояс, раздел и клуб</h3>
<label class="profile-form-label">Пояс</label>
<div id="profileBeltPicker" class="profile-belt-picker"></div>
<label class="profile-form-label">Раздел</label>
<div id="profileDivisionPicker" class="profile-division-picker"></div>
<label class="profile-form-label">Клуб <span class="profile-form-optional">(необязательно)</span></label>
<input type="text" id="profileClubInput" class="profile-club-input" placeholder="Название клуба" maxlength="100" autocomplete="off">
<div class="profile-form-actions">
<button type="button" id="profileCancelBeltBtn" class="profile-cancel-btn" style="display:none">Отмена</button>
<button type="button" id="profileSaveBeltBtn" class="profile-save-btn">Сохранить</button>
</div>
</div>
</div>
</div>
</section>
</main>
<div id="toast"></div>
<!-- Access modal: closed group / club -->
<div id="accessModalBackdrop" class="profile-hint-backdrop access-modal-backdrop" aria-hidden="true" style="display:none"></div>
<div id="accessModal" class="access-modal" role="dialog" aria-hidden="true" style="display:none">
<div class="access-modal-inner">
<h2 class="access-modal-title">Нет доступа к закрытой группе</h2>
<p class="access-modal-subtitle" id="accessModalCourseTitle"></p>
<div class="access-modal-tariffs" id="accessModalTariffs"></div>
<button type="button" id="accessModalCloseBtn" class="access-modal-close-btn">Позже</button>
</div>
</div>
<nav class="bottom-nav" role="navigation">
<div class="nav-item active" data-target="page-catalog"><i class="fa-solid fa-book"></i>Каталог</div>
<div class="nav-item" data-target="page-leaderboard"><i class="fa-solid fa-users"></i>Участники</div>
<div class="nav-item" data-target="page-profile"><i class="fa-solid fa-user"></i>Профиль</div>
</nav>
<script src="assets/js/profile-config.js"></script>
<script src="assets/js/app.js"></script>
<!-- Отладка авторизации (раскомментировать при необходимости)
<script>
const output = document.createElement('pre');
output.id = 'auth-output';
output.style.cssText = 'white-space:pre-wrap;padding:10px;font-family:monospace;background:#f3f3f3;border:1px solid #ccc;margin:10px;';
document.body.appendChild(output);
function print(msg) { output.textContent += msg + '\n'; }
try {
print('Telegram WebApp ready...');
print('tg.initData: ' + (tg.initData || 'пусто'));
async function telegramAuth() {
try {
if (!tg.initData) { print('Ошибка: initData отсутствует!'); return; }
const res = await fetch('https://dev.wtfbjj.ru/api/auth.php', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ initData: tg.initData })
});
print('Ответ: ' + res.status);
const data = await res.json();
if (!res.ok) { print('Ошибка: ' + JSON.stringify(data)); return; }
localStorage.setItem('jwt_token', data.token);
tg.BackButton.show();
print('Авторизация успешна');
} catch (err) { print('Ошибка: ' + err.message); }
}
telegramAuth();
} catch (err) { print('Глобальная ошибка: ' + err.message); }
</script>
-->
</body>
</html>