BotWeb / page /broadcast.html
FikXzModzDeveloper
deploy awal
c20600f
Raw
History Blame Contribute Delete
15.7 kB
<!DOCTYPE html>
<html lang="id" class="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Broadcast - Botz Control Panel</title>
<link rel="icon" type="image/jpeg" href="https://cdn.yupra.my.id/yp/4r4oy0ze.jpg">
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
darkMode: 'class',
theme: {
extend: {
colors: {
primary: '#6366f1',
secondary: '#ec4899',
darkbg: '#0f172a',
cardbg: '#1e293b',
inputbg: '#334155',
sidebar: '#111827'
},
fontFamily: {
sans: ['Inter', 'sans-serif'],
mono: ['JetBrains Mono', 'monospace']
}
}
}
}
</script>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
<style>
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #475569; border-radius: 20px; }
.glass { background: rgba(30, 41, 59, 0.7); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.05); }
</style>
</head>
<body class="bg-[#020617] text-slate-300 font-sans h-screen flex overflow-hidden selection:bg-primary selection:text-white">
<div id="toast-container" class="fixed top-6 right-6 z-[100] flex flex-col gap-3 pointer-events-none"></div>
<aside class="hidden md:flex flex-col w-64 bg-sidebar border-r border-white/5 h-full relative z-20">
<div class="p-6 flex items-center gap-3">
<div class="w-10 h-10 rounded-xl bg-gradient-to-br from-primary to-indigo-700 flex items-center justify-center text-white shadow-lg shadow-primary/20">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"/></svg>
</div>
<h1 class="text-lg font-bold text-white tracking-tight">Panel Botz</h1>
</div>
<nav class="flex-1 px-4 space-y-2 py-4">
<a href="/" class="nav-item w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-medium text-slate-400 hover:bg-white/5 hover:text-white transition-all border border-transparent">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"/></svg>
Dashboard
</a>
<a href="/broadcast" class="nav-item active w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-medium text-slate-400 hover:bg-white/5 hover:text-white transition-all border border-transparent">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5.882V19.24a1.76 1.76 0 01-3.417.592l-2.147-6.15M18 13a3 3 0 100-6M5.436 13.683A4.001 4.001 0 017 6h1.832c4.1 0 7.625-1.234 9.168-3v14c-1.543-1.766-5.067-3-9.168-3H7a3.988 3.988 0 01-1.564-.317z"/></svg>
Broadcast
</a>
<a href="/tools" class="nav-item w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-medium text-slate-400 hover:bg-white/5 hover:text-white transition-all border border-transparent">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/></svg>
Tools
</a>
<a href="/settings" class="nav-item w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-medium text-slate-400 hover:bg-white/5 hover:text-white transition-all border border-transparent">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/></svg>
Settings
</a>
</nav>
<div class="p-4 border-t border-white/5">
<div class="glass p-3 rounded-xl flex items-center gap-3">
<div id="status-dot" class="w-2.5 h-2.5 rounded-full bg-red-500 animate-pulse"></div>
<div>
<p id="status-text" class="text-[10px] font-bold uppercase tracking-widest text-red-500">DISCONNECTED</p>
<p id="bot-name-display" class="text-xs text-slate-400 truncate w-32">Connecting...</p>
</div>
</div>
</div>
</aside>
<main class="flex-1 flex flex-col h-full relative overflow-hidden bg-[#020617]">
<header class="glass sticky top-0 z-30 px-6 py-4 flex md:hidden items-center justify-between border-b border-white/5">
<div class="flex items-center gap-3">
<div class="w-9 h-9 rounded-lg bg-gradient-to-br from-primary to-indigo-700 flex items-center justify-center text-white shadow-lg shadow-primary/20">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"/></svg>
</div>
<h1 class="text-lg font-bold text-white tracking-tight">Panel Botz</h1>
</div>
<div class="flex items-center gap-2">
<div id="status-dot-m" class="w-2 h-2 rounded-full bg-red-500 animate-pulse"></div>
</div>
</header>
<div class="flex-1 overflow-y-auto p-4 md:p-8 pb-24 md:pb-8 custom-scroll relative">
<div class="max-w-4xl mx-auto space-y-6">
<div>
<h2 class="text-3xl md:text-4xl font-bold text-white mb-2">Broadcast</h2>
<p class="text-slate-400 text-base">Kirim pesan massal atau personal</p>
</div>
<div class="glass p-6 md:p-8 rounded-2xl shadow-xl border-t-2 border-primary/50">
<form id="form-pesan" class="space-y-6">
<div class="grid grid-cols-1 md:grid-cols-2 gap-5">
<div class="space-y-2">
<label class="text-sm text-slate-400 font-bold ml-1 uppercase">Target Number</label>
<input type="text" id="target" placeholder="628xxx" class="w-full bg-inputbg px-4 py-3.5 rounded-xl border border-slate-700 focus:border-primary focus:ring-1 focus:ring-primary outline-none transition text-white">
</div>
<div class="space-y-2">
<label class="text-sm text-slate-400 font-bold ml-1 uppercase">Mode</label>
<div class="w-full bg-slate-900 px-4 py-3.5 rounded-xl border border-slate-800 text-slate-400 text-sm flex items-center gap-2 cursor-not-allowed opacity-80">
<span class="w-2 h-2 rounded-full bg-green-500"></span>
Relay Protocol (Safe)
</div>
</div>
</div>
<div class="space-y-2">
<label class="text-sm text-slate-400 font-bold ml-1 uppercase">Message Content</label>
<textarea id="message" rows="8" placeholder="Type your message here..." class="w-full bg-inputbg px-4 py-3.5 rounded-xl border border-slate-700 focus:border-primary focus:ring-1 focus:ring-primary outline-none transition text-white resize-none"></textarea>
</div>
<button type="submit" id="btn-send" class="w-full bg-gradient-to-r from-primary to-indigo-600 hover:from-primary hover:to-indigo-500 text-white font-bold py-4 rounded-xl transition-all shadow-xl shadow-primary/20 active:scale-[0.99]">
SEND MESSAGE
</button>
</form>
</div>
</div>
</div>
</main>
<div class="md:hidden fixed bottom-0 inset-x-0 bg-sidebar border-t border-white/5 z-50 flex justify-around items-center p-2 pb-5">
<a href="/" class="nav-item flex flex-col items-center gap-1 p-2 rounded-xl text-slate-400">
<svg class="w-7 h-7" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"/></svg>
<span class="text-[11px] font-medium">Home</span>
</a>
<a href="/broadcast" class="nav-item flex flex-col items-center gap-1 p-2 rounded-xl text-slate-400">
<svg class="w-7 h-7" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5.882V19.24a1.76 1.76 0 01-3.417.592l-2.147-6.15M18 13a3 3 0 100-6M5.436 13.683A4.001 4.001 0 017 6h1.832c4.1 0 7.625-1.234 9.168-3v14c-1.543-1.766-5.067-3-9.168-3H7a3.988 3.988 0 01-1.564-.317z"/></svg>
<span class="text-[11px] font-medium">Broad</span>
</a>
<a href="/tools" class="nav-item flex flex-col items-center gap-1 p-2 rounded-xl text-slate-400">
<svg class="w-7 h-7" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/></svg>
<span class="text-[11px] font-medium">Tools</span>
</a>
<a href="/settings" class="nav-item flex flex-col items-center gap-1 p-2 rounded-xl text-slate-400">
<svg class="w-7 h-7" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/></svg>
<span class="text-[11px] font-medium">Set</span>
</a>
</div>
<script>
function showToast(msg, type = 'success') {
const container = document.getElementById('toast-container');
const div = document.createElement('div');
const bg = type === 'success' ? 'bg-green-500/10 border-green-500/30 text-green-200' : 'bg-red-500/10 border-red-500/30 text-red-200';
div.className = `glass px-4 py-3 rounded-xl border backdrop-blur-md shadow-2xl flex items-center gap-3 transform translate-x-full transition-all duration-300 pointer-events-auto min-w-[280px] ${bg}`;
div.innerHTML = `<span class="font-medium text-sm">${msg}</span>`;
container.appendChild(div);
requestAnimationFrame(() => div.classList.remove('translate-x-full'));
setTimeout(() => {
div.classList.add('translate-x-full', 'opacity-0');
setTimeout(() => div.remove(), 300);
}, 3000);
}
document.getElementById('form-pesan').addEventListener('submit', async (e) => {
e.preventDefault();
const btn = document.getElementById('btn-send');
const originalTxt = btn.innerText;
btn.innerText = 'SENDING...'; btn.disabled = true; btn.classList.add('opacity-70');
try {
const res = await fetch('/sendpesan', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({ number: document.getElementById('target').value, teks: document.getElementById('message').value })
});
const d = await res.json();
if(d.status) { showToast('Message sent'); document.getElementById('message').value = ''; }
else { showToast(d.message || d.error, 'error'); }
} catch(e) { showToast('Failed to connect', 'error'); }
btn.innerText = originalTxt; btn.disabled = false; btn.classList.remove('opacity-70');
});
async function fetchStats() {
try {
const res = await fetch('/stats');
if (res.redirected) {
window.location.href = res.url;
return;
}
const data = await res.json();
const stText = document.getElementById('status-text');
const stDot = document.getElementById('status-dot');
const stDotM = document.getElementById('status-dot-m');
if(data.wa.connected) {
stText.innerText = 'ONLINE'; stText.className = 'text-[10px] font-bold uppercase tracking-widest text-primary';
stDot.className = 'w-2.5 h-2.5 rounded-full bg-primary shadow-[0_0_12px_#6366f1]';
stDotM.className = 'w-2 h-2 rounded-full bg-primary shadow-[0_0_12px_#6366f1]';
if(data.wa.user) document.getElementById('bot-name-display').innerText = data.wa.user.name || data.wa.user.id;
} else {
stText.innerText = 'DISCONNECTED'; stText.className = 'text-[10px] font-bold uppercase tracking-widest text-red-500';
stDot.className = 'w-2.5 h-2.5 rounded-full bg-red-500 animate-pulse';
stDotM.className = 'w-2 h-2 rounded-full bg-red-500 animate-pulse';
}
} catch (e) {}
}
setInterval(fetchStats, 2000);
fetchStats();
</script>
</body>
</html>