Preview:
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <title>OpenCharacter AI</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background: #0f172a;
      color: #e5e7eb;
      margin: 0;
      padding: 0;
    }
    header {
      background: #020617;
      padding: 20px;
      text-align: center;
    }
    header h1 {
      margin: 0;
      font-size: 28px;
    }
    header p {
      color: #94a3b8;
      margin-top: 8px;
    }
    .container {
      max-width: 900px;
      margin: 30px auto;
      padding: 20px;
    }
    .chat-box {
      background: #020617;
      border-radius: 10px;
      padding: 20px;
      height: 350px;
      overflow-y: auto;
      margin-bottom: 15px;
    }
    .message {
      margin-bottom: 12px;
    }
    .user {
      text-align: right;
      color: #38bdf8;
    }
    .ai {
      text-align: left;
      color: #a7f3d0;
    }
    .input-area {
      display: flex;
      gap: 10px;
    }
    input {
      flex: 1;
      padding: 12px;
      border-radius: 6px;
      border: none;
      outline: none;
    }
    button {
      padding: 12px 18px;
      background: #38bdf8;
      border: none;
      border-radius: 6px;
      cursor: pointer;
      font-weight: bold;
    }
    button:hover {
      background: #0ea5e9;
    }
    footer {
      text-align: center;
      padding: 20px;
      color: #64748b;
      font-size: 14px;
    }
  </style>
</head>
<body>

<header>
  <h1>OpenCharacter AI</h1>
  <p>Create and chat with custom AI characters</p>
</header>

<div class="container">
  <div class="chat-box" id="chatBox">
    <div class="message ai">Hello! I’m your AI character. How can I talk with you today?</div>
  </div>

  <div class="input-area">
    <input type="text" id="userInput" placeholder="Type your message..." />
    <button onclick="sendMessage()">Send</button>
  </div>
</div>

<footer>
  © OpenCharacter AI — Interactive AI Characters for Chat & Creativity
</footer>

<script>
  function sendMessage() {
    const input = document.getElementById("userInput");
    const chatBox = document.getElementById("chatBox");

    if (input.value.trim() === "") return;

    const userMessage = document.createElement("div");
    userMessage.className = "message user";
    userMessage.innerText = input.value;
    chatBox.appendChild(userMessage);

    const aiMessage = document.createElement("div");
    aiMessage.className = "message ai";
    aiMessage.innerText = "I’m listening. Tell me more.";
    chatBox.appendChild(aiMessage);

    input.value = "";
    chatBox.scrollTop = chatBox.scrollHeight;
  }
</script>

</body>
</html>
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter