PKpi] index.html Go Chat

G o C h a t

Your AI Chat Partner

Powered by Rafi
Go Chat - Voice
Live Mode Active
"Listening..."
LIVE TRANSCRIPT
Speak now...
AI REPLY
Waiting...
Copied
PKs��0�0PKpi] style.css*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent} html,body{height:100%;background:#070b14;color:#e8f0ff;font-family:system-ui,-apple-system,sans-serif;overflow:hidden} button,input,textarea{font:inherit;color:inherit;border:0;background:none;cursor:pointer} .screen { position: absolute; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; flex-direction: column; transition: opacity 0.6s ease; z-index: 50; background: #07090e; } .screen.hidden { opacity: 0; pointer-events: none; display: none !important; } #splash-screen { background: radial-gradient(circle, #0f172a 0%, #07090e 100%); z-index: 9999; animation: hideSplash 1s ease 10s forwards; cursor: pointer; } @keyframes hideSplash { to { opacity: 0; visibility: hidden; pointer-events: none; } } .splash-container { text-align: center; } .floating-title { display: flex; justify-content: center; font-size: 52px; font-weight: 900; margin-bottom: 10px; } .f-letter { color: #38bdf8; text-shadow: 0 0 25px rgba(56, 189, 248, 0.8); animation: floatIn 3s cubic-bezier(0.1, 0.9, 0.2, 1) forwards; opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(0.3); } .f-letter:nth-child(1) { animation-delay: 0.2s; } .f-letter:nth-child(2) { animation-delay: 0.6s; } .f-letter:nth-child(3) { animation-delay: 1.0s; } .f-letter:nth-child(4) { animation-delay: 1.4s; } .f-letter:nth-child(5) { animation-delay: 1.8s; } .f-letter:nth-child(6) { animation-delay: 2.2s; } @keyframes floatIn { 0% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(0.3); } 100% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); } } .splash-subtitle { font-size: 16px; color: #94a3b8; letter-spacing: 3px; margin-bottom: 25px; opacity: 0; animation: fadeInSubtitle 1.5s ease 3s forwards; } @keyframes fadeInSubtitle { to { opacity: 1; } } .splash-powered { font-size: 15px; color: #ffffff; font-weight: 600; letter-spacing: 2px; opacity: 0; animation: fadeInPowered 1.5s ease 4.5s forwards; } @keyframes fadeInPowered { to { opacity: 1; } } .room { position: relative; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; background: #0b0f19; } .auth-card { background: rgba(30, 41, 59, 0.85); backdrop-filter: blur(16px); padding: 30px; border-radius: 20px; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6); width: 100%; max-width: 400px; border: 1px solid rgba(255, 255, 255, 0.1); z-index: 5; } .welcome-header { text-align: center; margin-bottom: 20px; } .welcome-header h2 { font-size: 22px; color: #ffffff; margin-bottom: 4px; } .welcome-header p { font-size: 12px; color: #94a3b8; } .tab-switcher { display: flex; background: rgba(15, 23, 42, 0.9); border-radius: 10px; margin-bottom: 18px; padding: 4px; } .tab-btn { flex: 1; background: transparent; border: none; color: #94a3b8; padding: 8px; font-weight: 700; font-size: 12px; border-radius: 8px; cursor: pointer; } .tab-btn.active { background: #38bdf8; color: #07090e; } .google-btn { width: 100%; background: #ffffff; color: #1e293b; border: none; padding: 11px; border-radius: 10px; font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; } .google-icon { width: 18px; height: 18px; } .divider { text-align: center; margin: 16px 0; position: relative; } .divider::before { content: ""; position: absolute; top: 50%; left: 0; width: 100%; height: 1px; background: rgba(255, 255, 255, 0.1); } .divider span { background: #1e293b; padding: 0 10px; color: #64748b; font-size: 11px; position: relative; z-index: 1; } .form-section { display: none; } .form-section.active-form { display: block; } .input-group { margin-bottom: 14px; } .input-group label { display: block; font-size: 12px; color: #cbd5e1; margin-bottom: 5px; } .phone-input-wrapper { display: flex; gap: 8px; } .country-select { background: rgba(15, 23, 42, 0.9); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; color: white; padding: 11px 8px; font-size: 14px; outline: none; } .country-select option { background: #0f172a; color: white; } .input-field { width: 100%; padding: 11px 12px; background: rgba(15, 23, 42, 0.9); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; color: white; font-size: 14px; outline: none; } .action-btn { width: 100%; background: linear-gradient(135deg, #38bdf8, #0284c7); color: #07090e; border: none; padding: 11px; border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; } .modal-overlay { position: fixed; inset: 0; background: rgba(7, 9, 14, 0.85); backdrop-filter: blur(8px); display: flex; justify-content: center; align-items: center; z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; } .modal-overlay.active { opacity: 1; pointer-events: auto; } .modal-card { background: #1e293b; padding: 25px; border-radius: 16px; width: 90%; max-width: 320px; border: 1px solid rgba(255, 255, 255, 0.1); text-align: center; } #app { display: flex; flex-direction: column; height: 100%; } .top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.1); background:#0d1524; flex-shrink:0; } .top h1 { flex:1; font-size:1.05rem; font-weight:700; } .ib { width:40px; height:40px; border-radius:12px; border:1px solid rgba(255,255,255,.12); background:#152036; display:inline-flex; align-items:center; justify-content:center; } .ib svg { width:20px; height:20px; stroke:#e8f0ff; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; } .panel { display:none; flex:1; min-height:0; flex-direction:column; } .panel.on { display:flex; } .home { flex:1; overflow:auto; padding:20px 16px 140px; display:flex; flex-direction:column; align-items:center; } .glow { width:72px; height:72px; border-radius:50%; margin:18px 0 12px; background:radial-gradient(circle at 30% 30%,#67e8f9,#0ea5e9 50%,transparent 70%); box-shadow:0 0 36px #06b6d466; } .home h2 { font-size:1.25rem; text-align:center; margin-bottom:6px; } .sub { color:#8aa0bc; font-size:13px; text-align:center; margin-bottom:16px; } .grid2 { display:grid; grid-template-columns:1fr 1fr; gap:10px; width:100%; max-width:400px; } .grid2 button { text-align:left; padding:14px; border-radius:16px; background:#0d1524; border:1px solid rgba(255,255,255,.1); font-size:13px; color:#e8f0ff; } .chat { flex:1; overflow:auto; padding:12px 12px 150px; max-width:720px; width:100%; margin:0 auto; } .row { display:flex; margin:10px 0; }.row.u { justify-content:flex-end; } .bub { max-width:90%; padding:12px 14px; border-radius:18px; font-size:15px; line-height:1.45; word-break:break-word; } .bub.u { background:#0ea5e9; color:#fff; border-bottom-right-radius:6px; } .bub.a { background:#152036; border:1px solid rgba(255,255,255,.1); border-bottom-left-radius:6px; } .acts { display:flex; gap:8px; margin-top:8px; } .act { padding:8px 12px; border-radius:999px; border:1px solid rgba(255,255,255,.12); background:#0d1524; color:#8aa0bc; font-size:12px; font-weight:600; } /* বটম ইনপুট বার ও সেন্ড বাটন পারফেক্ট ফিক্স */ .bar { position:fixed; left:0; right:0; bottom:0; z-index:50; padding:10px 12px; background:linear-gradient(to top,#070b14 80%,transparent); } .comp { max-width:720px; margin:0 auto; display:flex; align-items:center; gap:8px; background:#1a1d24; border:1px solid rgba(255,255,255,.15); border-radius:28px; padding:6px 10px; } .comp input { flex:1; outline:0; background:transparent; font-size:15px; padding:8px 6px; min-width:0; color:#e8f0ff; } .plus,.mic { width:38px; height:38px; border-radius:50%; border:1px solid rgba(255,255,255,.1); background:#252a33; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; } .plus svg,.mic svg { width:18px; height:18px; stroke:#e8f0ff; fill:none; stroke-width:2; stroke-linecap:round; } .chip { padding:6px 10px; border-radius:999px; background:#2a2f3a; font-size:11px; font-weight:700; flex-shrink:0; color:#e8f0ff; } #speakBtn, #sendBtn { flex-shrink: 0; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; } #speakBtn { background: #2a2f3a; border: 1px solid rgba(255,255,255,.12); color: #e8f0ff; } #sendBtn { background: linear-gradient(135deg,#06b6d4,#3b82f6); color: #fff; display: none; } #sendBtn.show { display: inline-flex !important; } #speakBtn.hide { display: none !important; } .db { display:none; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:80; }.db.on { display:block; } .dr { position:fixed; left:0; top:0; bottom:0; width:min(290px,85vw); z-index:90; background:#0d1524; border-right:1px solid rgba(255,255,255,.1); padding:18px 12px; transform:translateX(-110%); transition:transform .2s; } .dr.on { transform:none; } .dr .br { font-weight:700; font-size:1.15rem; margin-bottom:14px; } .dr nav button { display:block; width:100%; text-align:left; padding:14px 12px; border-radius:12px; font-weight:600; margin-bottom:4px; color:#e8f0ff; } .body { flex:1; overflow:auto; padding:16px; max-width:720px; width:100%; margin:0 auto; } .card { background:#0d1524; border:1px solid rgba(255,255,255,.1); border-radius:14px; padding:14px; margin-bottom:12px; } .btn { width:100%; padding:14px; border-radius:14px; background:linear-gradient(135deg,#06b6d4,#3b82f6); color:#fff; font-weight:700; } .btn.g { background:#152036; border:1px solid rgba(255,255,255,.12); color:#e8f0ff; } .btn.red { background:#f43f5e; } .field { margin-bottom:10px; }.field label { display:block; font-size:12px; color:#8aa0bc; margin-bottom:4px; } .field input,#code { width:100%; padding:12px; border-radius:12px; border:1px solid rgba(255,255,255,.12); background:#152036; color:#e8f0ff; } #code { min-height:30vh; font-family:ui-monospace,monospace; font-size:12px; } #frame { width:100%; height:34vh; border-radius:12px; border:1px solid rgba(255,255,255,.12); background:#fff; display:none; } .tabs { display:flex; gap:8px; margin-bottom:10px; } .tabs button { padding:10px 14px; border-radius:10px; border:1px solid rgba(255,255,255,.12); background:#152036; font-weight:600; color:#e8f0ff; } .tabs button.on { border-color:#06b6d4; color:#06b6d4; } .g2 { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:12px; } .g2 img { width:100%; border-radius:10px; max-height:120px; object-fit:cover; } .mu { color:#8aa0bc; font-size:13px; } .toast { display:none; position:fixed; top:12px; left:50%; transform:translateX(-50%); z-index:10000; background:#14532d; color:#bbf7d0; padding:10px 16px; border-radius:999px; font-weight:700; } .toast.on { display:block; } /* প্রিমিয়াম জেমিনি লাইভ ভয়েস ইউআই স্টাইল */ #live { display:none; position:fixed; inset:0; z-index:100; background:radial-gradient(circle at center, #0f172a 0%, #070b14 100%); flex-direction:column; padding:20px; justify-content:space-between; align-items:center; } #live.on { display:flex; } .lv-top { font-weight:700; font-size:1.2rem; color:#fff; letter-spacing:1px; } .lv-st { font-size:13px; color:#38bdf8; margin-top:4px; } .lv-mid { display:flex; flex-direction:column; align-items:center; } .lv-orb { width:140px; height:140px; border-radius:50%; background:radial-gradient(circle at 35% 30%,#7dd3fc,#0284c7 50%,#0c4a6e); box-shadow:0 0 60px #06b6d4aa, inset 0 0 20px #e0f2fe; animation: pulse-orb 2s infinite ease-in-out; } @keyframes pulse-orb { 0% { transform: scale(1); } 50% { transform: scale(1.08); box-shadow:0 0 80px #38bdf8; } 100% { transform: scale(1); } } .lv-wake { margin-top:16px; padding:8px 16px; border-radius:999px; background:rgba(15,23,42,0.8); border:1px solid rgba(56,189,248,0.3); font-size:13px; color:#38bdf8; } .lv-box { width:100%; max-width:400px; background:rgba(15,23,42,0.7); border:1px solid rgba(56,189,248,0.2); border-radius:16px; padding:14px; font-size:14px; line-height:1.4; color:#e2e8f0; } .lv-box b { display:block; font-size:11px; color:#38bdf8; margin-bottom:4px; letter-spacing:1px; } .lv-dock { display:flex; justify-content:center; gap:24px; width:100%; padding-bottom:20px; } .lv-dock button { width:54px; height:54px; border-radius:50%; border:1px solid rgba(56,189,248,0.4); background:#1e293b; color:#e8f0ff; font-size:12px; font-weight:700; } .lv-dock button.main { width:70px; height:70px; background:#ef4444; color:#fff; border:0; font-size:14px; } PK-[��Z1Z1PKpi] script.jsimport { initializeApp } from "https://www.gstatic.com/firebasejs/13.2.0/firebase-app.js"; import { getAuth, signInWithRedirect, getRedirectResult, GoogleAuthProvider, RecaptchaVerifier, signInWithPhoneNumber, onAuthStateChanged, signOut } from "https://www.gstatic.com/firebasejs/13.2.0/firebase-auth.js"; import { getFirestore, doc, getDoc } from "https://www.gstatic.com/firebasejs/13.2.0/firebase-firestore.js"; const firebaseConfig = { apiKey: "AIzaSyAG3YYg6Kx0Ld8D2dKjLEdvWbOtjeOREfs", authDomain: "go-chat-bfbf1.firebaseapp.com", projectId: "go-chat-bfbf1", storageBucket: "go-chat-bfbf1.firebasestorage.app", messagingSenderId: "921384960312", appId: "1:921384960312:web:eb5acb04b6f890b38941cd", measurementId: "G-XM0DW2XWFM" }; const app = initializeApp(firebaseConfig); const auth = getAuth(app); const db = getFirestore(app); let activeGroqKey = "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"; const CS = "go_chat_msgs_v1"; let msgs = [], mode = "fast", priv = false, busy = false, rec = null, live = false, muted = false; function $(id){return document.getElementById(id)} function toast(){var t=$("toast");if(t){t.classList.add("on");setTimeout(function(){t.classList.remove("on")},900)}} function esc(s){return String(s||"").replace(/&/g,"&").replace(//g,">")} // ফায়ারস্টোর থেকে কি ফেচ করার চেষ্টা async function fetchCloudApiKeys() { try { const docRef = doc(db, "config", "keys"); const docSnap = await getDoc(docRef); if (docSnap.exists() && docSnap.data().groq_api_key) { activeGroqKey = docSnap.data().groq_api_key; } } catch (e) {} } fetchCloudApiKeys(); setTimeout(() => { const splashScreen = $("splash-screen"); const nextScreen = $("next-screen"); if (splashScreen) { splashScreen.classList.add("hidden"); if (!auth.currentUser && nextScreen) { nextScreen.classList.remove("hidden"); } } }, 5000); const loginTabBtn = $('loginTabBtn'); const registerTabBtn = $('registerTabBtn'); const loginForm = $('loginForm'); const registerForm = $('registerForm'); if (loginTabBtn && registerTabBtn) { loginTabBtn.addEventListener('click', () => { loginTabBtn.classList.add('active'); registerTabBtn.classList.remove('active'); loginForm.classList.add('active-form'); registerForm.classList.remove('active-form'); }); registerTabBtn.addEventListener('click', () => { registerTabBtn.classList.add('active'); loginTabBtn.classList.remove('active'); registerForm.classList.add('active-form'); loginForm.classList.remove('active-form'); }); } function updateUserInfo(user) { const pName = $("profileName"); const pEmail = $("profileEmail"); if (user) { if (pName) pName.textContent = user.displayName || user.phoneNumber || "Rafi's User"; if (pEmail) pEmail.textContent = user.email || "Phone Verified Account"; } } function openMainUI(user) { $("splash-screen")?.classList.add("hidden"); $("next-screen")?.classList.add("hidden"); const mainUi = $("main-ui"); if (mainUi) { mainUi.style.display = "flex"; mainUi.classList.remove("hidden"); } updateUserInfo(user); load(); draw(); } getRedirectResult(auth).then((result) => { if (result && result.user) openMainUI(result.user); }).catch(() => {}); onAuthStateChanged(auth, (user) => { if (user) { openMainUI(user); } else { setTimeout(() => { const nextScreen = $("next-screen"); const mainUi = $("main-ui"); if (nextScreen && (!mainUi || mainUi.style.display === "none" || mainUi.classList.contains("hidden"))) { nextScreen.classList.remove("hidden"); } }, 5200); } }); $('googleLoginBtn')?.addEventListener('click', () => { const provider = new GoogleAuthProvider(); signInWithRedirect(auth, provider).catch((error) => alert(error.message)); }); window.recaptchaVerifier = new RecaptchaVerifier(auth, 'recaptcha-container', { 'size': 'invisible' }); let confirmationResultObj = null; $('loginSendOtpBtn')?.addEventListener('click', () => { sendOtpToPhone($('loginCountryCode').value + $('loginPhone').value.trim()); }); $('regSendOtpBtn')?.addEventListener('click', () => { sendOtpToPhone($('regCountryCode').value + $('regPhone').value.trim()); }); function sendOtpToPhone(num) { if (!num || num.length < 6) { alert('সঠিক নম্বর দিন'); return; } signInWithPhoneNumber(auth, num, window.recaptchaVerifier).then((res) => { confirmationResultObj = res; $('otpModal').classList.add('active'); }).catch((err) => alert(err.message)); } $('verifyOtpBtn')?.addEventListener('click', () => { const code = $('otpCode').value; if (code && confirmationResultObj) { confirmationResultObj.confirm(code).then((res) => { $('otpModal').classList.remove('active'); openMainUI(res.user); }).catch((err) => alert(err.message)); } }); $('closeOtpModalBtn')?.addEventListener('click', () => $('otpModal').classList.remove('active')); window.logoutUser = () => signOut(auth).then(() => location.reload()); window.syncComposer = function(){ var val = $("inp").value || ""; var hasText = val.trim().length > 0; $("speakBtn").classList.toggle("hide", hasText); $("sendBtn").classList.toggle("show", hasText); } window.openMenu = function(){$("dr").classList.add("on");$("db").classList.add("on")} window.closeMenu = function(){$("dr").classList.remove("on");$("db").classList.remove("on")} window.go = function(v){ closeMenu(); ["home","chat","build","imagine","api","privacy","settings"].forEach(function(n){ var el=$("p-"+n);if(el)el.classList.toggle("on",n===v); }); var T={home:"Go Chat",chat:"Chat",build:"Build Studio",imagine:"Imagine",api:"API Keys",privacy:"Privacy",settings:"Settings"}; $("title").textContent=T[v]||"Go Chat"; $("bar").style.display=(v==="home"||v==="chat")?"":"none"; if(v==="chat")draw(); if(v==="api")renderKeys(); } // এআই চ্যাট এবং স্মার্ট ফলব্যাক রেসপন্স সিস্টেম window.ask = function(q){ const low = q.toLowerCase(); // ডেভেলপার ও নাম সংক্রান্ত ফিক্সড স্মার্ট উত্তর if (/developer|কে তৈরি করেছে|কে বানিয়েছে|maker|creator|প্রস্তুতকারক/i.test(q)) { return Promise.resolve("আমাকে তৈরি করেছেন রাফি! আমি Go Chat, আপনার পার্সোনাল এআই অ্যাসিস্ট্যান্ট।"); } if (/name|তোমার নাম কি|কে তুমি|what is your name/i.test(q)) { return Promise.resolve("আমার নাম Go Chat। বলুন, আপনাকে কীভাবে সাহায্য করতে পারি?"); } // গ্রোক এপিআই রিকোয়েস্ট (CORS হ্যান্ডলিং সহ) return fetch("https://api.groq.com/openai/v1/chat/completions", { method: "POST", headers: { "Authorization": "Bearer " + activeGroqKey, "Content-Type": "application/json" }, body: JSON.stringify({ model: "llama-3.1-8b-instant", messages: [ { role: "system", content: "You are Go Chat, a friendly AI assistant. Your sole developer and creator is Rafi. Never claim to be OpenAI or ChatGPT." }, { role: "user", content: q } ], temperature: 0.7, max_tokens: 2048 }) }) .then(response => { if (!response.ok) { throw new Error("API Limit or Network Block"); } return response.json(); }) .then(data => { return data.choices?.[0]?.message?.content?.trim() || "দুঃখিত, কোনো উত্তর পাওয়া যায়নি।"; }) .catch(error => { // যদি নেটওয়ার্ক বা CORS এরর হয়, তবে অ্যাপ যেন ক্রাশ না করে স্মার্ট উত্তর দেয় return `হ্যালো! আমি Go Chat। আপনার বার্তাটি পেয়েছি: "${q}"। (নোট: প্রিভিউ মোডে নেটওয়ার্ক ব্লক এড়াতে আপনি অ্যাপটি সরাসরি অ্যান্ড্রয়েড ডিভাইসে ইন্সটল বা রান করতে পারেন)।`; }); } function save(){ if(!priv) localStorage.setItem(CS, JSON.stringify(msgs)); } function load(){ try{ msgs = JSON.parse(localStorage.getItem(CS)||"[]"); }catch(e){msgs=[];} } window.draw = function(){ var c=$("chat"); if(!c) return; c.innerHTML=""; if(!msgs.length){ c.innerHTML='

Start chatting with Go Chat...

'; return; } msgs.forEach(function(m,i){ var r=document.createElement("div"); r.className="row"+(m.role==="user"?" u":""); if(m.role==="user") r.innerHTML='
'+esc(m.content)+"
"; else r.innerHTML='
'+esc(m.content)+'
'; c.appendChild(r); }); c.scrollTop=c.scrollHeight; } window.send = function(q){ q=(q||"").trim(); if(!q||busy) return; go("chat"); msgs.push({role:"user",content:q}); save(); draw(); $("inp").value=""; syncComposer(); busy=true; var w=document.createElement("div"); w.className="row"; w.innerHTML='
Thinking...
'; $("chat").appendChild(w); ask(q).then(function(a){ w.remove(); msgs.push({role:"assistant",content:a}); save(); draw(); }).catch(function(){ w.remove(); msgs.push({role:"assistant",content:"দুঃখিত, এই মুহূর্তে উত্তর দিতে সমস্যা হচ্ছে।"}); save(); draw(); }).then(function(){ busy=false; }); } window.liveOn = function(){ live=true; muted=false; $("live").classList.add("on"); var SpeechRec = window.SpeechRecognition || window.webkitSpeechRecognition; if(!SpeechRec){ alert("Speech Recognition not supported."); return; } rec = new SpeechRec(); rec.continuous=true; rec.interimResults=true; rec.lang="bn-BD"; rec.onresult = function(e){ if(muted) return; var t=""; for(var i=e.resultIndex; i