tam add chat

This commit is contained in:
2026-06-30 10:53:51 +07:00
parent 6e284e66fa
commit dc86524ff0
6 changed files with 298 additions and 176 deletions

View File

@@ -490,127 +490,148 @@ body {
white-space: nowrap;
}
/* Student chat messenger */
/* Student chat — modal 2 panel giống web */
.student-chat-dock {
position: fixed;
right: 12px;
bottom: 12px;
z-index: 1000;
right: 16px;
bottom: 16px;
z-index: 2000;
pointer-events: none;
}
.student-chat-toast {
position: absolute;
right: 0;
bottom: 64px;
width: 260px;
padding: 0.65rem 0.75rem;
border-radius: 10px;
background: #1e293b;
color: #fff;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
font-size: 0.78rem;
display: flex;
flex-direction: column;
gap: 0.2rem;
.student-chat-dock > * {
pointer-events: auto;
}
.student-chat-fab {
position: relative;
width: 48px;
height: 48px;
width: 50px;
height: 50px;
border-radius: 50%;
border: none;
background: var(--accent);
color: #fff;
font-size: 1.15rem;
cursor: pointer;
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}
.student-chat-fab.is-hidden {
display: none;
}
.student-chat-fab--pulse {
animation: chat-fab-pulse 0.6s ease 2;
}
@keyframes chat-fab-pulse {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(187, 33, 38, 0.25); }
}
.student-chat-badge {
position: absolute;
top: -2px;
right: -2px;
min-width: 16px;
height: 16px;
padding: 0 4px;
border-radius: 8px;
top: -3px;
right: -3px;
min-width: 18px;
height: 18px;
padding: 0 5px;
border-radius: 9px;
background: #ef4444;
color: #fff;
font-size: 0.62rem;
font-weight: 700;
line-height: 16px;
line-height: 18px;
}
.student-chat-messenger {
.student-chat-modal {
display: none;
position: absolute;
right: 0;
bottom: 58px;
width: min(520px, calc(100vw - 24px));
height: min(400px, calc(100vh - 80px));
bottom: 60px;
width: min(560px, calc(100vw - 32px));
height: min(440px, calc(100vh - 100px));
background: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: 12px;
box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
display: flex;
box-shadow: 0 16px 48px rgba(0, 0, 0, 0.38);
flex-direction: column;
overflow: hidden;
}
.student-chat-messenger-head {
.student-chat-modal.is-open {
display: flex;
}
.student-chat-modal-head {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.55rem 0.7rem;
justify-content: space-between;
padding: 0.65rem 0.85rem;
border-bottom: 1px solid var(--border-color);
font-size: 0.82rem;
flex-shrink: 0;
font-size: 0.88rem;
}
.student-chat-close {
border: none;
background: none;
background: transparent;
color: var(--text-muted);
font-size: 1.1rem;
width: 30px;
height: 30px;
border-radius: 6px;
cursor: pointer;
font-size: 1.25rem;
line-height: 1;
}
.student-chat-messenger-body {
display: flex;
.student-chat-close:hover {
background: rgba(187, 33, 38, 0.12);
color: var(--accent);
}
.student-chat-modal-body {
flex: 1;
min-height: 0;
display: flex;
overflow: hidden;
}
.student-chat-sidebar {
width: 150px;
width: 200px;
flex-shrink: 0;
border-right: 1px solid var(--border-color);
overflow-y: auto;
background: rgba(255, 255, 255, 0.02);
display: flex;
flex-direction: column;
overscroll-behavior: contain;
background: rgba(0, 0, 0, 0.06);
}
.student-chat-conv-btn {
.student-chat-conv-row {
width: 100%;
text-align: left;
border: none;
background: transparent;
padding: 0.55rem 0.5rem;
padding: 0.7rem 0.75rem;
cursor: pointer;
border-bottom: 1px solid var(--border-color);
color: var(--text-primary);
}
.student-chat-conv-btn.active {
.student-chat-conv-row:hover {
background: rgba(255, 255, 255, 0.04);
}
.student-chat-conv-row.active {
background: rgba(187, 33, 38, 0.12);
border-left: 2px solid var(--accent);
border-left: 3px solid var(--accent);
}
.student-chat-conv-name {
display: flex;
justify-content: space-between;
font-size: 0.72rem;
align-items: center;
gap: 0.35rem;
font-size: 0.78rem;
font-weight: 600;
}
@@ -621,29 +642,32 @@ body {
border-radius: 8px;
padding: 0 5px;
font-size: 0.6rem;
font-weight: 700;
flex-shrink: 0;
}
.student-chat-conv-preview {
display: block;
font-size: 0.65rem;
font-size: 0.7rem;
color: var(--text-muted);
margin-top: 0.2rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-top: 0.15rem;
}
.student-chat-thread {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
min-width: 0;
overflow: hidden;
}
.student-chat-thread-head {
padding: 0.45rem 0.65rem;
padding: 0.55rem 0.75rem;
border-bottom: 1px solid var(--border-color);
font-size: 0.75rem;
font-size: 0.8rem;
font-weight: 600;
flex-shrink: 0;
}
@@ -651,43 +675,38 @@ body {
.student-chat-messages {
flex: 1;
overflow-y: auto;
padding: 0.55rem;
overscroll-behavior: contain;
padding: 0.65rem 0.75rem;
display: flex;
flex-direction: column;
gap: 0.4rem;
background: rgba(0, 0, 0, 0.12);
background: rgba(0, 0, 0, 0.06);
}
.student-chat-empty {
font-size: 0.72rem;
font-size: 0.78rem;
color: var(--text-muted);
text-align: center;
padding: 1rem 0.5rem;
padding: 1.5rem 0.75rem;
}
.student-chat-bubble {
max-width: 88%;
font-size: 0.76rem;
max-width: 82%;
font-size: 0.8rem;
}
.student-chat-bubble--staff { align-self: flex-start; }
.student-chat-bubble--student { align-self: flex-end; }
.student-chat-label {
font-size: 0.6rem;
color: var(--text-muted);
margin-bottom: 0.1rem;
}
.student-chat-body {
padding: 0.4rem 0.55rem;
border-radius: 10px;
line-height: 1.35;
padding: 0.45rem 0.6rem;
border-radius: 12px;
line-height: 1.4;
word-break: break-word;
}
.student-chat-bubble--staff .student-chat-body {
background: rgba(255, 255, 255, 0.06);
background: rgba(255, 255, 255, 0.08);
border: 1px solid var(--border-color);
}
@@ -697,33 +716,31 @@ body {
}
.student-chat-time {
font-size: 0.58rem;
font-size: 0.6rem;
color: var(--text-muted);
margin-top: 0.1rem;
margin-top: 0.12rem;
padding: 0 0.2rem;
}
.student-chat-compose {
display: flex;
gap: 0.35rem;
padding: 0.45rem 0.55rem;
gap: 0.45rem;
padding: 0.55rem 0.7rem;
border-top: 1px solid var(--border-color);
flex-shrink: 0;
background: var(--bg-card);
}
.student-chat-compose input {
flex: 1;
font-size: 0.74rem;
padding: 0.4rem 0.5rem;
font-size: 0.8rem;
padding: 0.5rem 0.6rem;
border-radius: 8px;
border: 1px solid var(--border-color);
background: var(--bg-base);
color: var(--text-primary);
}
.student-chat-compose input:disabled {
opacity: 0.5;
}
.shifts-wrap {
flex: 1;
min-height: 0;