@@ -1466,6 +1470,59 @@ function buildCashoutPlatforms() {
}
// ─── TOKEN PACKAGES ────────────────────────────────────────
+function pkgScroll(dir) {
+ const el = document.getElementById('pkg-scroll');
+ if (el) el.scrollBy({ left: dir * 160, behavior: 'smooth' });
+}
+
+function initPkgScrollMouse() {
+ const el = document.getElementById('pkg-scroll');
+ if (!el) return;
+
+ // Show/hide arrows based on scroll position
+ const prev = document.getElementById('pkg-prev');
+ const next = document.getElementById('pkg-next');
+ function updateArrows() {
+ if (!prev || !next) return;
+ const canLeft = el.scrollLeft > 4;
+ const canRight = el.scrollLeft < el.scrollWidth - el.clientWidth - 4;
+ prev.style.display = canLeft ? 'block' : 'none';
+ next.style.display = canRight ? 'block' : 'none';
+ }
+ el.addEventListener('scroll', updateArrows, { passive: true });
+ setTimeout(updateArrows, 100);
+
+ // Mouse wheel → horizontal scroll
+ el.addEventListener('wheel', e => {
+ if (Math.abs(e.deltaY) > Math.abs(e.deltaX)) {
+ e.preventDefault();
+ el.scrollBy({ left: e.deltaY * 1.5, behavior: 'auto' });
+ }
+ }, { passive: false });
+
+ // Click-drag scroll
+ let down = false, startX = 0, startScroll = 0, moved = false;
+ el.addEventListener('mousedown', e => {
+ down = true; moved = false;
+ startX = e.pageX; startScroll = el.scrollLeft;
+ el.style.cursor = 'grabbing'; el.style.userSelect = 'none';
+ });
+ document.addEventListener('mousemove', e => {
+ if (!down) return;
+ const dx = e.pageX - startX;
+ if (Math.abs(dx) > 4) moved = true;
+ el.scrollLeft = startScroll - dx;
+ });
+ document.addEventListener('mouseup', () => {
+ if (!down) return;
+ down = false;
+ el.style.cursor = 'grab'; el.style.userSelect = '';
+ // If the mouse barely moved, let the click on the pill go through
+ if (!moved) el.style.cursor = '';
+ });
+ el.style.cursor = 'grab';
+}
+
function buildPkgPills() {
const container = document.getElementById('pkg-scroll');
container.innerHTML = CFG.packages.map((pkg, i) => `
@@ -1476,6 +1533,7 @@ function buildPkgPills() {
const popularIdx = CFG.packages.findIndex(p => p.popular);
const idx = popularIdx >= 0 ? popularIdx : 0;
selectPkg(idx, container.querySelectorAll('.pkg-pill')[idx]);
+ initPkgScrollMouse();
}
function selectPkg(i, el) {
S.pkg = CFG.packages[i]; S.customPkg = false;