diff --git a/styles.css b/styles.css index 40350270..08651155 100644 --- a/styles.css +++ b/styles.css @@ -696,3 +696,5 @@ a { background-color: skyblue; } + } +} \ No newline at end of file diff --git a/submit-challenge/index.html b/submit-challenge/index.html index 9a85ebe8..bc852f20 100644 --- a/submit-challenge/index.html +++ b/submit-challenge/index.html @@ -50,7 +50,19 @@

Submit New Coding Challenge

- + + + +
+
+
Hi! I'm your chatbot. Ask me anything!
+
+
+ + +
+
+ diff --git a/submit-challenge/script.js b/submit-challenge/script.js index 30e734d9..55773076 100644 --- a/submit-challenge/script.js +++ b/submit-challenge/script.js @@ -32,4 +32,29 @@ form.addEventListener('submit', (e) => {

Test Cases:

Sample Solution:

${solution}

`; -}); + }); + + function sendMessage() { + const input = document.getElementById("user-input"); + const message = input.value.trim(); + if (!message) return; + + appendMessage("user", message); + input.value = ""; + + // Simulate AI reply (you can replace this with API call) + setTimeout(() => { + const botReply = "You said: " + message; + appendMessage("bot", botReply); + }, 500); + } + + function appendMessage(sender, text) { + const chatBox = document.getElementById("chat-box"); + const msg = document.createElement("div"); + msg.className = "chat-message " + sender; + msg.textContent = text; + chatBox.appendChild(msg); + chatBox.scrollTop = chatBox.scrollHeight; + } + diff --git a/submit-challenge/styles.css b/submit-challenge/styles.css index 4f9e5382..65ede161 100644 --- a/submit-challenge/styles.css +++ b/submit-challenge/styles.css @@ -367,3 +367,48 @@ input:focus, textarea:focus, select:focus, button:focus { 0% { transform: translate(-50%, -50%) rotate(0deg); } 100% { transform: translate(-50%, -50%) rotate(360deg); } } + +.chat-container { + width: 400px; + /* margin: 50px auto; */ + position: fixed; + bottom: 20px; + right: 20px; + background: white; + border-radius: 10px; + box-shadow: 0 0 10px rgba(0,0,0,0.1); + overflow: hidden; + } + .chat-box { + max-height: 400px; + overflow-y: auto; + padding: 20px; + border-bottom: 1px solid #ccc; + } + .chat-message { + margin-bottom: 10px; + } + .chat-message.user { + text-align: right; + color: #059669; + } + .chat-message.bot { + text-align: left; + color: #059669; + } + .input-box { + display: flex; + padding: 10px; + } + .input-box input { + flex: 1; + padding: 10px; + font-size: 16px; + } + .input-box button { + padding: 10px 20px; + background: #059669; + color: white; + border: none; + cursor: pointer; + }