From 1f367e3798ed1d34bde54ca137b835d151b0fa3e Mon Sep 17 00:00:00 2001 From: Rinkit Adhana Date: Thu, 27 Feb 2025 13:36:14 +0530 Subject: [PATCH] Fix linting issues in header.html --- entrypoint.sh | 0 website/templates/includes/header.html | 101 ++++++++++++++----------- 2 files changed, 58 insertions(+), 43 deletions(-) mode change 100644 => 100755 entrypoint.sh diff --git a/entrypoint.sh b/entrypoint.sh old mode 100644 new mode 100755 diff --git a/website/templates/includes/header.html b/website/templates/includes/header.html index 97a2b4fed8..788ca38084 100644 --- a/website/templates/includes/header.html +++ b/website/templates/includes/header.html @@ -31,26 +31,37 @@ .chatbot { display: none; position: fixed; - bottom: 7%; + bottom: 3%; right: 1%; max-width: 400px; width: 100%; background-color: white; border-radius: 12px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); - height: 450px; - /* Fixed height */ + height: 500px; + + @media (max-width: 768px) { + right: 50%; + transform: translateX(50%); + max-width: 95%; + } + } .chat-icon { position: fixed; - bottom: 4%; - right: 4%; + bottom: 3%; + right: 2%; background-color: rgb(209, 16, 16); + transition: opacity 0.2s; + &:hover { + opacity: 0.8; + } /* Red color */ border-radius: 50%; - width: 50px; - height: 50px; + padding: 10px; + width: 55px; + height: 55px; display: flex; align-items: center; justify-content: center; @@ -68,25 +79,25 @@ } .chat-log { - max-height: 320px; + max-height: 295px; /* Adjusted height */ overflow-y: auto; - height: 320px; + height: 295px; /* Fixed height */ } .loading { display: none; - position: fixed; + {% comment %} position: fixed; bottom: 100px; - right: 10.5%; +right: 10.5%;{% endcomment %} justify-content: center; align-items: center; - padding: 10px; + font-size: 2xl; + padding: 10px; background-color: #ffffffe6; /* Semi-transparent background */ - border-radius: 12px; - box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); + border-radius: 8px; } .chat-Zindex { @@ -393,36 +404,40 @@

Chat with BLT Bot

- +
-

We reply immediately

+

We respond instantly!

+
+
+
+ + + + + + Loading... +
-
-
+
- - +
+ + +
-
- - - - - - Loading... -

' + '/gsoc - Get GSoC info
' + '/stats - View platform stats
' - chatLog.innerHTML += '
Bot: ' + response + '
'; - chatLog.scrollTop = chatLog.scrollHeight; + chatLog.innerHTML += '
Bot - ' + escapedAnswer + '
'; + chatLog.scrollTop = chatLog.scrollHeight; return true; case '/report': if (!args) { response = 'Please provide a description. Usage: /report <description>'; - chatLog.innerHTML += '
Bot: ' + response + '
'; + chatLog.innerHTML += '
Bot - ' + escapedAnswer + '
'; chatLog.scrollTop = chatLog.scrollHeight; return true; } @@ -568,12 +583,12 @@

Chat with BLT Bot

'Explore OWASP’s GSoC participation:
' + '- Current projects: GSoC 2025 Ideas
' + 'Get involved with open-source at OWASP!'; - chatLog.innerHTML += '
Bot: ' + response + '
'; - chatLog.scrollTop = chatLog.scrollHeight; + chatLog.innerHTML += '
Bot - ' + escapedAnswer + '
'; + chatLog.scrollTop = chatLog.scrollHeight; return true; case '/stats': response = 'Platform stats are not directly available via the bot yet. Please check the website dashboard or ask an admin for detailed statistics.'; - chatLog.innerHTML += '
Bot: ' + response + '
'; + chatLog.innerHTML += '
Bot - ' + escapedAnswer + '
'; chatLog.scrollTop = chatLog.scrollHeight; return true; default: @@ -587,7 +602,7 @@

Chat with BLT Bot

if (message === "") return; const escapedMessage = escapeHtml(message); - chatLog.innerHTML += '
You: ' + escapedMessage + '
'; + chatLog.innerHTML += '
You - ' + escapedMessage + '
'; loading.style.display = 'flex'; // Check for slash command @@ -618,7 +633,7 @@

Chat with BLT Bot

}) .then(data => { const escapedAnswer = escapeHtml(data.answer); - chatLog.innerHTML += '
Bot: ' + escapedAnswer + '
'; + chatLog.innerHTML += '
Bot - ' + escapedAnswer + '
'; chatLog.scrollTop = chatLog.scrollHeight; loading.style.display = 'none'; }) @@ -627,7 +642,7 @@

Chat with BLT Bot

if (error.message === 'Rate limit exceeded') { errorMessage = 'The request limit has been reached. Please try again later.'; } - chatLog.innerHTML += '
Bot: ' + errorMessage + '
'; + chatLog.innerHTML += '
Bot - ' + errorMessage + '
'; chatLog.scrollTop = chatLog.scrollHeight; loading.style.display = 'none'; });