Skip to content

ChatGPT #288

@qqvsk7bmnq-dotcom

Description

@qqvsk7bmnq-dotcom
<title>Mini Chatbot</title> <style> body { font-family: Arial; background-color: #111; color: white; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; } #chatbox { width: 300px; height: 300px; border: 2px solid #444; padding: 10px; overflow-y: auto; background-color: #222; } input { width: 280px; margin-top: 10px; padding: 5px; border: none; outline: none; } </style>
<script> function sendMessage() { const input = document.getElementById('userInput'); const chatbox = document.getElementById('chatbox'); const userText = input.value.trim(); if (userText === '') return; chatbox.innerHTML += `

You: ${userText}

`; input.value = ''; // Simple chatbot responses let botReply = ''; if (userText.toLowerCase().includes('hello')) { botReply = 'Hey there!'; } else if (userText.toLowerCase().includes('how are you')) { botReply = 'I’m just code, but I’m vibing!'; } else if (userText.toLowerCase().includes('bye')) { botReply = 'Later 👋'; } else { botReply = 'I don’t know that one yet 😅'; } chatbox.innerHTML += `

Bot: ${botReply}

`; chatbox.scrollTop = chatbox.scrollHeight; } </script>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions