Store XEONsmp

Pusat pembelian Rank dan Money resmi untuk server XEONsmp!

Status Server

Memuat...

IP : xionsmp.pixelforge.gg

Player Online : -

🏆 Rank XEONsmp

Memuat...

💰 Shop Money

Memuat...

📞 Hubungi Admin

Ada kendala? Hubungi admin XEONsmp!

📱 WhatsApp Admin 👾 Discord

❓ FAQ

Berapa lama proses pengiriman? +
Item otomatis masuk setelah pembayaran dikonfirmasi admin (max 5 menit).
Bagaimana cara bayar? +
1. Pilih item
2. Transfer via QRIS/GoPay
3. Upload bukti transfer
4. Admin konfirmasi & item dikirim
active'); } window.addEventListener('load', () => { loadStatus(); loadProducts(); setInterval(loadStatus, 60000); });
Belum ada produk.
'; document.getElementById('moneyContainer').innerHTML = mHtml || '
Belum ada produk.
'; // Isi select di modal const sel = document.getElementById('buyItem'); sel.innerHTML = ''; [...ranks, ...money].forEach(p => { products.push(p); const opt = document.createElement('option'); opt.value = p.id; opt.textContent = p.title + ' - ' + rupiah(p.price * (1 - (p.discountPercent || 0) / 100)); sel.appendChild(opt); }); } catch (e) { console.error('Products error', e); } } function renderCard(p) { const disc = p.discountPercent || 0; const final = disc > 0 ? p.price * (1 - disc / 100) : p.price; return `
${disc > 0 ? '
SALE ' + disc + '%
' : ''}
${p.title}
${p.desc || ''}
${disc > 0 ? '' + rupiah(p.price) + '' : ''} ${rupiah(final)}
`; } function rupiah(n) { return 'Rp' + Number(n).toLocaleString('id-ID'); } // ============================================ // CEK PLAYER // ============================================ async function checkPlayer() { const u = document.getElementById('mcUsername').value.trim(); if (!u) { alert('Masukkan nickname dulu!'); return; } const box = document.getElementById('profileBox'); box.classList.add('active'); document.getElementById('pUser').textContent = u; document.getElementById('pRank').textContent = '...'; document.getElementById('pMoney').textContent = '...'; try { const res = await fetch(API + '/player/' + encodeURIComponent(u)); const d = await res.json(); if (res.status === 404) { document.getElementById('pRank').textContent = 'Member (Default)'; document.getElementById('pMoney').textContent = '$0'; } else { document.getElementById('pRank').textContent = d.rank || 'Member'; document.getElementById('pMoney').textContent = '$' + Number(d.money || 0).toLocaleString('id-ID'); } } catch (e) { document.getElementById('pRank').textContent = 'Error'; document.getElementById('pMoney').textContent = '-'; } } // ============================================ // CART // ============================================ function addCart(id) { const p = products.find(x => x.id === id); if (!p) return; cart.push(p); updateCart(); showToast('Item ditambahkan ke keranjang!'); } function updateCart() { document.getElementById('cartCount').textContent = cart.length; const list = document.getElementById('cartList'); if (cart.length === 0) { list.innerHTML = 'Keranjang masih kosong.'; document.getElementById('cartTotal').textContent = 'Rp0'; return; } let html = '', total = 0; cart.forEach((p, i) => { const disc = p.discountPercent || 0; const final = disc > 0 ? p.price * (1 - disc / 100) : p.price; total += final; html += `
${p.title} ${rupiah(final)} [x]
`; }); list.innerHTML = html; document.getElementById('cartTotal').textContent = rupiah(total); } function removeCart(i) { cart.splice(i, 1); updateCart(); } function openCart() { document.getElementById('cartModal').classList.add('active'); } async function checkoutCart(method) { if (!token || !userData) { alert('Login dulu untuk checkout!'); location.href = 'login.html'; return; } if (cart.length === 0) { alert('Keranjang kosong!'); return; } const total = cart.reduce((s, p) => { const d = p.discountPercent || 0; return s + (d > 0 ? p.price * (1 - d / 100) : p.price); }, 0); const creatorCode = document.getElementById('creatorCode').value.trim(); try { const res = await fetch(API + '/orders', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + token }, body: JSON.stringify({ items: cart.map(p => ({ id: p.id, title: p.title, price: p.price })), method: method, creatorCode: creatorCode }) }); const d = await res.json(); if (!res.ok) throw new Error(d.message); alert('✅ Order berhasil!\nID: ' + d.orderId + '\n\nKirim bukti transfer ke Admin.'); cart = []; updateCart(); closeModal('cartModal'); } catch (e) { alert('❌ ' + e.message); } } // ============================================ // MODAL BUY // ============================================ function openBuy(id) { if (!token) { alert('Login dulu!'); location.href = 'login.html'; return; } document.getElementById('buyItem').value = id; document.getElementById('purchaseModal').classList.add('active'); } function closeModal(id) { document.getElementById(id).classList.remove('active'); } function resetForm() { document.getElementById('checkoutForm').style.display = 'block'; document.getElementById('qrisDisplay').style.display = 'none'; document.getElementById('gopayDisplay').style.display = 'none'; document.getElementById('mTitle').textContent = 'Form Pembelian'; } function pay(method) { const u = document.getElementById('buyUser').value.trim(); if (!u) { alert('Masukkan nama Minecraft!'); return; } document.getElementById('checkoutForm').style.display = 'none'; if (method === 'qris') { document.getElementById('qrisDisplay').style.display = 'flex'; document.getElementById('mTitle').textContent = 'Pembayaran QRIS'; } else { document.getElementById('gopayDisplay').style.display = 'flex'; document.getElementById('mTitle').textContent = 'Pembayaran GoPay'; } } // ============================================ // REDEEM // ============================================ async function redeem() { if (!token) { alert('Login dulu untuk klaim kode!'); location.href = 'login.html'; return; } const code = document.getElementById('redeemCode').value.trim(); const box = document.getElementById('redeemMsg'); if (!code) { box.className = 'msg-box error'; box.textContent = 'Masukkan kode!'; return; } try { const res = await fetch(API + '/redeem', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + token }, body: JSON.stringify({ code }) }); const d = await res.json(); if (!res.ok) throw new Error(d.message); box.className = 'msg-box success'; box.textContent = '✅ Klaim ' + d.reward + ' berhasil!'; document.getElementById('redeemCode').value = ''; } catch (e) { box.className = 'msg-box error'; box.textContent = '❌ ' + e.message; } } // ============================================ // FAQ // ============================================ function toggleFAQ(el) { el.nextElementSibling.classList.toggle('active'); } // ============================================ // TOAST // ============================================ function showToast(msg) { const t = document.getElementById('toast'); document.getElementById('toastUser').textContent = userData ? userData.display_name : 'Kamu'; document.getElementById('toastItem').textContent = msg; t.classList.add('show'); setTimeout(() => t.classList.remove('show'), 2500); } // ============================================ // TIMER // ============================================ function startTimer() { let t = 9912; setInterval(() => { const h = Math.floor(t / 3600); const m = Math.floor((t % 3600) / 60); const s = t % 60; document.getElementById('timer').textContent = String(h).padStart(2, '0') + ' : ' + String(m).padStart(2, '0') + ' : ' + String(s).padStart(2, '0'); if (t > 0) t--; }, 1000); } // ============================================ // INIT // ============================================ window.addEventListener('load', () => { loadStatus(); loadProducts(); startTimer(); updateCart(); setInterval(loadStatus, 60000); }); });