Skip to content

ARORA288/abseil-cpp

 
 

Repository files navigation

<title>Global Chatroom</title> <style> body { font-family: Arial, sans-serif; background: #0f172a; color: white; margin: 0; padding: 0; } .container { max-width: 500px; margin: 60px auto; background: #020617; padding: 20px; border-radius: 10px; box-shadow: 0 0 15px rgba(0,0,0,0.5); } h2 { text-align: center; } input, button { width: 100%; padding: 10px; margin-top: 10px; border-radius: 5px; border: none; font-size: 16px; } button { background: #2563eb; color: white; cursor: pointer; } button:hover { background: #1d4ed8; } #chat { display: none; } #messages { height: 300px; overflow-y: auto; background: #020617; border: 1px solid #1e293b; padding: 10px; margin-bottom: 10px; } .msg { margin-bottom: 6px; } .user { color: #38bdf8; font-weight: bold; } .ai { color: #22c55e; font-weight: bold; } </style>

Enter Chatroom

Enter

🌍 Global Chatroom

Send
<script> const PASSWORD = "1234"; let username = ""; /* ENTER CHAT */ function enterChat(){ const pass = password.value; const user = usernameInput = document.getElementById("username").value.trim(); const x = Number(document.getElementById("xvalue").value); if(pass !== PASSWORD){ alert("Wrong password"); return; } if(!user){ alert("Username required"); return; } if(x < 1 || x > 10){ alert("X must be between 1 and 10"); return; } username = user; login.style.display = "none"; chat.style.display = "block"; addMessage("System","Welcome "+username); addMessage("Arora","I am Arora, your offline AI assistant."); } /* SEND MESSAGE */ function sendMessage(){ const input = document.getElementById("messageInput"); const text = input.value.trim(); if(!text) return; addMessage(username, text); input.value = ""; setTimeout(()=>aroraReply(text.toLowerCase()),300); } /* ADD MESSAGE */ function addMessage(user,text){ const div = document.createElement("div"); div.className = "msg"; div.innerHTML = `${user}: ${text}`; messages.appendChild(div); messages.scrollTop = messages.scrollHeight; } /* OFFLINE AI */ function aroraReply(m){ let r = "I am listening."; if(m.includes("who") && m.includes("you")) r = "I am Arora, an offline artificial intelligence."; else if(m.includes("hello") || m.includes("hi")) r = "Hello 👋"; else if(m.includes("why")) r = "Because this system follows simple logic."; else if(m.includes("how")) r = "Explain your question clearly."; else if(m.includes("ai")) r = "AI means Artificial Intelligence."; else if(m.includes("language")) r = "I understand basic English commands."; addMessage("Arora", r); } </script> <script> const PASSWORD = "1234"; let username = ""; let lastTopic = ""; function enterChat(){ const pass = password.value; const user = document.getElementById("username").value.trim(); const x = Number(document.getElementById("xvalue").value); if(pass !== PASSWORD) return alert("Wrong password"); if(!user) return alert("Username required"); if(x < 1 || x > 10) return alert("X must be 1–10"); username = user; login.style.display = "none"; chat.style.display = "block"; addMessage("System","Welcome "+username); addMessage("Arora", "Hi 👋 I’m Arora. I work like Meta Chat AI, but offline. Ask me anything."); } function sendMessage(){ const input = messageInput; const text = input.value.trim(); if(!text) return; addMessage(username,text); input.value=""; setTimeout(()=>aroraReply(text.toLowerCase()),400); } function addMessage(user,text){ const div=document.createElement("div"); div.className="msg"; div.innerHTML= `${user}: ${text}`; messages.appendChild(div); messages.scrollTop=messages.scrollHeight; } function aroraReply(m){ let r="That’s interesting. Tell me more."; if(m.includes("who are you")){ r="I’m Arora, a chat AI similar in behavior to Meta AI. I answer, explain, and help."; } else if(m.includes("what can you do")){ r="I can chat, explain concepts, answer questions, and keep conversation flowing."; } else if(m.includes("ai")){ r="AI means Artificial Intelligence — machines designed to think and respond like humans."; lastTopic="ai"; } else if(m.includes("why")){ r="Good question. The reason depends on context — explain more."; } else if(m.includes("how")){ r="I’ll explain it step by step. What exactly do you want to know?"; } else if(m.includes("hello")||m.includes("hi")){ r="Hey 👋 How can I help you today?"; } else if(lastTopic==="ai"){ r="Since we were talking about AI, remember it learns from data and logic."; } addMessage("Arora",r); } </script> <script> let history = [ { role: "system", content: "You are ChatGPT-like AI." } ]; async function sendMessage(text){ history.push({ role:"user", content:text }); const res = await fetch("/chat", { method:"POST", headers:{ "Content-Type":"application/json" }, body: JSON.stringify({ messages: history }) }); const reply = await res.json(); history.push(reply); addMessage("AI", reply.content); } </script>

About

Abseil Common Libraries (C++)

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 91.7%
  • Starlark 2.5%
  • CMake 2.1%
  • NASL 2.1%
  • C 0.8%
  • Shell 0.4%
  • Other 0.4%