srsViewer/public/css/chat.css
creations a3b03fdec4
All checks were successful
Code quality checks / biome (push) Successful in 22s
add chat :p
2025-06-08 19:57:50 -04:00

453 lines
6.9 KiB
CSS

* {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background: var(--bg-primary);
color: var(--text-primary);
height: 100vh;
overflow: hidden;
}
.chat-widget {
height: 100vh;
display: flex;
flex-direction: column;
background: var(--bg-card);
border: 1px solid var(--border-primary);
}
.chat-header {
padding: 0.5rem;
border-bottom: 1px solid var(--border-primary);
background: var(--bg-secondary);
flex-shrink: 0;
}
.username-section {
display: flex;
gap: 0.5rem;
align-items: center;
}
.username-section .username-input {
flex: 1;
padding: 0.375rem;
font-size: 0.75rem;
border: 1px solid var(--border-primary);
border-radius: 0.25rem;
background: var(--bg-input);
color: var(--text-primary);
}
.username-section .username-input:focus {
outline: none;
border-color: var(--accent-blue);
}
.username-section .username-input::placeholder {
color: var(--text-secondary);
}
.chat-messages {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
min-height: 0;
}
.loading-state,
.error-state,
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 1rem;
flex: 1;
}
.loading-state p,
.error-state p,
.empty-state p {
margin: 0.25rem 0 0 0;
font-size: 0.75rem;
color: var(--text-secondary);
}
.error-state p {
color: var(--accent-red);
}
.retry-btn {
background: var(--accent-blue);
color: white;
border: none;
padding: 0.375rem 0.75rem;
border-radius: 0.25rem;
font-size: 0.75rem;
cursor: pointer;
margin-top: 0.375rem;
}
.retry-btn:hover {
background: #2563eb;
}
.messages-container {
flex: 1;
overflow-y: auto;
padding: 0.5rem;
display: flex;
flex-direction: column;
gap: 0.375rem;
}
.message {
padding: 0.375rem 0.5rem;
background: var(--bg-secondary);
border: 1px solid var(--border-primary);
border-radius: 0.375rem;
font-size: 0.75rem;
animation: messageSlideIn 0.2s ease-out;
}
.message.system-message {
background: var(--bg-primary);
opacity: 0.7;
text-align: center;
font-style: italic;
padding: 0.25rem 0.5rem;
}
.message-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 0.125rem;
}
.message-username {
font-weight: 600;
color: var(--accent-blue);
font-size: 0.6875rem;
}
.message-time {
font-size: 0.625rem;
color: var(--text-muted);
}
.message-content {
color: var(--text-primary);
word-wrap: break-word;
line-height: 1.2;
font-size: 0.6875rem;
}
.chat-input-form {
padding: 0.5rem;
border-top: 1px solid var(--border-primary);
background: var(--bg-secondary);
flex-shrink: 0;
}
.message-row {
display: flex;
gap: 0.375rem;
align-items: center;
}
.message-input {
flex: 1;
padding: 0.375rem;
font-size: 0.75rem;
border: 1px solid var(--border-primary);
border-radius: 0.25rem;
background: var(--bg-input);
color: var(--text-primary);
}
.message-input:focus {
outline: none;
border-color: var(--accent-blue);
}
.message-input::placeholder {
color: var(--text-secondary);
}
.send-btn {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
background: var(--accent-blue);
border: none;
border-radius: 0.25rem;
color: white;
cursor: pointer;
flex-shrink: 0;
}
.send-btn:hover:not(:disabled) {
background: #2563eb;
}
.send-btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.send-btn svg {
width: 14px;
height: 14px;
}
@keyframes messageSlideIn {
from {
opacity: 0;
transform: translateY(3px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.messages-container::-webkit-scrollbar {
width: 4px;
}
.messages-container::-webkit-scrollbar-track {
background: var(--bg-primary);
}
.messages-container::-webkit-scrollbar-thumb {
background: var(--border-secondary);
border-radius: 2px;
}
.messages-container::-webkit-scrollbar-thumb:hover {
background: var(--border-accent);
}
.settings-container {
position: relative;
display: inline-block;
}
.settings-btn {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
background: none;
border: none;
color: var(--text-secondary);
cursor: pointer;
border-radius: 0.25rem;
transition: all 0.2s ease;
flex-shrink: 0;
}
.settings-btn:hover {
color: var(--text-primary);
background: var(--bg-primary);
}
.settings-btn svg {
width: 14px;
height: 14px;
}
.settings-dropdown {
position: absolute;
top: 100%;
right: 0;
background: var(--bg-card);
border: 1px solid var(--border-primary);
border-radius: 0.375rem;
padding: 0.5rem;
min-width: 160px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
z-index: 1000;
display: none;
margin-top: 0.375rem;
}
.settings-dropdown h4 {
margin: 0 0 0.5rem 0;
color: var(--text-primary);
font-size: 0.75rem;
font-weight: 600;
}
.setting-item {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 0.375rem;
padding: 0.125rem 0;
}
.setting-item:last-child {
margin-bottom: 0;
}
.setting-label {
color: var(--text-secondary);
font-size: 0.6875rem;
}
.setting-toggle {
position: relative;
width: 32px;
height: 16px;
}
.setting-toggle input {
opacity: 0;
width: 0;
height: 0;
}
.toggle-slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: var(--border-secondary);
transition: 0.3s;
border-radius: 16px;
}
.toggle-slider:before {
position: absolute;
content: "";
height: 12px;
width: 12px;
left: 2px;
bottom: 2px;
background-color: var(--text-primary);
transition: 0.3s;
border-radius: 50%;
}
input:checked + .toggle-slider {
background-color: var(--accent-blue);
}
input:checked + .toggle-slider:before {
transform: translateX(16px);
}
.message-image-container {
margin: 0.25rem 0;
}
.message-image {
max-width: 200px !important;
max-height: 120px !important;
border-radius: 4px !important;
margin: 0.25rem 0 !important;
display: block !important;
}
@media (max-width: 400px) {
.chat-header {
padding: 0.375rem;
}
.username-section {
gap: 0.375rem;
}
.username-section .username-input {
font-size: 0.6875rem;
padding: 0.25rem;
}
.settings-btn {
width: 28px;
height: 28px;
}
.settings-btn svg {
width: 12px;
height: 12px;
}
.message-input {
font-size: 0.6875rem;
padding: 0.25rem;
}
.send-btn {
width: 28px;
height: 28px;
}
.send-btn svg {
width: 12px;
height: 12px;
}
.message {
padding: 0.25rem 0.375rem;
}
.message-content,
.message-username {
font-size: 0.625rem;
}
.message-time {
font-size: 0.5625rem;
}
.messages-container {
padding: 0.375rem;
}
.chat-input-form {
padding: 0.375rem;
}
.message-row {
gap: 0.25rem;
}
}
@media (max-width: 280px) {
.username-section .username-input {
min-width: 0;
font-size: 0.625rem;
}
.settings-btn,
.send-btn {
width: 24px;
height: 24px;
min-width: 24px;
}
.settings-btn svg,
.send-btn svg {
width: 10px;
height: 10px;
}
.message-input {
font-size: 0.625rem;
min-width: 0;
}
}