/
spirzen
/
it-knowledge-base
Обзор
Документация
Войти
/
spirzen
/
it-knowledge-base
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
Mobile
src/components/MessageBrokerDemo.module.css
451 строка
8 KB
Spirzen
Components Rework
19 май 2026, 19:17
19 май 2026, 19:17
d8d92a3
Код
Авторство
О чём код?
.root { --mb-producer: var(--ifm-color-primary); --mb-broker: #5c6bc0; --mb-exchange: #7e57c2; --mb-queue: #ff9800; --mb-consumer-a: #2e7d32; --mb-consumer-b: #c62828; --mb-kafka: #231f20; --mb-partition: #e65100; } .diagram { display: flex; flex-direction: column; gap: 1rem; } .flowRow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 0.35rem; } .flowRowCompact { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.35rem; } @media (max-width: 768px) { .flowRow, .flowRowCompact { grid-template-columns: 1fr; gap: 0.5rem; } .track { min-height: 28px; min-width: unset; width: 100%; } .trackInner { flex-direction: row; } .trackArrow { transform: rotate(90deg); } } .node { position: relative; padding: 0.75rem 0.65rem; border-radius: 10px; border: 2px solid var(--demo-border, var(--ifm-color-emphasis-300)); background: var(--ifm-background-surface-color); text-align: center; transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease, opacity 0.25s ease; } .nodeDim { opacity: 0.55; } .nodeActive { transform: translateY(-2px); box-shadow: 0 0 0 3px color-mix(in srgb, var(--node-accent, var(--ifm-color-primary)) 24%, transparent); border-color: var(--node-accent, var(--ifm-color-primary)); } .nodeIcon { font-size: 1.45rem; line-height: 1; margin-bottom: 0.3rem; } .nodeTitle { margin: 0; font-size: 0.82rem; font-weight: 700; color: var(--ifm-color-content); } .nodeHint { margin: 0.2rem 0 0; font-size: 0.7rem; color: var(--demo-muted, var(--ifm-color-content-secondary)); line-height: 1.3; } .nodeBadge { position: absolute; top: -0.4rem; right: -0.25rem; font-size: 0.65rem; font-weight: 700; padding: 0.1rem 0.4rem; border-radius: 999px; background: var(--ifm-color-primary); color: var(--ifm-button-color); } .track { position: relative; min-width: 2.5rem; min-height: 2rem; display: flex; align-items: center; justify-content: center; } .trackInner { display: flex; flex-direction: column; align-items: center; width: 100%; height: 100%; position: relative; } .trackLine { flex: 1; width: 4px; min-height: 2rem; background: var(--demo-border, var(--ifm-color-emphasis-300)); border-radius: 999px; position: relative; overflow: visible; } @media (max-width: 768px) { .trackLine { width: 100%; height: 4px; min-height: unset; min-width: 2.5rem; } } .trackLineActive { background: linear-gradient( 180deg, var(--demo-border), color-mix(in srgb, var(--ifm-color-primary) 40%, var(--demo-border)) ); } @media (max-width: 768px) { .trackLineActive { background: linear-gradient( 90deg, var(--demo-border), color-mix(in srgb, var(--ifm-color-primary) 40%, var(--demo-border)) ); } } .trackArrow { font-size: 0.75rem; color: var(--demo-muted); margin-top: 0.15rem; } .packet { position: absolute; top: 50%; left: 0; width: 11px; height: 11px; margin-top: -5.5px; border-radius: 3px; background: var(--packet-color, var(--ifm-color-primary)); box-shadow: 0 0 8px color-mix(in srgb, var(--packet-color, var(--ifm-color-primary)) 50%, transparent); opacity: 0; pointer-events: none; } .packetVisible { opacity: 1; animation: mbPacketTravel var(--packet-duration, 1s) ease-in-out forwards; } @keyframes mbPacketTravel { 0% { left: 0; transform: scale(0.8) rotate(0deg); } 15% { transform: scale(1.05) rotate(8deg); } 100% { left: calc(100% - 11px); transform: scale(1) rotate(0deg); } } @media (max-width: 768px) { .packet { top: 0; left: 50%; margin-top: 0; margin-left: -5.5px; } .packetVisible { animation-name: mbPacketTravelMobile; } @keyframes mbPacketTravelMobile { 0% { top: 0; left: 50%; transform: translateX(-50%) scale(0.8); } 100% { top: calc(100% - 11px); left: 50%; transform: translateX(-50%) scale(1); } } } .queuePanel { padding: 0.75rem; border: 2px dashed color-mix(in srgb, var(--mb-queue) 55%, var(--demo-border)); border-radius: 10px; background: color-mix(in srgb, var(--mb-queue) 6%, var(--ifm-background-surface-color)); } .queuePanelTitle { margin: 0 0 0.5rem; font-size: 0.8rem; font-weight: 700; color: var(--mb-queue); display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; } .queueList { display: flex; flex-direction: column; gap: 0.4rem; max-height: 140px; overflow-y: auto; } .queueEmpty { margin: 0; font-size: 0.8rem; font-style: italic; color: var(--demo-muted); text-align: center; } .messageChip { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.4rem 0.6rem; border-radius: 6px; font-size: 0.78rem; font-family: var(--ifm-font-family-monospace); color: #fff; background: var(--mb-queue); animation: mbChipIn 0.3s ease; } .messageChipProcessing { animation: mbChipPulse 0.8s ease-in-out infinite; } @keyframes mbChipIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } } @keyframes mbChipPulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.15); } } .consumersRow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; } @media (max-width: 480px) { .consumersRow { grid-template-columns: 1fr; } } .brokersRow { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; } .brokerChip { padding: 0.5rem 0.75rem; border-radius: 8px; border: 2px solid var(--demo-border); background: var(--ifm-background-surface-color); text-align: center; min-width: 4.5rem; transition: all 0.25s ease; } .brokerChipLeader { border-color: var(--mb-broker); box-shadow: 0 0 0 2px color-mix(in srgb, var(--mb-broker) 20%, transparent); } .brokerChipSync { animation: mbBrokerSync 0.6s ease; } @keyframes mbBrokerSync { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); border-color: var(--ifm-color-primary); } } .partitionList { display: flex; flex-direction: column; gap: 0.45rem; } .partition { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.55rem 0.65rem; border-radius: 8px; border-left: 4px solid rgba(255, 255, 255, 0.35); color: #fff; font-size: 0.8rem; transition: background 0.25s ease; } .partitionMeta { font-size: 0.72rem; opacity: 0.9; } .consumerGroup { padding: 0.65rem; border-radius: 8px; border: 1px solid var(--demo-border); background: var(--ifm-background-surface-color); } .consumerGroupTitle { margin: 0 0 0.5rem; font-size: 0.78rem; font-weight: 700; color: var(--demo-muted); } .stats { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; } .stat { flex: 1 1 120px; padding: 0.5rem 0.65rem; border-radius: 8px; border: 1px solid var(--demo-border); background: var(--ifm-background-surface-color); } .statLabel { margin: 0; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--demo-muted); } .statValue { margin: 0.15rem 0 0; font-size: 1rem; font-weight: 700; font-family: var(--ifm-font-family-monospace); color: var(--ifm-color-content); } .controls { display: flex; flex-wrap: wrap; gap: 0.65rem; justify-content: center; margin-top: 1rem; } .hint { margin: 0.75rem 0 0; padding: 0.55rem 0.65rem; font-size: 0.78rem; line-height: 1.45; color: var(--demo-muted); border-radius: 8px; background: var(--ifm-background-surface-color); border: 1px solid var(--demo-border); } @media (prefers-reduced-motion: reduce) { .packetVisible, .messageChip, .messageChipProcessing, .brokerChipSync { animation: none; } .nodeActive { transform: none; } }