Spaces:
Paused
Paused
Commit
·
695b180
1
Parent(s):
ccf6ce7
updated
Browse files- backend/templates/base.html +55 -117
backend/templates/base.html
CHANGED
@@ -601,6 +601,60 @@
|
|
601 |
}
|
602 |
|
603 |
/* Additional content styling omitted for brevity */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
604 |
</style>
|
605 |
</head>
|
606 |
<body>
|
@@ -654,123 +708,7 @@
|
|
654 |
{% block content %}{% endblock %}
|
655 |
</div>
|
656 |
|
657 |
-
|
658 |
-
<!-- Chatbot Toggle Button -->
|
659 |
-
<!--
|
660 |
-
The floating chat button toggles the visibility of the chat window.
|
661 |
-
We use a flex container here to ensure the emoji and text remain
|
662 |
-
centred on all screen sizes. Additional media queries adjust the
|
663 |
-
button's position and padding for very small viewports.
|
664 |
-
-->
|
665 |
-
<div id="chatbot-toggle" onclick="toggleChatbot()">💬</div>
|
666 |
-
|
667 |
-
<!-- Chatbox Popup -->
|
668 |
-
<div id="chatbot-box">
|
669 |
-
<div id="chat-header">LUNA AI</div>
|
670 |
-
<div id="chat-messages"></div>
|
671 |
-
<input id="chat-input" type="text" placeholder="Ask me anything..." onkeydown="sendChat(event)">
|
672 |
-
</div>
|
673 |
-
|
674 |
-
<style>
|
675 |
-
#chatbot-toggle {
|
676 |
-
/* Floating circular button on desktop. It is vertically centred along the right edge */
|
677 |
-
position: fixed;
|
678 |
-
top: 50%;
|
679 |
-
right: 1rem;
|
680 |
-
transform: translateY(-50%);
|
681 |
-
width: 3rem;
|
682 |
-
height: 3rem;
|
683 |
-
background-color: #4caf50;
|
684 |
-
color: #ffffff;
|
685 |
-
border-radius: 50%;
|
686 |
-
cursor: pointer;
|
687 |
-
z-index: 1000;
|
688 |
-
display: flex;
|
689 |
-
align-items: center;
|
690 |
-
justify-content: center;
|
691 |
-
font-size: 1.5rem;
|
692 |
-
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
|
693 |
-
transition: background-color 0.2s ease;
|
694 |
-
}
|
695 |
-
|
696 |
-
#chatbot-toggle:hover {
|
697 |
-
background-color: #43a047;
|
698 |
-
}
|
699 |
-
|
700 |
-
/* Chat icon inside the navbar (hidden by default and shown on small screens via media query) */
|
701 |
-
#chatbot-nav {
|
702 |
-
display: none;
|
703 |
-
}
|
704 |
-
|
705 |
-
#chatbot-box {
|
706 |
-
position: fixed;
|
707 |
-
/* Align the chat window vertically with the toggle on desktop */
|
708 |
-
top: 50%;
|
709 |
-
right: calc(1rem + 3rem + 1rem);
|
710 |
-
transform: translateY(-50%);
|
711 |
-
/* Default dimensions for larger screens */
|
712 |
-
width: 20rem;
|
713 |
-
height: 25rem;
|
714 |
-
background: white;
|
715 |
-
border: 2px solid #ccc;
|
716 |
-
border-radius: 10px;
|
717 |
-
display: none;
|
718 |
-
flex-direction: column;
|
719 |
-
z-index: 1000;
|
720 |
-
box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
|
721 |
-
}
|
722 |
-
|
723 |
-
#chat-header {
|
724 |
-
background-color: #4caf50;
|
725 |
-
color: white;
|
726 |
-
padding: 10px;
|
727 |
-
text-align: center;
|
728 |
-
font-weight: bold;
|
729 |
-
}
|
730 |
-
|
731 |
-
#chat-messages {
|
732 |
-
flex: 1;
|
733 |
-
padding: 10px;
|
734 |
-
overflow-y: auto;
|
735 |
-
max-height: 300px;
|
736 |
-
}
|
737 |
-
|
738 |
-
/* Responsive adjustments for small screens */
|
739 |
-
@media (max-width: 768px) {
|
740 |
-
/* Hide the floating button and reveal the navbar icon on mobile */
|
741 |
-
#chatbot-toggle {
|
742 |
-
display: none !important;
|
743 |
-
}
|
744 |
-
#chatbot-nav {
|
745 |
-
display: block;
|
746 |
-
font-size: 1.5rem;
|
747 |
-
color: var(--accent);
|
748 |
-
margin-left: 1rem;
|
749 |
-
cursor: pointer;
|
750 |
-
}
|
751 |
-
#chatbot-box {
|
752 |
-
width: 90vw;
|
753 |
-
height: 60vh;
|
754 |
-
bottom: 1rem;
|
755 |
-
right: 5vw;
|
756 |
-
top: auto;
|
757 |
-
transform: none;
|
758 |
-
}
|
759 |
-
#chat-messages {
|
760 |
-
max-height: calc(60vh - 5.5rem);
|
761 |
-
}
|
762 |
-
}
|
763 |
-
|
764 |
-
#chat-input {
|
765 |
-
border: none;
|
766 |
-
border-top: 1px solid #ccc;
|
767 |
-
padding: 10px;
|
768 |
-
width: 100%;
|
769 |
-
box-sizing: border-box;
|
770 |
-
}
|
771 |
-
</style>
|
772 |
-
|
773 |
-
#CHATBOT END
|
774 |
</main>
|
775 |
|
776 |
<footer>
|
|
|
601 |
}
|
602 |
|
603 |
/* Additional content styling omitted for brevity */
|
604 |
+
|
605 |
+
/*
|
606 |
+
* Flash message styling
|
607 |
+
*
|
608 |
+
* The flash message container appears just below the navigation bar and
|
609 |
+
* above the page content. These rules provide a consistent look and
|
610 |
+
* feel across different screen sizes without altering the underlying
|
611 |
+
* layout. Messages stack vertically with gentle spacing and use
|
612 |
+
* coloured left borders to indicate their severity (success, warning,
|
613 |
+
* danger or info). We leverage the existing colour palette defined
|
614 |
+
* in CSS variables (e.g. --success, --warning, --danger, --accent)
|
615 |
+
* while keeping backgrounds light and text readable.
|
616 |
+
*/
|
617 |
+
.flash-messages {
|
618 |
+
margin: 1rem 0;
|
619 |
+
display: flex;
|
620 |
+
flex-direction: column;
|
621 |
+
gap: 0.75rem;
|
622 |
+
}
|
623 |
+
|
624 |
+
.flash-messages .alert {
|
625 |
+
padding: 0.75rem 1rem;
|
626 |
+
border-radius: 5px;
|
627 |
+
font-weight: 500;
|
628 |
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
629 |
+
width: 100%;
|
630 |
+
box-sizing: border-box;
|
631 |
+
display: flex;
|
632 |
+
align-items: center;
|
633 |
+
}
|
634 |
+
|
635 |
+
.alert-success {
|
636 |
+
background-color: rgba(46, 204, 113, 0.15);
|
637 |
+
color: var(--success);
|
638 |
+
border-left: 4px solid var(--success);
|
639 |
+
}
|
640 |
+
|
641 |
+
.alert-warning {
|
642 |
+
background-color: rgba(243, 156, 18, 0.15);
|
643 |
+
color: var(--warning);
|
644 |
+
border-left: 4px solid var(--warning);
|
645 |
+
}
|
646 |
+
|
647 |
+
.alert-danger {
|
648 |
+
background-color: rgba(231, 76, 60, 0.15);
|
649 |
+
color: var(--danger);
|
650 |
+
border-left: 4px solid var(--danger);
|
651 |
+
}
|
652 |
+
|
653 |
+
.alert-info {
|
654 |
+
background-color: rgba(76, 201, 240, 0.15);
|
655 |
+
color: var(--accent);
|
656 |
+
border-left: 4px solid var(--accent);
|
657 |
+
}
|
658 |
</style>
|
659 |
</head>
|
660 |
<body>
|
|
|
708 |
{% block content %}{% endblock %}
|
709 |
</div>
|
710 |
|
711 |
+
<!-- Chatbot UI removed on the home page. -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
712 |
</main>
|
713 |
|
714 |
<footer>
|