mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-20 14:55:50 +00:00
enhancements to chatbox css
This commit is contained in:
parent
f71f03f062
commit
a88b06ded4
2 changed files with 198 additions and 133 deletions
|
@ -9387,65 +9387,98 @@ table td.action-column {
|
||||||
hr {
|
hr {
|
||||||
border-top: 1px dotted #34302D; }
|
border-top: 1px dotted #34302D; }
|
||||||
|
|
||||||
|
/* Chatbox container */
|
||||||
.chatbox {
|
.chatbox {
|
||||||
width: 300px;
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
background-color: #f4f4f9;
|
|
||||||
border-radius: 10px;
|
|
||||||
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
|
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 10px;
|
bottom: 10px;
|
||||||
right: 10px;
|
right: 10px;
|
||||||
font-family: Arial, sans-serif;
|
width: 300px;
|
||||||
|
background-color: #f1f1f1;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column; }
|
||||||
|
.chatbox.minimized .chatbox-content {
|
||||||
|
height: 40px;
|
||||||
|
/* Height when minimized (header only) */ }
|
||||||
|
.chatbox.minimized .chatbox-messages,
|
||||||
|
.chatbox.minimized .chatbox-footer {
|
||||||
|
display: none; }
|
||||||
|
|
||||||
|
/* Header styling */
|
||||||
|
.chatbox-header {
|
||||||
|
background-color: #075E54;
|
||||||
|
color: white;
|
||||||
|
padding: 10px;
|
||||||
|
text-align: center;
|
||||||
|
border-top-left-radius: 10px;
|
||||||
|
border-top-right-radius: 10px;
|
||||||
|
cursor: pointer; }
|
||||||
|
|
||||||
|
/* Chatbox content styling */
|
||||||
|
.chatbox-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 400px;
|
||||||
|
/* Adjust to desired height */
|
||||||
|
overflow: hidden;
|
||||||
|
/* Hide overflow to make it scrollable */ }
|
||||||
|
|
||||||
|
.chatbox-messages {
|
||||||
|
flex-grow: 1;
|
||||||
|
overflow-y: auto;
|
||||||
|
/* Allows vertical scrolling */
|
||||||
|
padding: 10px; }
|
||||||
|
|
||||||
|
/* Chat bubbles styling */
|
||||||
|
.chat-bubble {
|
||||||
|
max-width: 80%;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 20px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
position: relative;
|
||||||
|
word-wrap: break-word;
|
||||||
font-size: 14px; }
|
font-size: 14px; }
|
||||||
.chatbox-header {
|
.chat-bubble strong {
|
||||||
background-color: #0084ff;
|
font-weight: bold; }
|
||||||
color: white;
|
.chat-bubble em {
|
||||||
padding: 10px;
|
font-style: italic; }
|
||||||
border-radius: 10px 10px 0 0;
|
.chat-bubble.user {
|
||||||
font-weight: bold;
|
background-color: #dcf8c6;
|
||||||
cursor: pointer; }
|
/* WhatsApp-style light green */
|
||||||
.chatbox-content {
|
margin-left: auto;
|
||||||
max-height: 400px;
|
text-align: right;
|
||||||
overflow-y: auto;
|
border-bottom-right-radius: 0; }
|
||||||
padding: 10px;
|
.chat-bubble.bot {
|
||||||
background-color: white;
|
background-color: #ffffff;
|
||||||
border-bottom: 1px solid #ddd;
|
margin-right: auto;
|
||||||
display: flex;
|
text-align: left;
|
||||||
flex-direction: column; }
|
border-bottom-left-radius: 0;
|
||||||
.chatbox-footer {
|
border: 1px solid #e1e1e1; }
|
||||||
padding: 10px;
|
|
||||||
border-top: 1px solid #ddd;
|
/* Input field and button */
|
||||||
display: flex;
|
.chatbox-footer {
|
||||||
align-items: center;
|
padding: 10px;
|
||||||
justify-content: space-between; }
|
background-color: #f9f9f9;
|
||||||
.chatbox-footer input[type="text"] {
|
display: flex; }
|
||||||
flex: 1;
|
|
||||||
padding: 5px;
|
.chatbox-footer input {
|
||||||
border: 1px solid #ddd;
|
flex-grow: 1;
|
||||||
border-radius: 5px; }
|
padding: 10px;
|
||||||
.chatbox-footer button {
|
border-radius: 20px;
|
||||||
padding: 5px 10px;
|
border: 1px solid #ccc;
|
||||||
background-color: #0084ff;
|
margin-right: 10px;
|
||||||
color: white;
|
outline: none; }
|
||||||
border: none;
|
|
||||||
border-radius: 5px;
|
.chatbox-footer button {
|
||||||
cursor: pointer; }
|
background-color: #075E54;
|
||||||
.chatbox-messages .chat-bubble {
|
color: white;
|
||||||
max-width: 80%;
|
border: none;
|
||||||
margin-bottom: 10px;
|
padding: 10px;
|
||||||
padding: 8px;
|
border-radius: 50%;
|
||||||
border-radius: 15px;
|
cursor: pointer; }
|
||||||
position: relative;
|
.chatbox-footer button:hover {
|
||||||
word-wrap: break-word; }
|
background-color: #128C7E; }
|
||||||
.chatbox-messages .chat-bubble.user {
|
|
||||||
background-color: #0084ff;
|
|
||||||
color: white;
|
|
||||||
align-self: flex-end; }
|
|
||||||
.chatbox-messages .chat-bubble.bot {
|
|
||||||
background-color: #f1f1f1;
|
|
||||||
color: #333;
|
|
||||||
align-self: flex-start; }
|
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'varela_roundregular';
|
font-family: 'varela_roundregular';
|
||||||
|
|
|
@ -21,16 +21,19 @@ $spring-brown: #34302D;
|
||||||
$spring-grey: #838789;
|
$spring-grey: #838789;
|
||||||
$spring-light-grey: #f1f1f1;
|
$spring-light-grey: #f1f1f1;
|
||||||
|
|
||||||
$chatbox-bg-color: #f4f4f9;
|
$chatbox-bg-color: #f1f1f1;
|
||||||
$chatbox-border-color: #ddd;
|
$chatbox-header-bg-color: #075E54;
|
||||||
$chatbox-header-color: #555;
|
$chatbox-header-text-color: white;
|
||||||
$chatbox-user-bubble-color: #0084ff;
|
$chatbox-height: 400px;
|
||||||
$chatbox-bot-bubble-color: #f1f1f1;
|
|
||||||
$chatbox-user-text-color: white;
|
|
||||||
$chatbox-bot-text-color: #333;
|
|
||||||
$chatbox-border-radius: 10px;
|
$chatbox-border-radius: 10px;
|
||||||
$chatbox-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
|
$chatbox-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
|
||||||
|
$chatbox-bubble-user-bg-color: #dcf8c6;
|
||||||
|
$chatbox-bubble-bot-bg-color: #ffffff;
|
||||||
|
$chatbox-bubble-border-color: #e1e1e1;
|
||||||
|
$chatbox-footer-bg-color: #f9f9f9;
|
||||||
|
$chatbox-input-border-color: #ccc;
|
||||||
|
$chatbox-button-bg-color: #075E54;
|
||||||
|
$chatbox-button-hover-bg-color: #128C7E;
|
||||||
|
|
||||||
$body-bg: $spring-light-grey;
|
$body-bg: $spring-light-grey;
|
||||||
$text-color: $spring-brown;
|
$text-color: $spring-brown;
|
||||||
|
@ -220,87 +223,116 @@ hr {
|
||||||
border-top: 1px dotted $spring-brown;
|
border-top: 1px dotted $spring-brown;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Chatbox container styling
|
/* Chatbox container */
|
||||||
.chatbox {
|
.chatbox {
|
||||||
width: 300px;
|
|
||||||
border: 1px solid $chatbox-border-color;
|
|
||||||
background-color: $chatbox-bg-color;
|
|
||||||
border-radius: $chatbox-border-radius;
|
|
||||||
box-shadow: $chatbox-box-shadow;
|
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 10px;
|
bottom: 10px;
|
||||||
right: 10px;
|
right: 10px;
|
||||||
font-family: Arial, sans-serif;
|
width: 300px;
|
||||||
font-size: 14px;
|
background-color: $chatbox-bg-color;
|
||||||
|
border-radius: $chatbox-border-radius;
|
||||||
|
box-shadow: $chatbox-box-shadow;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
&-header {
|
&.minimized {
|
||||||
background-color: $chatbox-user-bubble-color;
|
.chatbox-content {
|
||||||
color: $chatbox-user-text-color;
|
height: 40px; /* Height when minimized (header only) */
|
||||||
padding: 10px;
|
|
||||||
border-radius: $chatbox-border-radius $chatbox-border-radius 0 0;
|
|
||||||
font-weight: bold;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-content {
|
|
||||||
max-height: 400px;
|
|
||||||
overflow-y: auto;
|
|
||||||
padding: 10px;
|
|
||||||
background-color: white;
|
|
||||||
border-bottom: 1px solid $chatbox-border-color;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-footer {
|
|
||||||
padding: 10px;
|
|
||||||
border-top: 1px solid $chatbox-border-color;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
input[type="text"] {
|
|
||||||
flex: 1;
|
|
||||||
padding: 5px;
|
|
||||||
border: 1px solid $chatbox-border-color;
|
|
||||||
border-radius: 5px;
|
|
||||||
}
|
}
|
||||||
|
.chatbox-messages,
|
||||||
button {
|
.chatbox-footer {
|
||||||
padding: 5px 10px;
|
display: none;
|
||||||
background-color: $chatbox-user-bubble-color;
|
|
||||||
color: $chatbox-user-text-color;
|
|
||||||
border: none;
|
|
||||||
border-radius: 5px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&-messages {
|
|
||||||
.chat-bubble {
|
|
||||||
max-width: 80%;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
padding: 8px;
|
|
||||||
border-radius: 15px;
|
|
||||||
position: relative;
|
|
||||||
word-wrap: break-word;
|
|
||||||
|
|
||||||
&.user {
|
|
||||||
background-color: $chatbox-user-bubble-color;
|
|
||||||
color: $chatbox-user-text-color;
|
|
||||||
align-self: flex-end;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.bot {
|
|
||||||
background-color: $chatbox-bot-bubble-color;
|
|
||||||
color: $chatbox-bot-text-color;
|
|
||||||
align-self: flex-start;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Header styling */
|
||||||
|
.chatbox-header {
|
||||||
|
background-color: $chatbox-header-bg-color;
|
||||||
|
color: $chatbox-header-text-color;
|
||||||
|
padding: 10px;
|
||||||
|
text-align: center;
|
||||||
|
border-top-left-radius: $chatbox-border-radius;
|
||||||
|
border-top-right-radius: $chatbox-border-radius;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Chatbox content styling */
|
||||||
|
.chatbox-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: $chatbox-height; /* Adjust to desired height */
|
||||||
|
overflow: hidden; /* Hide overflow to make it scrollable */
|
||||||
|
}
|
||||||
|
|
||||||
|
.chatbox-messages {
|
||||||
|
flex-grow: 1;
|
||||||
|
overflow-y: auto; /* Allows vertical scrolling */
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Chat bubbles styling */
|
||||||
|
.chat-bubble {
|
||||||
|
max-width: 80%;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 20px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
position: relative;
|
||||||
|
word-wrap: break-word;
|
||||||
|
font-size: 14px;
|
||||||
|
|
||||||
|
strong {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
em {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.user {
|
||||||
|
background-color: $chatbox-bubble-user-bg-color; /* WhatsApp-style light green */
|
||||||
|
margin-left: auto;
|
||||||
|
text-align: right;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.bot {
|
||||||
|
background-color: $chatbox-bubble-bot-bg-color;
|
||||||
|
margin-right: auto;
|
||||||
|
text-align: left;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
border: 1px solid $chatbox-bubble-border-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Input field and button */
|
||||||
|
.chatbox-footer {
|
||||||
|
padding: 10px;
|
||||||
|
background-color: $chatbox-footer-bg-color;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chatbox-footer input {
|
||||||
|
flex-grow: 1;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 20px;
|
||||||
|
border: 1px solid $chatbox-input-border-color;
|
||||||
|
margin-right: 10px;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chatbox-footer button {
|
||||||
|
background-color: $chatbox-button-bg-color;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 50%;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: $chatbox-button-hover-bg-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@import "typography.scss";
|
@import "typography.scss";
|
||||||
@import "header.scss";
|
@import "header.scss";
|
||||||
|
|
Loading…
Reference in a new issue