fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // your code goes here
  13. }
  14. }
Success #stdin #stdout 0.07s 54580KB
stdin
<!DOCTYPE html>
<html lang="th">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Anon AI</title>

<style>
*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    font-family:Arial, sans-serif;
    background:#0f172a;
    color:white;
    height:100vh;
    display:flex;
}

.sidebar{
    width:260px;
    background:#111827;
    padding:20px;
    border-right:1px solid #334155;
}

.logo{
    font-size:28px;
    font-weight:bold;
    margin-bottom:30px;
    color:#60a5fa;
}

.menu button{
    width:100%;
    padding:12px;
    margin-bottom:10px;
    border:none;
    border-radius:8px;
    background:#1e293b;
    color:white;
    cursor:pointer;
}

.menu button:hover{
    background:#334155;
}

.main{
    flex:1;
    display:flex;
    flex-direction:column;
}

.header{
    padding:20px;
    border-bottom:1px solid #334155;
    font-size:20px;
}

.chat-area{
    flex:1;
    overflow-y:auto;
    padding:20px;
}

.message{
    max-width:70%;
    padding:15px;
    margin-bottom:15px;
    border-radius:12px;
}

.user{
    background:#2563eb;
    margin-left:auto;
}

.ai{
    background:#1e293b;
}

.input-area{
    padding:20px;
    border-top:1px solid #334155;
    display:flex;
    gap:10px;
}

.input-area input{
    flex:1;
    padding:15px;
    border:none;
    border-radius:10px;
    background:#1e293b;
    color:white;
}

.input-area button{
    padding:15px 25px;
    border:none;
    border-radius:10px;
    background:#3b82f6;
    color:white;
    cursor:pointer;
}

.input-area button:hover{
    background:#2563eb;
}
</style>

</head>
<body>

<div class="sidebar">
    <div class="logo">Anon AI</div>

    <div class="menu">
        <button>➕ แชตใหม่</button>
        <button>📚 ประวัติการสนทนา</button>
        <button>⚙️ ตั้งค่า</button>
        <button>👤 โปรไฟล์</button>
    </div>
</div>

<div class="main">

    <div class="header">
        Anon AI Assistant
    </div>

    <div class="chat-area" id="chatArea">

        <div class="message ai">
            สวัสดีครับ ผมคือ Anon AI มีอะไรให้ช่วยไหม?
        </div>

    </div>

    <div class="input-area">
        <input
            type="text"
            id="userInput"
            placeholder="พิมพ์ข้อความ..."
        >

        <button onclick="sendMessage()">
            ส่ง
        </button>
    </div>

</div>

<script>

function sendMessage(){

    let input = document.getElementById("userInput");
    let text = input.value.trim();

    if(text === "") return;

    let chat = document.getElementById("chatArea");

    let userMsg = document.createElement("div");
    userMsg.className = "message user";
    userMsg.innerText = text;
    chat.appendChild(userMsg);

    let aiMsg = document.createElement("div");
    aiMsg.className = "message ai";
    aiMsg.innerText = "กำลังคิด...";
    chat.appendChild(aiMsg);

    setTimeout(()=>{
        aiMsg.innerText =
        "นี่คือคำตอบตัวอย่างจาก Anon AI: " + text;
    },1000);

    input.value = "";

    chat.scrollTop = chat.scrollHeight;
}

</script>

</body>
</html>
stdout
Standard output is empty