diff --git a/public/assets/my.js b/public/assets/my.js
index 7115c8c..29a911f 100644
--- a/public/assets/my.js
+++ b/public/assets/my.js
@@ -285,6 +285,26 @@
if (toast) { IAP.status(toast, kind); if (sound) playSound(sound); liveRefresh(); }
}
+ // training center: videos + materials (admin-curated via data/training.json)
+ async function loadTraining() {
+ try {
+ const r = await (await fetch('/api/training')).json();
+ const el = $('trainingList'); if (!el) return;
+ const items = r.items || [];
+ if (!items.length) { el.innerHTML = '
Training materials are being added. Check back soon.
'; return; }
+ el.innerHTML = items.map(it => {
+ const isVid = it.videoUrl && /\.(mp4|webm)(\?|$)/i.test(it.videoUrl);
+ const media = isVid ? '' : '';
+ const links = [];
+ if (it.videoUrl && !isVid) links.push('Watch');
+ if (it.docUrl) links.push('Open material');
+ return '' + esc(it.title || 'Lesson') + '
'
+ + (it.desc ? '
' + esc(it.desc) + '
' : '')
+ + (media ? '
' + media + '
' : '')
+ + (links.length ? '
' + links.join(' ') + '
' : '') + '
';
+ }).join('');
+ } catch (e) {}
+ }
// visual line tree on the Overview: YOU + three levels, qualified directs in gold
async function loadLineTree(buyerCount) {
try {
@@ -409,9 +429,9 @@
}
// ── back-office menu: hash-routed panes ───────────────
- const PANES = ['overview', 'line', 'buy', 'campaigns', 'earn', 'earnings', 'promo', 'wallet', 'profile'];
+ const PANES = ['overview', 'line', 'buy', 'campaigns', 'earn', 'earnings', 'promo', 'training', 'wallet', 'profile'];
const TITLES = { overview: 'Overview', line: 'My line', buy: 'Buy packages', campaigns: 'Campaigns',
- earn: 'Earn credits', earnings: 'Earnings', promo: 'Promo tools',
+ earn: 'Earn credits', earnings: 'Earnings', promo: 'Promo tools', training: 'Training',
wallet: 'Wallet & account', profile: 'Profile' };
function setPane(name) {
if (!PANES.includes(name)) name = 'overview';
@@ -426,6 +446,7 @@
if (name === 'profile') loadLineBanner();
if (name === 'line') { loadLineage(); loadUplineMessages(); }
if (name === 'campaigns') ['cTarget', 'cImage', 'cVideoUrl'].forEach(id => { if ($(id)) $(id).value = ''; }); // no residual URL between visits
+ if (name === 'training') loadTraining();
document.getElementById('memberArea').classList.remove('side-open'); // close mobile drawer
if (location.hash !== '#' + name) history.replaceState(null, '', '#' + name);
}
diff --git a/public/my.html b/public/my.html
index c6b9d3f..de25a84 100644
--- a/public/my.html
+++ b/public/my.html
@@ -126,6 +126,7 @@
+
@@ -615,6 +616,15 @@
+
+
+
Training center
+
Everything to help you get started and grow: walkthrough videos and materials.
+ New lessons land here as they are added.
+
+
+
+
Get test POL
@@ -670,7 +680,7 @@
-
+