You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
242 lines
4.6 KiB
242 lines
4.6 KiB
/* src/styles/ChatWindow.css */
|
|
|
|
.chat-window {
|
|
position: absolute;
|
|
bottom: 5%;
|
|
left: 3%;
|
|
width: 25%;
|
|
max-height: 30%;
|
|
background-color: rgba(0, 0, 0, 0.7);
|
|
display: flex;
|
|
flex-direction: column;
|
|
font-family: 'Tahoma', sans-serif;
|
|
color: white;
|
|
border-radius: 10px;
|
|
overflow: hidden; /* Ensures child elements don't overflow */
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.chat-window {
|
|
width: 90%;
|
|
left: 3%;
|
|
}
|
|
}
|
|
|
|
.messages {
|
|
flex: 1;
|
|
overflow-y: auto; /* Enables vertical scrolling */
|
|
padding: 10px 15px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
scrollbar-width: thin;
|
|
scrollbar-color: rgba(255, 255, 255, 0.5) transparent;
|
|
scroll-behavior: smooth; /* Smooth scrolling behavior */
|
|
}
|
|
|
|
.messages::-webkit-scrollbar {
|
|
width: 3px;
|
|
}
|
|
|
|
.messages::-webkit-scrollbar-track {
|
|
background: transparent;
|
|
margin: 5px 0;
|
|
}
|
|
|
|
.messages::-webkit-scrollbar-thumb {
|
|
background-color: rgba(255, 255, 255, 0.5);
|
|
border-radius: 10px;
|
|
}
|
|
|
|
.messages::-webkit-scrollbar-button {
|
|
display: none;
|
|
}
|
|
|
|
.message {
|
|
width: fit-content;
|
|
max-width: 80%;
|
|
margin-bottom: 10px;
|
|
padding: 10px;
|
|
border-radius: 10px;
|
|
word-wrap: break-word;
|
|
position: relative;
|
|
clear: both;
|
|
}
|
|
|
|
.message.user {
|
|
align-self: flex-end;
|
|
background-color: rgba(0, 122, 255, 0.3);
|
|
text-align: right;
|
|
margin-right: 5px;
|
|
}
|
|
|
|
.message.user::after {
|
|
content: '';
|
|
position: absolute;
|
|
right: -10px;
|
|
top: 10px;
|
|
border-width: 10px 0 10px 10px;
|
|
border-style: solid;
|
|
border-color: transparent transparent transparent rgba(0, 122, 255, 0.3);
|
|
}
|
|
|
|
.message.backend {
|
|
align-self: flex-start;
|
|
background-color: rgba(200, 200, 200, 0.5);
|
|
margin-left: 5px;
|
|
}
|
|
|
|
.message.backend::before {
|
|
content: '';
|
|
position: absolute;
|
|
left: -10px;
|
|
top: 10px;
|
|
border-width: 10px 10px 10px 0;
|
|
border-style: solid;
|
|
border-color: transparent rgba(200, 200, 200, 0.5) transparent transparent;
|
|
}
|
|
|
|
.input-area {
|
|
display: flex;
|
|
padding: 10px;
|
|
background-color: rgba(0, 0, 0, 0.5);
|
|
}
|
|
|
|
.input-area input {
|
|
flex: 1;
|
|
padding: 10px;
|
|
border: none;
|
|
border-radius: 20px;
|
|
margin-right: 10px;
|
|
font-size: 1em;
|
|
background-color: rgba(255, 255, 255, 0.1);
|
|
color: white;
|
|
}
|
|
|
|
.input-area input:disabled {
|
|
background-color: rgba(255, 255, 255, 0.05);
|
|
cursor: not-allowed; /* Indicate disabled state */
|
|
}
|
|
|
|
.input-area button {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 10px 15px;
|
|
border: none;
|
|
color: white;
|
|
border-radius: 20px;
|
|
cursor: pointer;
|
|
font-size: 1em;
|
|
transition: background-color 0.3s;
|
|
}
|
|
|
|
.input-area button:disabled {
|
|
cursor: not-allowed; /* Indicate disabled state */
|
|
opacity: 0.6; /* Visual feedback for disabled state */
|
|
}
|
|
|
|
.send-button {
|
|
background-color: #007AFF;
|
|
}
|
|
|
|
.send-button:hover:not(:disabled) {
|
|
background-color: #005bb5;
|
|
}
|
|
|
|
.speak-button {
|
|
background-color: #FF3B30;
|
|
margin-left: 10px;
|
|
transition: background-color 1s ease-in-out;
|
|
}
|
|
|
|
.speak-button.recording {
|
|
animation: fadeRed 2s infinite;
|
|
}
|
|
|
|
@keyframes fadeRed {
|
|
0% {
|
|
background-color: #FF3B30;
|
|
}
|
|
50% {
|
|
background-color: #FF8A80;
|
|
}
|
|
100% {
|
|
background-color: #FF3B30;
|
|
}
|
|
}
|
|
|
|
.input-area input:focus {
|
|
outline: none;
|
|
}
|
|
|
|
.input-area button:focus {
|
|
outline: none;
|
|
}
|
|
|
|
.input-area svg {
|
|
margin-right: 5px;
|
|
}
|
|
|
|
|
|
.start-conversation-button-wrapper {
|
|
position: absolute;
|
|
bottom: 20px;
|
|
left: 20px;
|
|
z-index: 9999;
|
|
}
|
|
|
|
.start-conversation-button {
|
|
display: flex;
|
|
align-items: center;
|
|
background: #fff;
|
|
border: 2px solid #ccc;
|
|
border-radius: 50px;
|
|
padding: 10px 20px;
|
|
cursor: pointer;
|
|
font-size: 0.9em;
|
|
font-weight: 500;
|
|
color: #333;
|
|
}
|
|
|
|
.start-conversation-button svg {
|
|
margin-right: 8px;
|
|
}
|
|
|
|
.fade-in {
|
|
animation: fadeIn 3s ease forwards;
|
|
}
|
|
|
|
@keyframes fadeIn {
|
|
0% {
|
|
opacity: 0;
|
|
}
|
|
100% {
|
|
opacity: 1;
|
|
}
|
|
}
|
|
|
|
/* The floating wrapper for the voice indicator:
|
|
Position it near the chat window.
|
|
You can tweak left/bottom to get the exact offset you want. */
|
|
.voice-indicator-floating {
|
|
position: absolute;
|
|
bottom: 100px; /* example: 80px or 100px above the bottom so it doesn't overlap the chat */
|
|
left: 45%; /* offset horizontally from the chat window; adjust as needed */
|
|
z-index: 9999; /* ensure it floats above other elements */
|
|
}
|
|
|
|
/* Example styling if you want a transparent background */
|
|
.voice-indicator-floating {
|
|
background: none; /* or transparent, to avoid any white box or push */
|
|
padding: 0; /* remove default spacing if any */
|
|
}
|
|
|
|
/* If you want it to respond on smaller screens,
|
|
you can add a media query, for instance: */
|
|
@media (max-width: 768px) {
|
|
.voice-indicator-floating {
|
|
bottom: 120px;
|
|
left: 20px;
|
|
/* or place it somewhere else on smaller screens */
|
|
}
|
|
}
|
|
|