276 lines
5.6 KiB
CSS
276 lines
5.6 KiB
CSS
/* backend/static/css/message-context-menu.css */
|
||
|
||
/* Сообщения становятся интерактивными */
|
||
[data-message-id] {
|
||
cursor: pointer;
|
||
user-select: none;
|
||
-webkit-user-select: none;
|
||
-webkit-touch-callout: none;
|
||
position: relative;
|
||
}
|
||
|
||
/* Контекстное меню сообщения */
|
||
.message-context-menu {
|
||
position: fixed;
|
||
z-index: 9999;
|
||
background: #ffffff;
|
||
border-radius: 16px;
|
||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
|
||
min-width: 280px;
|
||
max-width: 320px;
|
||
opacity: 0;
|
||
transform: scale(0.9);
|
||
transition: opacity 0.2s ease, transform 0.2s ease;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.message-context-menu.show {
|
||
opacity: 1;
|
||
transform: scale(1);
|
||
}
|
||
|
||
/* Backdrop для мобильных */
|
||
.message-context-menu::before {
|
||
content: '';
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: 0;
|
||
background: rgba(0, 0, 0, 0.4);
|
||
z-index: -1;
|
||
opacity: 0;
|
||
transition: opacity 0.2s ease;
|
||
pointer-events: none;
|
||
}
|
||
|
||
.message-context-menu.show::before {
|
||
opacity: 1;
|
||
}
|
||
|
||
/* На десктопе backdrop не нужен */
|
||
@media (hover: hover) and (pointer: fine) {
|
||
.message-context-menu::before {
|
||
display: none;
|
||
}
|
||
}
|
||
|
||
/* Подсветка выбранного сообщения */
|
||
.message-highlighted {
|
||
background-color: rgba(13, 110, 253, 0.08) !important;
|
||
transition: background-color 0.2s ease;
|
||
}
|
||
|
||
/* Секция быстрых реакций */
|
||
.quick-reactions {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: 8px;
|
||
padding: 16px;
|
||
border-bottom: 1px solid #e9ecef;
|
||
background: #f8f9fa;
|
||
}
|
||
|
||
.quick-reaction-btn {
|
||
width: 44px;
|
||
height: 44px;
|
||
border: none;
|
||
background: #ffffff;
|
||
border-radius: 50%;
|
||
font-size: 24px;
|
||
cursor: pointer;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
transition: all 0.2s ease;
|
||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
|
||
}
|
||
|
||
.quick-reaction-btn:hover {
|
||
transform: scale(1.2);
|
||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
|
||
}
|
||
|
||
.quick-reaction-btn:active {
|
||
transform: scale(1.1);
|
||
}
|
||
|
||
/* Секция действий */
|
||
.menu-actions {
|
||
padding: 8px 0;
|
||
}
|
||
|
||
.menu-action {
|
||
width: 100%;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 12px;
|
||
padding: 12px 16px;
|
||
border: none;
|
||
background: transparent;
|
||
cursor: pointer;
|
||
transition: background-color 0.15s ease;
|
||
font-size: 15px;
|
||
color: #212529;
|
||
text-align: left;
|
||
}
|
||
|
||
.menu-action:hover {
|
||
background-color: #f8f9fa;
|
||
}
|
||
|
||
.menu-action:active {
|
||
background-color: #e9ecef;
|
||
}
|
||
|
||
.menu-action i {
|
||
font-size: 18px;
|
||
width: 24px;
|
||
text-align: center;
|
||
color: #6c757d;
|
||
}
|
||
|
||
.menu-action span {
|
||
flex: 1;
|
||
font-weight: 500;
|
||
}
|
||
|
||
/* Опасное действие (удаление) */
|
||
.menu-action-danger {
|
||
color: #dc3545;
|
||
}
|
||
|
||
.menu-action-danger i {
|
||
color: #dc3545;
|
||
}
|
||
|
||
.menu-action-danger:hover {
|
||
background-color: #fff5f5;
|
||
}
|
||
|
||
/* Toast уведомление */
|
||
.context-menu-toast {
|
||
position: fixed;
|
||
bottom: 80px;
|
||
left: 50%;
|
||
transform: translateX(-50%) translateY(20px);
|
||
background: rgba(0, 0, 0, 0.85);
|
||
color: white;
|
||
padding: 12px 24px;
|
||
border-radius: 24px;
|
||
font-size: 14px;
|
||
font-weight: 500;
|
||
z-index: 10000;
|
||
opacity: 0;
|
||
transition: opacity 0.3s ease, transform 0.3s ease;
|
||
pointer-events: none;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.context-menu-toast.show {
|
||
opacity: 1;
|
||
transform: translateX(-50%) translateY(0);
|
||
}
|
||
|
||
/* Тёмная тема */
|
||
@media (prefers-color-scheme: dark) {
|
||
.message-context-menu {
|
||
background: #2b2d31;
|
||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
|
||
}
|
||
|
||
.message-highlighted {
|
||
background-color: rgba(88, 101, 242, 0.15) !important;
|
||
}
|
||
|
||
.quick-reactions {
|
||
background: #1e1f22;
|
||
border-bottom-color: #3f4147;
|
||
}
|
||
|
||
.quick-reaction-btn {
|
||
background: #383a40;
|
||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
||
}
|
||
|
||
.quick-reaction-btn:hover {
|
||
background: #42444a;
|
||
}
|
||
|
||
.menu-action {
|
||
color: #dbdee1;
|
||
}
|
||
|
||
.menu-action:hover {
|
||
background-color: #35373c;
|
||
}
|
||
|
||
.menu-action:active {
|
||
background-color: #3f4147;
|
||
}
|
||
|
||
.menu-action i {
|
||
color: #b5bac1;
|
||
}
|
||
|
||
.menu-action-danger {
|
||
color: #f23f43;
|
||
}
|
||
|
||
.menu-action-danger i {
|
||
color: #f23f43;
|
||
}
|
||
|
||
.menu-action-danger:hover {
|
||
background-color: rgba(242, 63, 67, 0.1);
|
||
}
|
||
}
|
||
|
||
/* Адаптация для мобильных */
|
||
@media (max-width: 576px) {
|
||
.message-context-menu {
|
||
min-width: calc(100vw - 32px);
|
||
max-width: calc(100vw - 32px);
|
||
left: 16px !important;
|
||
right: 16px;
|
||
bottom: 16px !important;
|
||
top: auto !important;
|
||
transform-origin: center bottom;
|
||
}
|
||
|
||
.quick-reactions {
|
||
justify-content: center;
|
||
}
|
||
|
||
.quick-reaction-btn {
|
||
width: 48px;
|
||
height: 48px;
|
||
font-size: 26px;
|
||
}
|
||
|
||
.menu-action {
|
||
padding: 16px 20px;
|
||
font-size: 16px;
|
||
}
|
||
|
||
.menu-action i {
|
||
font-size: 20px;
|
||
}
|
||
}
|
||
|
||
/* Скрыть старую кнопку "+" при наличии контекстного меню */
|
||
.message-context-menu-enabled .reaction-button.add-reaction {
|
||
display: none !important;
|
||
}
|
||
|
||
/* Анимация вибрации для долгого нажатия (опционально) */
|
||
@keyframes vibrate {
|
||
0%, 100% { transform: translateX(0); }
|
||
25% { transform: translateX(-2px); }
|
||
75% { transform: translateX(2px); }
|
||
}
|
||
|
||
.message-vibrating {
|
||
animation: vibrate 0.1s linear;
|
||
}
|