@inleads/inleads-widgets
Version:
Widgets for chatbot, WhatsApp, nps, contact-form
797 lines (688 loc) • 13.8 kB
CSS
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
:host {
display: block ;
all: initial;
}
.ai-user-chat-container {
display: flex;
justify-content: center;
align-items: center;
position: fixed;
bottom: 16px;
right: 20px;
color: #222222;
z-index: 1000;
font-family: 'Poppins', sans-serif;
}
.ai-user-chat-widget {
width: 95vw;
margin: 0 auto;
border-radius: 16px;
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
display: flex;
flex-direction: column;
background-color: white;
justify-content: space-between;
overflow: hidden;
margin-left: 3%;
animation: chatWidgetAppear 0.4s ease-out;
}
@keyframes chatWidgetAppear {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.ai-user-chatbot-widget{
height:92vh;
}
/* Simple mobile adjustments */
@media screen and (max-width: 480px) {
.ai-user-chat-widget {
width: 100vw;
margin-left: 0;
border-radius: 0;
height: 100vh;
}
/* Make close button more visible */
.ai-chatbot-btn-close {
position: relative;
z-index: 100;
padding: 10px;
margin-right: 5px;
}
.ai-chatbot-close-image {
width: 24px;
height: 24px;
display: block;
filter: brightness(0) invert(1); /* Make sure icon is white and visible */
}
}
.ai-user-chat-form{
height: 100%;
}
.ai-user-chatbot-form-conatiner{
margin-bottom: 50px;
}
.ai-user-chatbox{
flex-grow: 1;
display: flex;
flex-direction: column;
overflow-y: auto;
padding: 4px 10px 10px 10px;
scroll-behavior: smooth;
border-bottom: 1px solid #ccc;
}
.ai-user-chatbox::-webkit-scrollbar {
width: 8px;
}
.ai-user-chatbox::-webkit-scrollbar-thumb {
background-color: #888;
border-radius: 4px;
}
.ai-user-chatbox::-webkit-scrollbar-thumb:hover {
background-color: #aaa9a9;
}
.ai-chatbot-chat-message {
margin: 5px 0;
padding: 10px;
word-wrap: break-word;
max-width: 75%;
font-size: 14px;
font-family: 'Poppins', sans-serif;
}
.ai-chatbot-main-heading {
padding: 15px 20px;
text-align: left;
background-color: #1b1464;
color: #fff;
display: flex;
align-items: center;
justify-content: space-between;
font-family: 'Poppins', sans-serif;
border: none;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.greeting-info{
font-size: 14px;
margin-top: 6px;
font-weight: 500;
display: block;
letter-spacing: 0.01em;
opacity: 0.9;
}
.chatbot-form{
padding: 16px 12px;
background-color: #f9f9f9;
border-top: 1px solid #eee;
}
.ai-user-chatbot-form{
display: flex;
flex-direction: column;
align-items: center;
}
.chatbot-form-buttons{
display: flex;
flex-direction: row;
justify-content: space-between;
margin-top: 28px ;
gap:12px;
}
.chat-accreditation{
padding: 18px 0px;
text-align: center;
font-family: 'Poppins', sans-serif;
border: 1px solid #ccc;
font-weight: 400;
}
.accreditation{
text-decoration: none;
}
.profile-heading-chatbot{
display: flex;
align-items: center;
height:52px;
}
.profile-abbreviation-block {
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
background-color: #fff;
width: calc(30px + var(--text-length, 1) * 10px);
height: calc(30px + var(--text-length, 1) * 10px);
aspect-ratio: 1 / 1;
}
.profile-abbreviation {
font-weight: bold;
text-align: center;
}
.ai-form-heading{
margin-left: 12px;
font-size: 20px;
}
.ai-user-heading{
margin-left: 12px;
font-size: 18px;
}
.ai-user-paragraph{
margin-left: 12px;
font-size: 16px;
font-family: 'Poppins', sans-serif;
}
.ai-chatbot-btn-close {
color: #f3eeee;
border: none;
cursor: pointer;
background-color: transparent;
font-size: 22px;
font-family: 'Poppins', sans-serif;
}
.ai-chatbot-user {
border-radius: 12px 12px 0 12px;
align-self: flex-end;
text-align: left;
font-family: 'Poppins', sans-serif;
color: #222222;
}
.ai-chatbot-prompts{
padding: 0 ;
}
.ai-chatbot-bot {
background-color: #f1f0f0;
border-radius: 12px 12px 12px 0;
align-self: flex-start;
text-align: left;
font-family: 'Poppins', sans-serif;
color: #222222;
}
.ai-chatbot-loading {
text-align: left;
min-width: 20px;
padding: 10px;
min-height: 16px;
background-color: #f1f0f0;
border-radius: 12px 12px 12px 0;
max-width: 30px;
display: inline;
}
.ai-chatbot-music-loader {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
column-gap: 5px;
}
.ai-loading-bar {
width: 2px;
height: 4px;
background-color: gray;
animation: equalize 1s infinite;
}
.ai-loading-bar:nth-child(1) {
animation-delay: 0.1s;
}
.ai-loading-bar:nth-child(2) {
animation-delay: 0.2s;
}
.ai-loading-bar:nth-child(3) {
animation-delay: 0.3s;
}
.ai-loading-bar:nth-child(4) {
animation-delay: 0.4s;
}
@keyframes equalize {
0% {
height: 5px;
}
50% {
height: 10px;
}
100% {
height: 5px;
}
}
.ai-chatbot-input-container {
padding: 6px 10px 6px 15px;
background-color: #EDF2F7;
font-family: 'Poppins', sans-serif;
margin: 15px;
border-radius: 25px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
transition: box-shadow 0.3s ease;
}
.ai-chatbot-input-container:focus-within {
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.ai-chatbot-textarea {
flex: 1;
height:30px;
border: none;
outline: none;
padding: 10px 0px 0px 10px;
font-size: 15px;
border-radius: 25px;
background-color: transparent;
font-family: 'Poppins', sans-serif;
resize: none;
}
.ai-chatbot-input-container .ai-chatbot-textarea::-webkit-scrollbar {
display: none;
}
.ai-chatbot-send-button {
display: inline-block;
padding: 10px 15px;
color: black;
border-radius: 5px;
cursor: pointer;
}
.chat-messages{
opacity: 1 ;
}
.ai-user-robot-container {
position: relative;
display: flex;
flex-direction: column;
align-items: flex-end;
padding-right: 14px;
margin-bottom: 10px;
}
.msg-close-btn-containe{
width:40px;
height:40px;
}
.chatbot-image-container{
height: 88px;
width: 88px;
display: flex;
justify-content: center;
align-items: center;
object-fit: contain;
border-radius: 50%;
overflow: hidden;
box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
position: relative;
z-index: 1;
animation: popIn 0.5s ease-out forwards;
}
.ai-chatbot-image {
cursor: pointer;
transition: transform 0.3s ease, box-shadow 0.3s ease;
object-fit: cover; /* Ensure the image covers the container properly */
opacity: 1;
animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
0% { opacity: 0; }
100% { opacity: 1; }
}
@keyframes floatAnimation {
0% { transform: translateY(0); }
50% { transform: translateY(-5px); }
100% { transform: translateY(0); }
}
@keyframes popIn {
0% { transform: scale(0.8); opacity: 0; }
70% { transform: scale(1.1); }
100% { transform: scale(1); opacity: 1; }
}
.ai-chatbot-image:hover {
transform: scale(1.05);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.ai-chatbot-close-image {
object-fit: cover;
height: 24px;
width: 24px;
}
.ai-chatbot-send-image {
transform: rotate(325deg);
}
.ai-chatbot-disclaimer {
font-size: 10px;
color: #777;
text-align: center;
padding: 5px 0;
margin: 5px 15px 10px;
font-family: 'Poppins', sans-serif;
line-height: 1.2;
}
/* register */
.ai-user-register {
padding: 15px;
background-color: white;
border-radius: 8px;
box-shadow: 0px 5px 8px rgba(0, 0, 0, 0.3);
}
.chat-logs {
padding: 15px 25px;
scroll-behavior: smooth;
}
.form-group {
margin-bottom: 15px;
font-family: 'Poppins', sans-serif;
}
.form-group label {
font-size: 14px;
font-weight: 500;
display: block;
margin-bottom: 5px;
}
.form-group input {
outline: none;
font-size: 14px;
font-family: 'Poppins', sans-serif;
}
.form-group .required {
color: red;
}
.form-control {
width: 100%;
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
font-size: 14px;
}
.error-message {
color: red;
font-size: 12px;
margin-top: 5px;
}
.btn-form-submit{
background-color: #007bff;
color:#fff;
outline: none;
cursor: pointer;
border-radius: 4px;
font-size: 16px;
padding: 8px 16px;
display: block;
width:100%;
font-family: 'Poppins', sans-serif;
align-self: flex-start;
}
.preprompts-container{
display: flex;
flex-direction: column;
align-items: end;
gap: 6px;
}
.preprompt-button{
padding: 8px 14px;
border-radius: 20px;
font-size: 13px;
background-color: var(--chat-box-prompt-color);
color: white;
border: none;
cursor: pointer;
width: fit-content;
text-align: center;
white-space: normal;
word-wrap: break-word;
line-height: 1.2;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
transition: all 0.2s ease;
}
.preprompt-button:hover{
transform: translateY(-1px);
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
opacity: 0.9;
}
.chatbot-message-container {
width: auto;
padding: 10px 5px;
margin-bottom: 8px;
animation: slideIn 0.5s ease-out forwards, floatAnimation 3s ease-in-out infinite;
align-self: flex-end;
}
.chatbot-message-blue {
position: relative;
padding: 14px 18px;
background-color: #f8f8f8;
min-width: 80px;
max-width: 280px;
height: auto;
text-align: left;
font-family: 'system-ui', -apple-system, BlinkMacSystemFont, sans-serif;
border: none;
border-radius: 14px;
font-size: 14px;
font-weight: 500;
display: flex;
column-gap: 12px;
justify-content: space-between;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
transition: transform 0.2s ease, box-shadow 0.2s ease;
cursor: pointer;
}
.chatbot-message-blue:hover {
transform: translateY(-3px);
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
.hi-emoji{
font-size: 16px;
}
.msg-close-btn-container{
cursor: pointer;
}
.chatbot-message-content {
padding: 0;
margin: 0;
animation: fadeIn 0.8s ease-out forwards;
line-height: 1.5;
letter-spacing: 0.01em;
font-size: 15px;
cursor: pointer;
}
.wave-emoji {
display: inline-block;
animation: wave 1.5s 2;
transform-origin: 70% 70%;
margin-right: 8px;
font-size: 16px;
}
.chatbot-message-blue:after {
content: '';
position: absolute;
width: 0;
height: 0;
border-top: 12px solid var(--chat-box-color);
border-left: 10px solid transparent;
border-right: 10px solid transparent;
bottom: -10px;
right: 20px;
}
.agent-name{
font-size: 12px;
font-weight: 500;
display: block;
}
@media (max-width: 768px) {
.ai-user-chat-widget {
width: 95vw;
}
}
@media (min-width: 769px) and (max-width: 1024px) {
.ai-user-chat-widget {
width: 70vw;
}
}
@media (min-width: 1025px) {
.ai-user-chat-widget {
width: 30vw;
}
}
.msg-close-btn-container{
cursor: pointer;
}
.chatbot-message-content {
padding: 0;
margin: 0;
animation: fadeIn 0.8s ease-out forwards;
line-height: 1.5;
letter-spacing: 0.01em;
font-size: 15px;
cursor: pointer;
}
.wave-emoji {
display: inline-block;
animation: wave 1.5s 2;
transform-origin: 70% 70%;
margin-right: 8px;
font-size: 16px;
}
.chatbot-message-blue:after {
content: '';
position: absolute;
width: 0;
height: 0;
border-top: 12px solid var(--chat-box-color);
border-left: 10px solid transparent;
border-right: 10px solid transparent;
bottom: -10px;
right: 20px;
}
.agent-name{
font-size: 12px;
font-weight: 500;
display: block;
}
.image-preview-container{
width:60px;
height:60px;
border-radius: 8px;
overflow: hidden;
position: relative;
display: inline-block;
}
.image-input-preview{
margin-top: 2px;
}
.image-preview{
width: 100%;
height:100%;
display: flex;
}
.upload-button{
background-color: transparent;
border: none;
cursor: pointer;
}
.image-preview {
max-width: 100%;
border-radius: 8px;
}
.close-image {
position: absolute;
top: 5px;
right: 5px;
background: rgba(0, 0, 0, 0.5);
font-size: 14px;
font-weight: bold;
width: 20px;
height: 20px;
text-align: center;
line-height: 25px;
border-radius: 50%;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
}
.close-icon{
color: #fff;
}
.user-input-container{
display: flex;
align-items: center;
}
.close-image{
font-size: 24px;
}
.images-list-preview{
display: flex;
flex-wrap: wrap;
gap: 4px;
border: none;
background-color: transparent;
}
.sender-image-item{
width:100%;
height:100%;
margin-bottom: 6px;
}
.image-sender{
height:auto;
}
.image-upload-error{
color:red;
font-size: 10px;
padding: 2px 10px;
}
.show-date{
text-align: center;
font-size: 12px;
font-family: 'Poppins', sans-serif;
font-weight: 500;
margin: 10px 0px;
padding: 4px 12px;
background-color: #f5f5f5;
border-radius: 12px;
display: inline-block;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
div {
white-space: normal;
line-height: 1.3;
}
div > p:first-child {
margin-top: 0;
}
div > p:last-child {
margin-bottom: 0;
}
/* Animations for the greeting message */
@keyframes slideIn {
0% {
opacity: 0;
transform: translateY(20px);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
@keyframes fadeIn {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes pulse {
0% {
transform: scale(1);
}
50% {
transform: scale(1.05);
}
100% {
transform: scale(1);
}
}
@keyframes wave {
0% { transform: rotate(0deg); }
10% { transform: rotate(14deg); }
20% { transform: rotate(-8deg); }
30% { transform: rotate(14deg); }
40% { transform: rotate(-4deg); }
50% { transform: rotate(10deg); }
60% { transform: rotate(0deg); }
100% { transform: rotate(0deg); }
}