aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/ChatBox/ChatBox.scss
blob: 75171fe562e1e9258f88de3e9d474fdda8e1f691 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
$background-color: #f8f9fa;
$text-color: #333;
$input-background: #fff;
$button-color: #007bff;
$button-hover-color: darken($button-color, 10%);
$shadow-color: rgba(0, 0, 0, 0.075);
$border-radius: 8px;
$citation-color: #ff6347;
$citation-hover-color: darken($citation-color, 10%);
$follow-up-bg-color: #e9ecef;
$follow-up-hover-bg-color: #dee2e6;

.chatBox {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background-color: $background-color;
    font-family: 'Helvetica Neue', Arial, sans-serif;

    .scroll-box {
        flex-grow: 1;
        overflow-y: scroll;
        overflow-x: hidden;
        height: 100%;
        padding: 10px;
        display: flex;
        flex-direction: column-reverse;
        padding-bottom: 0;

        &::-webkit-scrollbar {
            width: 8px;
        }
        &::-webkit-scrollbar-thumb {
            background-color: darken($background-color, 10%);
            border-radius: $border-radius;
        }

        .chat-content {
            display: flex;
            flex-direction: column;
        }

        .messages {
            display: flex;
            flex-direction: column;

            .message {
                padding: 10px 15px;
                margin-bottom: 10px;
                border-radius: $border-radius;
                background-color: lighten($background-color, 5%);
                box-shadow: 0 2px 5px $shadow-color;
                align-items: flex-start;
                max-width: 90%;
                width: fit-content;
                word-break: break-word;
                position: relative;

                .citation-button {
                    background-color: $citation-color;
                    color: #fff;
                    border: none;
                    border-radius: 50%;
                    cursor: pointer;
                    width: 20px;
                    height: 20px;
                    display: inline-flex;
                    align-items: center;
                    justify-content: center;
                    font-size: 12px;
                    font-weight: bold;
                    margin: 0 2px;
                    padding: 0;
                    transition: background-color 0.3s;

                    &:hover {
                        background-color: $citation-hover-color;
                    }
                }

                &.user {
                    align-self: flex-end;
                    background-color: $button-color;
                    color: #fff;
                }

                &.chatbot {
                    align-self: flex-start;
                    background-color: $input-background;
                    color: $text-color;
                }

                span {
                    flex-grow: 1;
                    padding-right: 10px;
                }

                img {
                    max-width: 50px;
                    max-height: 50px;
                    border-radius: 50%;
                }
            }

            .follow-up-questions {
                margin-top: 10px;
                width: 100%;

                h4 {
                    margin-bottom: 5px;
                    font-size: 14px;
                }

                .follow-up-button {
                    background-color: $follow-up-bg-color;
                    border: 1px solid #ddd;
                    border-radius: 8px;
                    padding: 8px 10px;
                    margin: 4px 0;
                    cursor: pointer;
                    transition: background-color 0.3s;
                    display: block;
                    width: 100%;
                    text-align: left;
                    white-space: normal;
                    word-wrap: break-word;
                    font-size: 12px;
                    color: $text-color;
                    min-height: 40px;
                    height: auto;
                    line-height: 1.3;

                    &:hover {
                        background-color: $follow-up-hover-bg-color;
                    }
                }
            }
        }
    }

    .chat-form {
        display: flex;
        flex-grow: 0;
        bottom: 0;
        width: 100%;
        padding: 10px;
        background-color: $input-background;
        box-shadow: inset 0 -1px 2px $shadow-color;
        margin-bottom: 0;

        input[type='text'] {
            flex-grow: 1;
            border: 1px solid darken($input-background, 10%);
            border-radius: $border-radius;
            padding: 8px 12px;
            margin-right: 10px;
        }

        button {
            padding: 8px 16px;
            background-color: $button-color;
            color: #fff;
            border: none;
            border-radius: $border-radius;
            cursor: pointer;
            transition: background-color 0.3s;
            min-width: 80px;

            &:hover {
                background-color: $button-hover-color;
            }
        }
    }
}

.initializing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba($background-color, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5em;
    color: $text-color;
    z-index: 10;

    &::before {
        content: 'Initializing...';
        font-weight: bold;
    }
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.4);

    .modal-content {
        background-color: $input-background;
        color: $text-color;
        padding: 20px;
        border-radius: $border-radius;
        box-shadow: 0 2px 10px $shadow-color;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: auto;
        min-width: 300px;

        h4 {
            margin-bottom: 15px;
        }

        p {
            margin-bottom: 20px;
        }

        button {
            padding: 10px 20px;
            background-color: $button-color;
            color: #fff;
            border: none;
            border-radius: $border-radius;
            cursor: pointer;
            transition: background-color 0.3s;

            &:hover {
                background-color: $button-hover-color;
            }
        }
    }
}