Spaces:
Running
Running
Oviya
commited on
Commit
·
becf4e3
1
Parent(s):
678e6ea
update chatbot ui
Browse files- src/app/app-module.ts +3 -2
- src/app/chatbot/chatbot.html +1 -1
- src/app/chatbot/chatbot.scss +12 -3
- src/app/chatbot/chatbot.ts +2 -1
src/app/app-module.ts
CHANGED
|
@@ -15,7 +15,7 @@ import { FormsModule } from '@angular/forms';
|
|
| 15 |
import { MatFormFieldModule } from '@angular/material/form-field'; // Import mat-form-field module
|
| 16 |
import { MatInputModule } from '@angular/material/input';
|
| 17 |
// Import mat-input module
|
| 18 |
-
|
| 19 |
|
| 20 |
@NgModule({
|
| 21 |
declarations: [
|
|
@@ -33,7 +33,8 @@ import { MatInputModule } from '@angular/material/input';
|
|
| 33 |
HttpClientModule,
|
| 34 |
FormsModule,
|
| 35 |
MatFormFieldModule,
|
| 36 |
-
MatInputModule
|
|
|
|
| 37 |
|
| 38 |
//RouterModule.forRoot(routes, {
|
| 39 |
// scrollPositionRestoration: 'enabled',
|
|
|
|
| 15 |
import { MatFormFieldModule } from '@angular/material/form-field'; // Import mat-form-field module
|
| 16 |
import { MatInputModule } from '@angular/material/input';
|
| 17 |
// Import mat-input module
|
| 18 |
+
import { MarkdownModule } from 'ngx-markdown';
|
| 19 |
|
| 20 |
@NgModule({
|
| 21 |
declarations: [
|
|
|
|
| 33 |
HttpClientModule,
|
| 34 |
FormsModule,
|
| 35 |
MatFormFieldModule,
|
| 36 |
+
MatInputModule,
|
| 37 |
+
MarkdownModule.forRoot()
|
| 38 |
|
| 39 |
//RouterModule.forRoot(routes, {
|
| 40 |
// scrollPositionRestoration: 'enabled',
|
src/app/chatbot/chatbot.html
CHANGED
|
@@ -21,7 +21,7 @@
|
|
| 21 |
</div>
|
| 22 |
</ng-container>
|
| 23 |
<ng-template #botText>
|
| 24 |
-
<
|
| 25 |
</ng-template>
|
| 26 |
</div>
|
| 27 |
<div class="avatar">
|
|
|
|
| 21 |
</div>
|
| 22 |
</ng-container>
|
| 23 |
<ng-template #botText>
|
| 24 |
+
<markdown [data]="message.bot"></markdown>
|
| 25 |
</ng-template>
|
| 26 |
</div>
|
| 27 |
<div class="avatar">
|
src/app/chatbot/chatbot.scss
CHANGED
|
@@ -51,6 +51,13 @@
|
|
| 51 |
border-radius: 10px;
|
| 52 |
box-shadow: 0 4px 10px rgba(0,0,0,0.1);
|
| 53 |
width: 50%;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
}
|
| 55 |
|
| 56 |
.user-message .message-content {
|
|
@@ -99,15 +106,17 @@
|
|
| 99 |
}
|
| 100 |
|
| 101 |
.input-box button {
|
| 102 |
-
padding:
|
| 103 |
background-color: #4e8fff;
|
| 104 |
color: #fff;
|
| 105 |
border: none;
|
| 106 |
border-radius: 12px;
|
| 107 |
cursor: pointer;
|
| 108 |
-
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
|
| 109 |
transition: background-color 0.3s ease;
|
| 110 |
-
font-family:
|
|
|
|
|
|
|
| 111 |
}
|
| 112 |
|
| 113 |
.input-box button:hover {
|
|
|
|
| 51 |
border-radius: 10px;
|
| 52 |
box-shadow: 0 4px 10px rgba(0,0,0,0.1);
|
| 53 |
width: 50%;
|
| 54 |
+
|
| 55 |
+
markdown {
|
| 56 |
+
font-family: 'Roboto', sans-serif;
|
| 57 |
+
color: #333;
|
| 58 |
+
font-size: 1vw;
|
| 59 |
+
line-height: 1.5;
|
| 60 |
+
}
|
| 61 |
}
|
| 62 |
|
| 63 |
.user-message .message-content {
|
|
|
|
| 106 |
}
|
| 107 |
|
| 108 |
.input-box button {
|
| 109 |
+
padding: 1vw;
|
| 110 |
background-color: #4e8fff;
|
| 111 |
color: #fff;
|
| 112 |
border: none;
|
| 113 |
border-radius: 12px;
|
| 114 |
cursor: pointer;
|
| 115 |
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
| 116 |
transition: background-color 0.3s ease;
|
| 117 |
+
font-family: "Roboto", sans-serif;
|
| 118 |
+
font-weight: bold;
|
| 119 |
+
font-size: 1vw;
|
| 120 |
}
|
| 121 |
|
| 122 |
.input-box button:hover {
|
src/app/chatbot/chatbot.ts
CHANGED
|
@@ -4,13 +4,14 @@ import { CommonModule } from '@angular/common';
|
|
| 4 |
import { HttpClientModule } from '@angular/common/http';
|
| 5 |
import { FormsModule } from '@angular/forms';
|
| 6 |
import { ChatBotService } from './chatbot.service';
|
|
|
|
| 7 |
|
| 8 |
type ChatPair = { user: string; bot: string | null };
|
| 9 |
|
| 10 |
@Component({
|
| 11 |
selector: 'app-chatbot',
|
| 12 |
standalone: true,
|
| 13 |
-
imports: [CommonModule, HttpClientModule, FormsModule],
|
| 14 |
templateUrl: './chatbot.html',
|
| 15 |
styleUrls: ['./chatbot.scss'],
|
| 16 |
})
|
|
|
|
| 4 |
import { HttpClientModule } from '@angular/common/http';
|
| 5 |
import { FormsModule } from '@angular/forms';
|
| 6 |
import { ChatBotService } from './chatbot.service';
|
| 7 |
+
import { MarkdownModule } from 'ngx-markdown';
|
| 8 |
|
| 9 |
type ChatPair = { user: string; bot: string | null };
|
| 10 |
|
| 11 |
@Component({
|
| 12 |
selector: 'app-chatbot',
|
| 13 |
standalone: true,
|
| 14 |
+
imports: [CommonModule, HttpClientModule, FormsModule, MarkdownModule],
|
| 15 |
templateUrl: './chatbot.html',
|
| 16 |
styleUrls: ['./chatbot.scss'],
|
| 17 |
})
|