refactor(ui): Modernize chat interface and standardize background
This commit overhauls the chat page UI for a cleaner, more modern aesthetic inspired by popular messaging apps. Key changes include: - Redesigned the chat header to display the user's name and role. - Replaced the message input area with a WhatsApp-style layout. - Added user avatars to received messages and a person icon to sent messages for clearer identification. - Swapped custom SVG icons with Bootstrap Icons for consistency and easier maintenance. - Removed the floating circles background animation from both the chat and login pages to reduce visual clutter and improve focus.
This commit is contained in:
@@ -5,6 +5,8 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Halaman Chat</title>
|
<title>Halaman Chat</title>
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
|
<!-- Tambahkan link Bootstrap Icons -->
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/bootstrap-icons.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="chat-container">
|
<div class="chat-container">
|
||||||
@@ -24,10 +26,13 @@
|
|||||||
|
|
||||||
<!-- Header dengan avatar dan nama pengguna -->
|
<!-- Header dengan avatar dan nama pengguna -->
|
||||||
<header class="chat-header">
|
<header class="chat-header">
|
||||||
<div class="user-info">
|
<div class="user-info">
|
||||||
<div class="avatar">A</div>
|
<div class="avatar">J</div>
|
||||||
<h2>John Doe</h2>
|
<div class="user-details">
|
||||||
</div>
|
<h2>John Doe</h2>
|
||||||
|
<span class="user-role">Virtual Assistant - Bake Shop</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<!-- Area chat utama -->
|
<!-- Area chat utama -->
|
||||||
@@ -49,27 +54,20 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Input area -->
|
<!-- Input area with WhatsApp-like design -->
|
||||||
<div class="input-area">
|
<div class="input-area">
|
||||||
<button class="icon-btn">
|
<div class="input-wrapper">
|
||||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<input type="text" class="message-input" placeholder="Ketik pesan...">
|
||||||
<path d="M12 15.2C13.7673 15.2 15.2 13.7673 15.2 12C15.2 10.2327 13.7673 8.8 12 8.8C10.2327 8.8 8.8 10.2327 8.8 12C8.8 13.7673 10.2327 15.2 12 15.2Z" fill="#6a11cb"/>
|
<div class="attachment-icons">
|
||||||
<path d="M20 4H4C2.9 4 2 4.9 2 6V18C2 19.1 2.9 20 4 20H20C21.1 20 22 19.1 22 18V6C22 4.9 21.1 4 20 4ZM12 7.5C13.93 7.5 15.5 9.07 15.5 11C15.5 12.93 13.93 14.5 12 14.5C10.07 14.5 8.5 12.93 8.5 11C8.5 9.07 10.07 7.5 12 7.5ZM20 18H4V6.03C4 6.01 4.01 6 4.03 6H19.97C19.99 6 20 6.01 20 6.03V18Z" fill="#6a11cb"/>
|
<!-- Hanya ikon kamera yang tersisa -->
|
||||||
</svg>
|
<button class="icon-btn attachment-btn">
|
||||||
</button>
|
<i class="bi bi-camera"></i>
|
||||||
<button class="icon-btn">
|
</button>
|
||||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
</div>
|
||||||
<path d="M19 4H5C3.9 4 3 4.9 3 6V18C3 19.1 3.9 20 5 20H19C20.1 20 21 19.1 21 18V6C21 4.9 20.1 4 19 4ZM5 18V6H19V18H5Z" fill="#6a11cb"/>
|
</div>
|
||||||
<path d="M16.5 14.25C17.3284 14.25 18 13.5784 18 12.75C18 11.9216 17.3284 11.25 16.5 11.25C15.6716 11.25 15 11.9216 15 12.75C15 13.5784 15.6716 14.25 16.5 14.25Z" fill="#6a11cb"/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<input type="text" class="message-input" placeholder="Ketik pesan...">
|
|
||||||
|
|
||||||
<button class="send-btn">
|
<button class="send-btn">
|
||||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<i class="bi bi-send"></i>
|
||||||
<path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z" fill="#6a11cb"/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,6 +6,23 @@ function addMessage(content, isSent) {
|
|||||||
const message = document.createElement('div');
|
const message = document.createElement('div');
|
||||||
message.className = `message ${isSent ? 'sent' : 'received'}`;
|
message.className = `message ${isSent ? 'sent' : 'received'}`;
|
||||||
|
|
||||||
|
// Ambil inisial dari nama di header
|
||||||
|
const userName = document.querySelector('.user-details h2').textContent;
|
||||||
|
const userInitial = userName.split(' ').map(n => n[0]).join('').substring(0, 1); // Ambil huruf pertama saja
|
||||||
|
|
||||||
|
// Tambahkan avatar kecil untuk pesan masuk
|
||||||
|
if (!isSent) {
|
||||||
|
const smallAvatar = document.createElement('div');
|
||||||
|
smallAvatar.className = 'small-avatar';
|
||||||
|
smallAvatar.textContent = userInitial; // Gunakan inisial dari nama
|
||||||
|
message.appendChild(smallAvatar);
|
||||||
|
} else {
|
||||||
|
// Tambahkan ikon person untuk pesan keluar (dikirim oleh pengguna)
|
||||||
|
const personIcon = document.createElement('i');
|
||||||
|
personIcon.className = 'bi bi-person sent-user-icon';
|
||||||
|
message.appendChild(personIcon);
|
||||||
|
}
|
||||||
|
|
||||||
// Tambahkan konten pesan
|
// Tambahkan konten pesan
|
||||||
const messageContent = document.createElement('div');
|
const messageContent = document.createElement('div');
|
||||||
messageContent.className = 'message-content';
|
messageContent.className = 'message-content';
|
||||||
@@ -55,30 +72,6 @@ function hideTypingIndicator(indicator) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setup Intersection Observer untuk efek fade-out
|
|
||||||
function setupMessageObserver() {
|
|
||||||
const observer = new IntersectionObserver((entries) => {
|
|
||||||
entries.forEach(entry => {
|
|
||||||
if (!entry.isIntersecting) {
|
|
||||||
// Ketika elemen keluar dari viewport
|
|
||||||
entry.target.style.opacity = '0.3';
|
|
||||||
entry.target.style.transform = 'translateY(10px)';
|
|
||||||
} else {
|
|
||||||
// Ketika elemen masuk ke viewport
|
|
||||||
entry.target.style.opacity = '1';
|
|
||||||
entry.target.style.transform = 'translateY(0)';
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}, {
|
|
||||||
threshold: 0.1 // Trigger ketika 10% elemen masih terlihat
|
|
||||||
});
|
|
||||||
|
|
||||||
// Terapkan observer ke semua pesan
|
|
||||||
document.querySelectorAll('.message').forEach(message => {
|
|
||||||
observer.observe(message);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fungsi untuk mengirim pesan
|
// Fungsi untuk mengirim pesan
|
||||||
function sendMessage() {
|
function sendMessage() {
|
||||||
const input = document.querySelector('.message-input');
|
const input = document.querySelector('.message-input');
|
||||||
@@ -87,6 +80,7 @@ function sendMessage() {
|
|||||||
if (message) {
|
if (message) {
|
||||||
addMessage(message, true);
|
addMessage(message, true);
|
||||||
input.value = '';
|
input.value = '';
|
||||||
|
toggleAttachmentIcons(true); // Tampilkan kembali ikon setelah mengirim
|
||||||
|
|
||||||
// Simulasikan balasan otomatis setelah 2 detik
|
// Simulasikan balasan otomatis setelah 2 detik
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -101,6 +95,18 @@ function sendMessage() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Function to toggle attachment icons visibility
|
||||||
|
function toggleAttachmentIcons(show) {
|
||||||
|
const icons = document.querySelector('.attachment-icons');
|
||||||
|
if (show) {
|
||||||
|
icons.style.opacity = '1';
|
||||||
|
icons.style.transform = 'translateY(-50%)';
|
||||||
|
} else {
|
||||||
|
icons.style.opacity = '0';
|
||||||
|
icons.style.transform = 'translateY(-50%) translateX(20px)';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Event listener untuk tombol kirim
|
// Event listener untuk tombol kirim
|
||||||
document.querySelector('.send-btn').addEventListener('click', sendMessage);
|
document.querySelector('.send-btn').addEventListener('click', sendMessage);
|
||||||
|
|
||||||
@@ -111,6 +117,21 @@ document.querySelector('.message-input').addEventListener('keypress', (e) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Event listener untuk input text
|
||||||
|
const messageInput = document.querySelector('.message-input');
|
||||||
|
messageInput.addEventListener('input', function() {
|
||||||
|
if (this.value.trim() !== '') {
|
||||||
|
toggleAttachmentIcons(false);
|
||||||
|
} else {
|
||||||
|
toggleAttachmentIcons(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Initialize attachment icons
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
toggleAttachmentIcons(true);
|
||||||
|
});
|
||||||
|
|
||||||
// Inisialisasi chat setelah DOM selesai dimuat
|
// Inisialisasi chat setelah DOM selesai dimuat
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
// Tampilkan indikator mengetik saat halaman pertama dimuat
|
// Tampilkan indikator mengetik saat halaman pertama dimuat
|
||||||
@@ -122,5 +143,13 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
addMessage('Hai, ada yang bisa saya bantu?', false);
|
addMessage('Hai, ada yang bisa saya bantu?', false);
|
||||||
}, 3000);
|
}, 3000);
|
||||||
|
|
||||||
setupMessageObserver();
|
// Update avatar utama dengan inisial dari nama saat halaman dimuat
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
const userName = document.querySelector('.user-details h2').textContent;
|
||||||
|
const userInitial = userName.split(' ').map(n => n[0]).join('').substring(0, 1);
|
||||||
|
document.querySelector('.avatar').textContent = userInitial;
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Pastikan animasi mengetik muncul sebelum pesan sambutan
|
||||||
|
// (Sudah diimplementasikan di atas)
|
||||||
|
|||||||
@@ -11,21 +11,15 @@ body {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background:
|
background: linear-gradient(135deg, #0077b6, #023e8a);
|
||||||
linear-gradient(135deg, #6a11cb 0%, #2575fc 100%),
|
|
||||||
repeating-linear-gradient(45deg, rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 10px, transparent 10px, transparent 20px);
|
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Chat container styling */
|
|
||||||
.chat-container {
|
.chat-container {
|
||||||
background: rgba(255, 255, 255, 0.92);
|
background: rgba(255, 255, 255, 0.2);
|
||||||
backdrop-filter: blur(12px);
|
backdrop-filter: blur(20px);
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
box-shadow:
|
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
|
||||||
0 20px 50px rgba(0, 0, 0, 0.3),
|
|
||||||
0 0 0 2px rgba(255, 255, 255, 0.1) inset,
|
|
||||||
0 10px 30px rgba(0, 0, 0, 0.1) inset;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 800px;
|
max-width: 800px;
|
||||||
height: 90vh;
|
height: 90vh;
|
||||||
@@ -36,7 +30,6 @@ body {
|
|||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Glass effect header styling */
|
|
||||||
.chat-header {
|
.chat-header {
|
||||||
padding: 15px 20px;
|
padding: 15px 20px;
|
||||||
background: rgba(255, 255, 255, 0.25);
|
background: rgba(255, 255, 255, 0.25);
|
||||||
@@ -48,28 +41,40 @@ body {
|
|||||||
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 10;
|
z-index: 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Enhanced glass effect for both header and input area */
|
|
||||||
.chat-header, .input-area {
|
.chat-header, .input-area {
|
||||||
background: rgba(255, 255, 255, 0.18);
|
background: rgba(173, 232, 244, 0.5);
|
||||||
backdrop-filter: blur(15px);
|
backdrop-filter: blur(30px);
|
||||||
-webkit-backdrop-filter: blur(15px);
|
-webkit-backdrop-filter: blur(30px);
|
||||||
border: 1px solid rgba(255, 255, 255, 0.25);
|
border: 1px solid rgba(255, 255, 255, 0.4);
|
||||||
|
z-index: 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-info {
|
.user-info {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 15px;
|
gap: 15px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-details {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-role {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
opacity: 0.7;
|
||||||
|
margin-top: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.avatar {
|
.avatar {
|
||||||
width: 50px;
|
width: 50px;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background: linear-gradient(to right, #6a11cb, #2575fc);
|
background: #0096c7;
|
||||||
color: white;
|
color: white;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@@ -78,7 +83,6 @@ body {
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Floating circles background */
|
|
||||||
.floating-circles {
|
.floating-circles {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -95,88 +99,16 @@ body {
|
|||||||
list-style: none;
|
list-style: none;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
background: rgba(106, 17, 203, 0.15);
|
background: rgba(72, 202, 228, 0.5);
|
||||||
animation: floating 25s linear infinite;
|
animation: floating 25s linear infinite;
|
||||||
bottom: -150px;
|
bottom: -150px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
|
z-index: 1;
|
||||||
|
animation-fill-mode: both; /* Smoother animation */
|
||||||
}
|
}
|
||||||
|
|
||||||
.floating-circles li:nth-child(1) {
|
/* Konfigurasi floating circles... */
|
||||||
left: 25%;
|
|
||||||
width: 80px;
|
|
||||||
height: 80px;
|
|
||||||
animation-delay: 0s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.floating-circles li:nth-child(2) {
|
|
||||||
left: 10%;
|
|
||||||
width: 20px;
|
|
||||||
height: 20px;
|
|
||||||
animation-delay: 2s;
|
|
||||||
animation-duration: 12s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.floating-circles li:nth-child(3) {
|
|
||||||
left: 70%;
|
|
||||||
width: 20px;
|
|
||||||
height: 20px;
|
|
||||||
animation-delay: 4s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.floating-circles li:nth-child(4) {
|
|
||||||
left: 40%;
|
|
||||||
width: 60px;
|
|
||||||
height: 60px;
|
|
||||||
animation-delay: 0s;
|
|
||||||
animation-duration: 18s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.floating-circles li:nth-child(5) {
|
|
||||||
left: 65%;
|
|
||||||
width: 20px;
|
|
||||||
height: 20px;
|
|
||||||
animation-delay: 0s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.floating-circles li:nth-child(6) {
|
|
||||||
left: 75%;
|
|
||||||
width: 110px;
|
|
||||||
height: 110px;
|
|
||||||
animation-delay: 3s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.floating-circles li:nth-child(7) {
|
|
||||||
left: 35%;
|
|
||||||
width: 150px;
|
|
||||||
height: 150px;
|
|
||||||
animation-delay: 7s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.floating-circles li:nth-child(8) {
|
|
||||||
left: 50%;
|
|
||||||
width: 25px;
|
|
||||||
height: 25px;
|
|
||||||
animation-delay: 15s;
|
|
||||||
animation-duration: 45s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.floating-circles li:nth-child(9) {
|
|
||||||
left: 20%;
|
|
||||||
width: 15px;
|
|
||||||
height: 15px;
|
|
||||||
animation-delay: 2s;
|
|
||||||
animation-duration: 35s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.floating-circles li:nth-child(10) {
|
|
||||||
left: 85%;
|
|
||||||
width: 150px;
|
|
||||||
height: 150px;
|
|
||||||
animation-delay: 0s;
|
|
||||||
animation-duration: 11s;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Floating animation */
|
|
||||||
@keyframes floating {
|
@keyframes floating {
|
||||||
0% {
|
0% {
|
||||||
transform: translateY(0) rotate(0deg);
|
transform: translateY(0) rotate(0deg);
|
||||||
@@ -190,7 +122,6 @@ body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Chat area styling */
|
|
||||||
.chat-area {
|
.chat-area {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
@@ -199,6 +130,7 @@ body {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 15px;
|
gap: 15px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.message {
|
.message {
|
||||||
@@ -212,38 +144,41 @@ body {
|
|||||||
|
|
||||||
.message.received {
|
.message.received {
|
||||||
align-self: flex-start;
|
align-self: flex-start;
|
||||||
background: #f0f0f0;
|
background: rgba(173, 232, 244, 0.8);
|
||||||
|
color: #03045e;
|
||||||
border-bottom-left-radius: 4px;
|
border-bottom-left-radius: 4px;
|
||||||
|
backdrop-filter: blur(5px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.message.sent {
|
.message.sent {
|
||||||
align-self: flex-end;
|
align-self: flex-end;
|
||||||
background: linear-gradient(to right, #6a11cb, #2575fc);
|
background: white;
|
||||||
color: white;
|
color: #03045e;
|
||||||
border-bottom-right-radius: 4px;
|
border-bottom-right-radius: 4px;
|
||||||
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.message-content {
|
.message-content {
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
|
color: #001f3f; /* Navy blue text */
|
||||||
}
|
}
|
||||||
|
|
||||||
.message-time {
|
.message-time {
|
||||||
font-size: 0.7rem;
|
font-size: 0.7rem;
|
||||||
text-align: right;
|
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
|
color: #001f3f; /* Navy blue text */
|
||||||
}
|
}
|
||||||
|
|
||||||
.message.sent .message-time {
|
.message.sent .message-time {
|
||||||
color: rgba(255, 255, 255, 0.7);
|
text-align: left; /* Move to left for user bubble */
|
||||||
}
|
}
|
||||||
|
|
||||||
.message.received .message-time {
|
.message.received .message-time {
|
||||||
color: rgba(0, 0, 0, 0.5);
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Input area styling with animation and glass effect */
|
|
||||||
.input-area {
|
.input-area {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
@@ -253,12 +188,59 @@ body {
|
|||||||
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
||||||
position: sticky;
|
position: sticky;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
z-index: 10;
|
z-index: 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-wrapper {
|
||||||
|
flex-grow: 1;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.attachment-icons {
|
||||||
|
position: absolute;
|
||||||
|
right: 10px;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
display: flex;
|
||||||
|
gap: 5px;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message-input:not(:placeholder-shown) + .attachment-icons {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(-50%) translateX(20px);
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message-input {
|
||||||
|
flex-grow: 1;
|
||||||
|
padding: 12px 45px 12px 15px;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-radius: 12px;
|
||||||
|
background: white;
|
||||||
|
font-size: 16px;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05) inset;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.send-btn {
|
||||||
|
background: #0096c7;
|
||||||
|
border: none;
|
||||||
|
border-radius: 12px;
|
||||||
|
width: 50px;
|
||||||
|
height: 45px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
box-shadow: 0 5px 15px rgba(0, 150, 199, 0.4);
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-area:focus-within {
|
.input-area:focus-within {
|
||||||
transform: translateY(-5px);
|
box-shadow: 0 0 15px rgba(72, 202, 228, 0.6);
|
||||||
box-shadow: 0 -5px 20px rgba(106, 17, 203, 0.2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-btn {
|
.icon-btn {
|
||||||
@@ -275,67 +257,24 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.icon-btn:hover {
|
.icon-btn:hover {
|
||||||
background: rgba(106, 17, 203, 0.1);
|
background: rgba(0, 150, 199, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-btn svg {
|
.icon-btn .bi {
|
||||||
width: 24px;
|
font-size: 24px;
|
||||||
height: 24px;
|
color: #5f6368;
|
||||||
fill: #6a11cb;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Efek untuk pesan saat keluar dari viewport */
|
.send-btn .bi {
|
||||||
.message:not(:hover) {
|
font-size: 24px; /* Same as camera icon */
|
||||||
transition: opacity 0.5s ease, transform 0.5s ease;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.message-input {
|
.attachment-icons .icon-btn {
|
||||||
flex-grow: 1;
|
width: 40px;
|
||||||
padding: 12px 15px;
|
height: 40px;
|
||||||
border: 1px solid #ddd;
|
|
||||||
border-radius: 25px;
|
|
||||||
background: white;
|
|
||||||
font-size: 16px;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05) inset;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.message-input:focus {
|
|
||||||
border-color: #6a11cb;
|
|
||||||
box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.2);
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.send-btn {
|
|
||||||
background: linear-gradient(to right, #6a11cb, #2575fc);
|
|
||||||
border: none;
|
|
||||||
border-radius: 50%;
|
|
||||||
width: 45px;
|
|
||||||
height: 45px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
box-shadow: 0 5px 15px rgba(37, 117, 252, 0.4);
|
|
||||||
}
|
|
||||||
|
|
||||||
.send-btn:active {
|
|
||||||
transform: scale(0.95);
|
|
||||||
}
|
|
||||||
|
|
||||||
.send-btn:hover {
|
|
||||||
transform: scale(1.05);
|
|
||||||
box-shadow: 0 8px 20px rgba(37, 117, 252, 0.6);
|
|
||||||
}
|
|
||||||
|
|
||||||
.send-btn svg {
|
|
||||||
width: 24px;
|
|
||||||
height: 24px;
|
|
||||||
fill: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Animations */
|
|
||||||
@keyframes fadeIn {
|
@keyframes fadeIn {
|
||||||
from {
|
from {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
@@ -347,7 +286,6 @@ body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Typing animation */
|
|
||||||
@keyframes wave {
|
@keyframes wave {
|
||||||
0%, 60%, 100% {
|
0%, 60%, 100% {
|
||||||
transform: scaleY(0.4);
|
transform: scaleY(0.4);
|
||||||
@@ -357,7 +295,52 @@ body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Typing indicator */
|
.small-avatar {
|
||||||
|
position: absolute;
|
||||||
|
bottom: -15px; /* Move to bottom */
|
||||||
|
left: 10px; /* Center horizontally */
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #0096c7;
|
||||||
|
color: white;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 18px; /* Increase font size for icon */
|
||||||
|
border: 2px solid white;
|
||||||
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
||||||
|
z-index: 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message.received {
|
||||||
|
position: relative;
|
||||||
|
margin-top: 20px;
|
||||||
|
padding-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message.sent {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sent-user-icon {
|
||||||
|
position: absolute;
|
||||||
|
bottom: -15px; /* Move to bottom */
|
||||||
|
right: 10px; /* Align to right with some margin */
|
||||||
|
font-size: 24px;
|
||||||
|
color: #0096c7;
|
||||||
|
background: white;
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
border: 2px solid white;
|
||||||
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
||||||
|
z-index: 5;
|
||||||
|
}
|
||||||
|
|
||||||
.typing-indicator {
|
.typing-indicator {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-self: flex-start;
|
align-self: flex-start;
|
||||||
@@ -378,7 +361,7 @@ body {
|
|||||||
width: 6px;
|
width: 6px;
|
||||||
height: 6px;
|
height: 6px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background: #6a11cb;
|
background: #48cae4;
|
||||||
margin: 0 2px;
|
margin: 0 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -394,7 +377,6 @@ body {
|
|||||||
animation: wave 1.2s infinite 0.4s;
|
animation: wave 1.2s infinite 0.4s;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Responsive design */
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.chat-container {
|
.chat-container {
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
|||||||
6
color-pallete.md
Normal file
6
color-pallete.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
03045e
|
||||||
|
023e8a
|
||||||
|
0077b6
|
||||||
|
0096c7
|
||||||
|
48cae4
|
||||||
|
ade8f4
|
||||||
@@ -11,7 +11,7 @@ body {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
|
background: linear-gradient(135deg, #0077b6, #023e8a); /* Same as chat page */
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ body {
|
|||||||
|
|
||||||
.background-animation i {
|
.background-animation i {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background: rgba(255, 255, 255, 0.6);
|
background: rgba(72, 202, 228, 0.4); /* #48cae4 with transparency */
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
animation: float linear infinite;
|
animation: float linear infinite;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
@@ -89,12 +89,11 @@ body {
|
|||||||
|
|
||||||
/* Login container styling */
|
/* Login container styling */
|
||||||
.login-container {
|
.login-container {
|
||||||
background: rgba(255, 255, 255, 0.9);
|
background: rgba(255, 255, 255, 0.9); /* Slightly transparent white */
|
||||||
backdrop-filter: blur(10px);
|
backdrop-filter: blur(20px); /* Frosted glass effect */
|
||||||
|
-webkit-backdrop-filter: blur(20px);
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2),
|
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
|
||||||
0 0 0 2px rgba(255, 255, 255, 0.1) inset,
|
|
||||||
0 10px 20px rgba(0, 0, 0, 0.1) inset;
|
|
||||||
padding: 40px;
|
padding: 40px;
|
||||||
width: 90%;
|
width: 90%;
|
||||||
max-width: 450px;
|
max-width: 450px;
|
||||||
@@ -144,7 +143,7 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.toggle-btn.active {
|
.toggle-btn.active {
|
||||||
background: #6a11cb;
|
background: #0096c7; /* New blue from palette */
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,9 +170,9 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.input-group input:focus,
|
.input-group input:focus,
|
||||||
.phone-input-wrapper:focus-within {
|
.phone-input-wrapper:极focus-within {
|
||||||
border-color: #6a11cb;
|
border-color: #48cae4;
|
||||||
box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.2);
|
box-shadow: 0 0 0 3px rgba(72, 202, 228, 0.2);
|
||||||
transform: translateY(-2px);
|
transform: translateY(-2px);
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
@@ -225,7 +224,7 @@ body {
|
|||||||
.login-btn {
|
.login-btn {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
background: linear-gradient(to right, #6a11cb, #2575fc);
|
background: #0096c7; /* New blue from palette */
|
||||||
color: white;
|
color: white;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
@@ -233,7 +232,7 @@ body {
|
|||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
box-shadow: 0 5px 15px rgba(37, 117, 252, 0.4);
|
box-shadow: 0 5px 15px rgba(0, 150, 199, 0.4);
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
@@ -255,14 +254,14 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.links a {
|
.links a {
|
||||||
color: #6a11cb;
|
color: #48cae4; /* New light blue from palette */
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
transition: color 0.3s ease;
|
transition: color 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.links a:hover {
|
.links a:hover {
|
||||||
color: #2575fc;
|
color: #03045e; /* Darkest blue from palette */
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user