/
spirzen
/
it-knowledge-base
Обзор
Документация
Войти
/
spirzen
/
it-knowledge-base
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
Mobile
src/components/DiagramStudio.module.css
287 строк
5 KB
Spirzen
Components Pack
21 май 2026, 18:53
21 май 2026, 18:53
44241e8
Код
Авторство
О чём код?
.root { --studio-accent: var(--ifm-color-primary); display: flex; flex-direction: column; gap: 0.75rem; } .modeBar { display: flex; flex-wrap: wrap; gap: 0.35rem; } .modeBtn { padding: 0.4rem 0.85rem; font-size: 0.82rem; font-family: inherit; border-radius: 8px; border: 1px solid var(--demo-border, var(--ifm-color-emphasis-300)); background: var(--ifm-background-surface-color); cursor: pointer; transition: all 0.15s ease; } .modeBtnActive { font-weight: 600; color: #fff; border-color: transparent; } .layout { display: grid; grid-template-columns: minmax(140px, 180px) 1fr minmax(160px, 200px); gap: 0.65rem; min-height: 340px; } @media (max-width: 900px) { .layout { grid-template-columns: 1fr; } } .panel { border: 1px solid var(--demo-border, var(--ifm-color-emphasis-300)); border-radius: 10px; background: var(--ifm-background-surface-color); overflow: hidden; display: flex; flex-direction: column; } .panelHead { padding: 0.45rem 0.65rem; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ifm-color-content-secondary); border-bottom: 1px solid var(--demo-border, var(--ifm-color-emphasis-200)); } .panelBody { padding: 0.5rem; flex: 1; overflow: auto; } .paletteItem { display: block; width: 100%; text-align: left; padding: 0.4rem 0.5rem; margin-bottom: 0.3rem; font-size: 0.78rem; border-radius: 6px; border: 1px dashed var(--ifm-color-emphasis-300); background: var(--ifm-background-color); cursor: pointer; font-family: inherit; } .paletteItem:hover { border-color: var(--studio-accent); background: var(--demo-highlight, rgba(123, 104, 238, 0.12)); } .canvasWrap { position: relative; min-height: 320px; background: linear-gradient(90deg, var(--ifm-color-emphasis-100) 1px, transparent 1px) 0 0 / 20px 20px, linear-gradient(var(--ifm-color-emphasis-100) 1px, transparent 1px) 0 0 / 20px 20px; background-color: var(--ifm-background-color); border-radius: 0 0 10px 10px; overflow: auto; cursor: crosshair; } .canvasSvg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; } .edgePath { fill: none; stroke: var(--ifm-color-emphasis-600); stroke-width: 2; marker-end: url(#arrow); } .node { position: absolute; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 0.72rem; line-height: 1.2; padding: 0.35rem; cursor: grab; user-select: none; box-sizing: border-box; transition: box-shadow 0.15s ease; } .node:active { cursor: grabbing; } .nodeSelected { box-shadow: 0 0 0 2px var(--studio-accent); z-index: 2; } .shapeCircle { border-radius: 50%; border: 2px solid var(--ifm-color-emphasis-700); background: #fff; } .shapeCircleThick { border-radius: 50%; border: 4px solid var(--ifm-color-emphasis-800); background: var(--ifm-color-emphasis-800); color: #fff; } .shapeRect { border-radius: 10px; border: 2px solid var(--ifm-color-emphasis-700); background: #fff; } .shapeDiamond { transform: rotate(45deg); border: 2px solid var(--ifm-color-emphasis-700); background: #fff; } .shapeDiamond .nodeLabel { transform: rotate(-45deg); } .shapeEllipse { border-radius: 999px; border: 2px solid var(--ifm-color-emphasis-600); background: #fff; } .shapePerson { flex-direction: column; background: transparent; border: none; } .personHead { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ifm-color-emphasis-700); background: #fff; } .personBody { width: 2px; height: 36px; background: var(--ifm-color-emphasis-700); margin-top: 2px; } .shapeSystem { border-radius: 8px; border: 2px solid #0d9488; background: rgba(13, 148, 136, 0.08); } .shapeSystemExt { border-radius: 8px; border: 2px dashed #64748b; background: rgba(100, 116, 139, 0.08); } .shapeDb { border-radius: 8px 8px 20px 20px; border: 2px solid #6366f1; background: rgba(99, 102, 241, 0.1); } .shapeContainer { border-radius: 6px; border: 2px solid #0ea5e9; background: rgba(14, 165, 233, 0.08); } .shapeComponent { border-radius: 4px; border: 2px solid #8b5cf6; background: rgba(139, 92, 246, 0.08); } .shapeClass { border: 2px solid var(--ifm-color-emphasis-700); background: #fff; flex-direction: column; align-items: stretch; padding: 0; } .classHead { padding: 0.25rem 0.4rem; font-weight: 600; border-bottom: 1px solid var(--ifm-color-emphasis-300); background: var(--ifm-color-emphasis-100); } .classBody { padding: 0.25rem 0.4rem; font-family: var(--ifm-font-family-monospace); font-size: 0.65rem; text-align: left; } .exportBox { font-family: var(--ifm-font-family-monospace); font-size: 0.68rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; max-height: 140px; overflow: auto; padding: 0.5rem; background: var(--ifm-code-background); border-radius: 6px; margin-top: 0.35rem; } .toolbar { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--ifm-color-emphasis-200); } .toolBtn { padding: 0.25rem 0.55rem; font-size: 0.72rem; border-radius: 6px; border: 1px solid var(--ifm-color-emphasis-300); background: var(--ifm-background-surface-color); cursor: pointer; font-family: inherit; } .toolBtn:hover { border-color: var(--ifm-color-primary); } .hint { font-size: 0.75rem; color: var(--ifm-color-content-secondary); margin: 0; }