Skip to content

Commit e11ef09

Browse files
Fix linting issues in header.html (#3720)
Co-authored-by: DonnieBLT <128622481+DonnieBLT@users.noreply.github.com>
1 parent 6807f59 commit e11ef09

File tree

2 files changed

+58
-43
lines changed

2 files changed

+58
-43
lines changed

entrypoint.sh

100644100755
File mode changed.

website/templates/includes/header.html

Lines changed: 58 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,37 @@
3131
.chatbot {
3232
display: none;
3333
position: fixed;
34-
bottom: 7%;
34+
bottom: 3%;
3535
right: 1%;
3636
max-width: 400px;
3737
width: 100%;
3838
background-color: white;
3939
border-radius: 12px;
4040
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+
4349
}
4450

4551
.chat-icon {
4652
position: fixed;
47-
bottom: 4%;
48-
right: 4%;
53+
bottom: 3%;
54+
right: 2%;
4955
background-color: rgb(209, 16, 16);
56+
transition: opacity 0.2s;
57+
&:hover {
58+
opacity: 0.8;
59+
}
5060
/* Red color */
5161
border-radius: 50%;
52-
width: 50px;
53-
height: 50px;
62+
padding: 10px;
63+
width: 55px;
64+
height: 55px;
5465
display: flex;
5566
align-items: center;
5667
justify-content: center;
@@ -68,25 +79,25 @@
6879
}
6980

7081
.chat-log {
71-
max-height: 320px;
82+
max-height: 295px;
7283
/* Adjusted height */
7384
overflow-y: auto;
74-
height: 320px;
85+
height: 295px;
7586
/* Fixed height */
7687
}
7788

7889
.loading {
7990
display: none;
80-
position: fixed;
91+
{% comment %} position: fixed;
8192
bottom: 100px;
82-
right: 10.5%;
93+
right: 10.5%;{% endcomment %}
8394
justify-content: center;
8495
align-items: center;
85-
padding: 10px;
96+
font-size: 2xl;
97+
padding: 10px;
8698
background-color: #ffffffe6;
8799
/* Semi-transparent background */
88-
border-radius: 12px;
89-
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
100+
border-radius: 8px;
90101
}
91102

92103
.chat-Zindex {
@@ -393,36 +404,40 @@
393404
<div id="chatbot" class="chatbot">
394405
<div class="chat-header flex justify-between items-center">
395406
<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>
397408
</div>
398409
<div class="p-4">
399410
<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>
401425
</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">
404428
<input id="chat-message-input"
405429
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"
407431
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>
412438
</div>
413439
</div>
414440
</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>
426441
<div id="chatIcon" class="chat-icon">
427442
<svg class="w-10 h-10 text-white"
428443
aria-hidden="true"
@@ -551,13 +566,13 @@ <h3 class="text-xl font-extrabold">Chat with BLT Bot</h3>
551566
'/report &lt;description&gt; - Report a bug<br>' +
552567
'/gsoc - Get GSoC info<br>' +
553568
'/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;
556571
return true;
557572
case '/report':
558573
if (!args) {
559574
response = 'Please provide a description. Usage: /report &lt;description&gt;';
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>';
561576
chatLog.scrollTop = chatLog.scrollHeight;
562577
return true;
563578
}
@@ -568,12 +583,12 @@ <h3 class="text-xl font-extrabold">Chat with BLT Bot</h3>
568583
'Explore OWASP’s GSoC participation:<br>' +
569584
'- Current projects: <a href="https://owasp.org/www-community/initiatives/gsoc/gsoc2025ideas">GSoC 2025 Ideas</a><br>' +
570585
'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;
573588
return true;
574589
case '/stats':
575590
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>';
577592
chatLog.scrollTop = chatLog.scrollHeight;
578593
return true;
579594
default:
@@ -587,7 +602,7 @@ <h3 class="text-xl font-extrabold">Chat with BLT Bot</h3>
587602
if (message === "") return;
588603

589604
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>';
591606
loading.style.display = 'flex';
592607

593608
// Check for slash command
@@ -618,7 +633,7 @@ <h3 class="text-xl font-extrabold">Chat with BLT Bot</h3>
618633
})
619634
.then(data => {
620635
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>';
622637
chatLog.scrollTop = chatLog.scrollHeight;
623638
loading.style.display = 'none';
624639
})
@@ -627,7 +642,7 @@ <h3 class="text-xl font-extrabold">Chat with BLT Bot</h3>
627642
if (error.message === 'Rate limit exceeded') {
628643
errorMessage = 'The request limit has been reached. Please try again later.';
629644
}
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>';
631646
chatLog.scrollTop = chatLog.scrollHeight;
632647
loading.style.display = 'none';
633648
});

0 commit comments

Comments
 (0)