From a3912157d3a939bb9b83b1f1a557038686aff792 Mon Sep 17 00:00:00 2001 From: nagendra Date: Sat, 2 Dec 2023 21:11:07 +0530 Subject: [PATCH] documentation written and restart fixed --- chat.css | 50 +++++++++++++++++++++++++++++--------------------- chat.html | 42 ++++++++++++++++++++++++++++++++++++++---- chat.js | 3 ++- chat.ts | 3 ++- 4 files changed, 71 insertions(+), 27 deletions(-) diff --git a/chat.css b/chat.css index dedbe92..bc2c314 100644 --- a/chat.css +++ b/chat.css @@ -1,48 +1,56 @@ - #chat{ - width:50%; - margin:auto; - border:2px solid green; - list-style-type: none; - position: relative; - } + /* It descirbes the welcome msg say hi i am your assitant */ .initial{ font-weight: bold; + list-style-type:none; + text-transform: capitalize; } + + /* It describes the container of client chat or right side chat */ .client{ display: flex; justify-content: end; } + + /* This below describes the chat of client or right side chat */ .clientchat{ - border:1px solid red; - color:green + border:1px solid darkcyan; + color:green; + max-width:50%; + } .clientchat:hover{ - background-color:rgb(70, 176, 70); - color:white; - } - .botchat:hover{ - background-color: rgb(180, 89, 89); + background-color:rgb(123, 94, 228); color:white; } + + /* It describes the container of bot chat or left side chat */ + .bot{ - display: inline-block; - max-width:50%; - - } + display: inline-block; + max-width:50%; + } + /* This below describes the chat of client or right side chat */ + .botchat{ border:1px solid gray; } -.clientchat{ - max-width:50%; -} + + .botchat:hover{ + background-color: rgb(172, 89, 180); + color:white; + } + + /* This describes the common properties of both client and bot chat */ .botchat,.clientchat{ padding:5px; border-radius:1px 10px 10px 10px; cursor: pointer; margin:2px; + list-style-type:none; + } diff --git a/chat.html b/chat.html index 15e50a0..8531144 100644 --- a/chat.html +++ b/chat.html @@ -3,16 +3,24 @@ 'title her' - + +
- + diff --git a/chat.js b/chat.js index 29e882c..bff24ab 100644 --- a/chat.js +++ b/chat.js @@ -23,6 +23,7 @@ var Chatbot = /** @class */ (function () { this.chat = __assign(__assign({}, this.chat), chat); console.log(chat); this.containerRef = container; + this.containerRef.style.position = "relative"; } Chatbot.prototype.initialise = function () { var x = document.createElement("li"); @@ -65,7 +66,7 @@ var Chatbot = /** @class */ (function () { Chatbot.prototype.finalise = function () { var x = document.createElement("div"); x.setAttribute("class", "bot"); - x.innerHTML = "
  • Restart
  • ").concat(this.chat.redirectMsg, "
  • "); + x.innerHTML = "
  • Restart
  • ").concat(this.chat.redirectMsg, "
  • "); this.containerRef.appendChild(x); }; ; diff --git a/chat.ts b/chat.ts index d1e436c..0cad80d 100644 --- a/chat.ts +++ b/chat.ts @@ -17,6 +17,7 @@ class Chatbot{ this.chat={...this.chat,...chat}; console.log(chat); this.containerRef=container; + this.containerRef.style.position="relative"; } initialise(){ @@ -60,7 +61,7 @@ class Chatbot{ finalise(){ let x=document.createElement("div"); x.setAttribute("class","bot"); - x.innerHTML=`
  • Restart
  • ${this.chat.redirectMsg}
  • `; + x.innerHTML=`
  • Restart
  • ${this.chat.redirectMsg}
  • `; this.containerRef.appendChild(x); }; feedback(){