31
31
.chatbot {
32
32
display : none;
33
33
position : fixed;
34
- bottom : 7 % ;
34
+ bottom : 3 % ;
35
35
right : 1% ;
36
36
max-width : 400px ;
37
37
width : 100% ;
38
38
background-color : white;
39
39
border-radius : 12px ;
40
40
box-shadow : 0 4px 15px rgba (0 , 0 , 0 , 0.1 );
41
- height : 450px ;
42
- /* Fixed height */
41
+ height : 500px ;
42
+
43
+ @media (max-width : 768px ) {
44
+ right : 50% ;
45
+ transform : translateX (50% );
46
+ max-width : 95% ;
47
+ }
48
+
43
49
}
44
50
45
51
.chat-icon {
46
52
position : fixed;
47
- bottom : 4 % ;
48
- right : 4 % ;
53
+ bottom : 3 % ;
54
+ right : 2 % ;
49
55
background-color : rgb (209 , 16 , 16 );
56
+ transition : opacity 0.2s ;
57
+ & : hover {
58
+ opacity : 0.8 ;
59
+ }
50
60
/* Red color */
51
61
border-radius : 50% ;
52
- width : 50px ;
53
- height : 50px ;
62
+ padding : 10px ;
63
+ width : 55px ;
64
+ height : 55px ;
54
65
display : flex;
55
66
align-items : center;
56
67
justify-content : center;
68
79
}
69
80
70
81
.chat-log {
71
- max-height : 320 px ;
82
+ max-height : 295 px ;
72
83
/* Adjusted height */
73
84
overflow-y : auto;
74
- height : 320 px ;
85
+ height : 295 px ;
75
86
/* Fixed height */
76
87
}
77
88
78
89
.loading {
79
90
display : none;
80
- position : fixed;
91
+ {% comment %} position : fixed;
81
92
bottom : 100px ;
82
- right : 10.5% ;
93
+ right : 10.5% ;{% endcomment %}
83
94
justify- content: center;
84
95
align- items: center;
85
- padding : 10px ;
96
+ font- size: 2xl;
97
+ padding: 10px;
86
98
background- color : # ffffffe6 ;
87
99
/* Semi-transparent background */
88
- border-radius : 12px ;
89
- box-shadow : 0 4px 15px rgba (0 , 0 , 0 , 0.1 );
100
+ bor der- radius: 8px;
90
101
}
91
102
92
103
.chat-Zindex {
393
404
< div id ="chatbot " class ="chatbot ">
394
405
< div class ="chat-header flex justify-between items-center ">
395
406
< h3 class ="text-xl font-extrabold "> Chat with BLT Bot</ h3 >
396
- < button id ="closeChatbot " class ="text-white text-2xl "> × </ button >
407
+ < button id ="closeChatbot " class ="text-white text-2xl "> x </ button >
397
408
</ div >
398
409
< div class ="p-4 ">
399
410
< div class ="bg-red-100 p-3 rounded-lg mb-2 text-red-700 ">
400
- < p class ="text-base "> We reply immediately</ p >
411
+ < p class ="text-base "> We respond instantly!</ p >
412
+ </ div >
413
+ < div id ="chat-log " class =" relative chat-log bg-gray-100 p-3 rounded-lg ">
414
+ < div id ="loading " class ="loading absolute bottom-1 left-1 ">
415
+ < svg class ="animate-spin h-5 w-5 text-red-600 "
416
+ xmlns ="http://www.w3.org/2000/svg "
417
+ fill ="none "
418
+ viewBox ="0 0 24 24 ">
419
+ < circle class ="opacity-25 " cx ="12 " cy ="12 " r ="10 " stroke ="currentColor " stroke-width ="4 "> </ circle >
420
+ < path class ="opacity-75 " fill ="currentColor " d ="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z ">
421
+ </ path >
422
+ </ svg >
423
+ < span class ="ml-2 text-gray-600 "> Loading...</ span >
424
+ </ div >
401
425
</ div >
402
- < div id =" chat-log " class =" chat-log bg-gray-50 p-3 rounded-lg " > </ div >
403
- < div class =" flex " id ="chat-message-input-container ">
426
+ < div class =" flex flex-row gap-4 items-center mt-4 w-full "
427
+ id ="chat-message-input-container ">
404
428
< input id ="chat-message-input "
405
429
type ="text "
406
- class ="flex-grow p-2 border border-gray-300 rounded-l -lg "
430
+ class ="w-full p-2 border-2 border-gray-300 placeholder:text-base rounded -lg "
407
431
placeholder ="Enter your message... ">
408
- < button id ="chat-message-submit "
409
- class ="bg-red-600 text-white p-2 rounded-md ml-2 "> Send</ button >
410
- < button id ="chat-message-clear "
411
- class ="bg-gray-300 text-black p-2 rounded-md ml-2 "> Clear</ button >
432
+ < div class ="flex flex-row gap-2 items-center shrink-0 ">
433
+ < button id ="chat-message-submit "
434
+ class ="bg-red-600 hover:bg-red-500 text-white p-2 rounded-lg "> Send</ button >
435
+ < button id ="chat-message-clear "
436
+ class ="bg-gray-300 hover:bg-gray-200 text-black p-2 rounded-lg "> Clear</ button >
437
+ </ div >
412
438
</ div >
413
439
</ div >
414
440
</ div >
415
- < div id ="loading " class ="loading ">
416
- < svg class ="animate-spin h-5 w-5 text-red-600 "
417
- xmlns ="http://www.w3.org/2000/svg "
418
- fill ="none "
419
- viewBox ="0 0 24 24 ">
420
- < circle class ="opacity-25 " cx ="12 " cy ="12 " r ="10 " stroke ="currentColor " stroke-width ="4 "> </ circle >
421
- < path class ="opacity-75 " fill ="currentColor " d ="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z ">
422
- </ path >
423
- </ svg >
424
- < span class ="ml-2 text-gray-600 "> Loading...</ span >
425
- </ div >
426
441
< div id ="chatIcon " class ="chat-icon ">
427
442
< svg class ="w-10 h-10 text-white "
428
443
aria-hidden ="true "
@@ -551,13 +566,13 @@ <h3 class="text-xl font-extrabold">Chat with BLT Bot</h3>
551
566
'/report <description> - Report a bug<br>' +
552
567
'/gsoc - Get GSoC info<br>' +
553
568
'/stats - View platform stats<br>'
554
- chatLog . innerHTML += '<div class="bg-gray-100 text-gray-800 p-2 rounded-lg mb-2">Bot: ' + response + '</div>' ;
555
- chatLog . scrollTop = chatLog . scrollHeight ;
569
+ chatLog . innerHTML += '<div class="bg-blue-300 text-black p-2 rounded-lg mb-2">Bot - ' + escapedAnswer + '</div>' ;
570
+ chatLog . scrollTop = chatLog . scrollHeight ;
556
571
return true ;
557
572
case '/report' :
558
573
if ( ! args ) {
559
574
response = 'Please provide a description. Usage: /report <description>' ;
560
- chatLog . innerHTML += '<div class="bg-gray-100 text-gray-800 p-2 rounded-lg mb-2">Bot: ' + response + '</div>' ;
575
+ chatLog . innerHTML += '<div class="bg-blue-300 text-black p-2 rounded-lg mb-2">Bot - ' + escapedAnswer + '</div>' ;
561
576
chatLog . scrollTop = chatLog . scrollHeight ;
562
577
return true ;
563
578
}
@@ -568,12 +583,12 @@ <h3 class="text-xl font-extrabold">Chat with BLT Bot</h3>
568
583
'Explore OWASP’s GSoC participation:<br>' +
569
584
'- Current projects: <a href="https://owasp.org/www-community/initiatives/gsoc/gsoc2025ideas">GSoC 2025 Ideas</a><br>' +
570
585
'Get involved with open-source at OWASP!' ;
571
- chatLog . innerHTML += '<div class="bg-gray-100 text-gray-800 p-2 rounded-lg mb-2">Bot: ' + response + '</div>' ;
572
- chatLog . scrollTop = chatLog . scrollHeight ;
586
+ chatLog . innerHTML += '<div class="bg-blue-300 text-black p-2 rounded-lg mb-2">Bot - ' + escapedAnswer + '</div>' ;
587
+ chatLog . scrollTop = chatLog . scrollHeight ;
573
588
return true ;
574
589
case '/stats' :
575
590
response = 'Platform stats are not directly available via the bot yet. Please check the website dashboard or ask an admin for detailed statistics.' ;
576
- chatLog . innerHTML += '<div class="bg-gray-100 text-gray-800 p-2 rounded-lg mb-2">Bot: ' + response + '</div>' ;
591
+ chatLog . innerHTML += '<div class="bg-blue-300 text-black p-2 rounded-lg mb-2">Bot - ' + escapedAnswer + '</div>' ;
577
592
chatLog . scrollTop = chatLog . scrollHeight ;
578
593
return true ;
579
594
default :
@@ -587,7 +602,7 @@ <h3 class="text-xl font-extrabold">Chat with BLT Bot</h3>
587
602
if ( message === "" ) return ;
588
603
589
604
const escapedMessage = escapeHtml ( message ) ;
590
- chatLog . innerHTML += '<div class="bg-red-100 text-red-800 p-2 rounded-lg mb-2">You: ' + escapedMessage + '</div>' ;
605
+ chatLog . innerHTML += '<div class="bg-green-300 text-black p-2 rounded-lg mb-2"> You - ' + escapedMessage + '</div>' ;
591
606
loading . style . display = 'flex' ;
592
607
593
608
// Check for slash command
@@ -618,7 +633,7 @@ <h3 class="text-xl font-extrabold">Chat with BLT Bot</h3>
618
633
} )
619
634
. then ( data => {
620
635
const escapedAnswer = escapeHtml ( data . answer ) ;
621
- chatLog . innerHTML += '<div class="bg-gray-100 text-gray-800 p-2 rounded-lg mb-2">Bot: ' + escapedAnswer + '</div>' ;
636
+ chatLog . innerHTML += '<div class="bg-blue-300 text-black p-2 rounded-lg mb-2">Bot - ' + escapedAnswer + '</div>' ;
622
637
chatLog . scrollTop = chatLog . scrollHeight ;
623
638
loading . style . display = 'none' ;
624
639
} )
@@ -627,7 +642,7 @@ <h3 class="text-xl font-extrabold">Chat with BLT Bot</h3>
627
642
if ( error . message === 'Rate limit exceeded' ) {
628
643
errorMessage = 'The request limit has been reached. Please try again later.' ;
629
644
}
630
- chatLog . innerHTML += '<div class="bg-gray-100 text-gray-800 p-2 rounded-lg mb-2">Bot: ' + errorMessage + '</div>' ;
645
+ chatLog . innerHTML += '<div class="bg-red-300 text-black p-2 rounded-lg mb-2">Bot - ' + errorMessage + '</div>' ;
631
646
chatLog . scrollTop = chatLog . scrollHeight ;
632
647
loading . style . display = 'none' ;
633
648
} ) ;
0 commit comments