Qubit_EPM/src/components/ERDiagramCanvas.scss

628 lines
11 KiB
SCSS

// ERDiagramCanvas SCSS Styles
// Main container and layout styles
.er-diagram-container {
width: 100vw;
height: 100vh;
position: relative;
display: flex;
flex-direction: column;
min-width: 1200px;
min-height: 800px;
background: #121212;
color: #fff;
.react-flow__node {
z-index: 1;
margin: 20px;
}
}
// Breadcrumb header
.er-breadcrumb-header {
padding: 0 20px 20px 20px;
flex-shrink: 0;
}
// ReactFlow container
.er-reactflow-container {
flex: 1;
position: relative;
min-height: 700px;
}
// Loading state styles
.er-loading-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
.loading-spinner {
width: 60px;
height: 60px;
border: 4px solid rgba(255, 255, 255, 0.3);
border-top: 4px solid white;
border-radius: 50%;
animation: spin 1s linear infinite;
margin-bottom: 20px;
}
.loading-text {
font-size: 18px;
font-weight: 500;
margin-bottom: 8px;
}
.loading-subtext {
font-size: 14px;
opacity: 0.8;
}
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
// Database wrapper styles
.er-database-wrapper {
z-index: -2;
pointer-events: all;
border-radius: 25px;
cursor: grab;
user-select: none;
transition: all 0.2s ease;
padding: 100px;
border: 3px solid rgba(0, 169, 157, 0.4);
background: rgba(0, 169, 157, 0.03);
box-shadow: 0 0 30px rgba(0, 169, 157, 0.1);
// Dynamic sizing using CSS custom properties
width: var(--db-width, 1400px);
height: var(--db-height, 1000px);
&:hover {
border-color: rgba(0, 169, 157, 0.6);
background: rgba(0, 169, 157, 0.05);
box-shadow: 0 0 40px rgba(0, 169, 157, 0.15);
}
&:active {
cursor: grabbing;
}
}
.er-database-label {
position: absolute;
top: 20px;
left: 20px;
background: rgba(0, 169, 157, 0.95);
color: white;
padding: 12px 16px;
border-radius: 8px;
font-size: 14px;
font-weight: bold;
box-shadow: 0 4px 12px rgba(0, 169, 157, 0.3);
display: flex;
align-items: center;
gap: 10px;
z-index: 15;
}
// Schema group styles
.er-schema-group {
z-index: -1;
pointer-events: all;
border-radius: 20px;
cursor: grab;
user-select: none;
transition: all 0.2s ease;
padding: 80px;
border: 2px dashed rgba(138, 43, 226, 0.3);
background: rgba(138, 43, 226, 0.05);
position: relative;
overflow: visible;
// Dynamic sizing using CSS custom properties
width: var(--schema-width, 800px);
height: var(--schema-height, 600px);
&:hover {
border-color: rgba(138, 43, 226, 0.5);
background: rgba(138, 43, 226, 0.08);
box-shadow: 0 0 20px rgba(138, 43, 226, 0.1);
}
&:active {
cursor: grabbing;
}
}
.er-schema-empty {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #999;
font-size: 14px;
font-style: italic;
text-align: center;
}
.er-schema-label {
position: absolute;
top: 15px;
left: 15px;
background: rgba(138, 43, 226, 0.9);
color: white;
padding: 8px 12px;
border-radius: 6px;
font-size: 12px;
font-weight: bold;
box-shadow: 0 2px 8px rgba(138, 43, 226, 0.3);
display: flex;
align-items: center;
gap: 8px;
z-index: 10;
}
// Table node styles
.er-table-node {
background: white;
border: 2px solid #e1e5e9;
border-radius: 10px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
width: 260px;
min-height: 200px;
transition: all 0.2s ease;
&:hover {
border-color: #8a2be2;
box-shadow: 0 4px 16px rgba(138, 43, 226, 0.2);
}
// Handle styles
.react-flow__handle {
background: #8a2be2;
width: 8px;
height: 8px;
}
}
.er-table-header {
background: linear-gradient(135deg, #8a2be2, #9932cc);
color: white;
padding: 14px 16px;
border-radius: 8px 8px 0 0;
display: flex;
align-items: center;
gap: 10px;
font-weight: bold;
font-size: 15px;
&.stage {
background: linear-gradient(135deg, #00a99d, #52c41a);
}
&.fact {
background: linear-gradient(135deg, #fa8c16, #faad14);
}
&.dimension {
background: linear-gradient(135deg, #52c41a, #73d13d);
}
}
.er-column-list {
padding: 0;
margin: 0;
list-style: none;
max-height: 300px;
overflow-y: auto;
}
.er-column-item {
padding: 10px 16px;
border-bottom: 1px solid #f0f0f0;
display: flex;
align-items: center;
gap: 10px;
font-size: 13px;
transition: background-color 0.2s ease;
&:hover {
background-color: #f8f9fa;
}
&:last-child {
border-bottom: none;
}
}
.er-column-name {
flex: 1;
font-weight: 500;
color: #333;
}
.er-column-type {
color: #666;
font-size: 11px;
background: #f5f5f5;
padding: 2px 6px;
border-radius: 3px;
}
.er-primary-key {
color: #faad14;
}
.er-foreign-key {
color: #8a2be2;
}
// Relationship edge styles
.er-relationship-edge {
stroke: #8a2be2;
stroke-width: 2;
.react-flow__edge-path {
stroke: #8a2be2;
stroke-width: 2;
}
}
.er-relationship-edge-animated {
stroke: #8a2be2;
stroke-width: 2;
stroke-dasharray: 5;
animation: dashdraw 0.5s linear infinite;
}
@keyframes dashdraw {
to {
stroke-dashoffset: -10;
}
}
// Enhanced arrow markers
.react-flow__edge.selected .react-flow__edge-path {
stroke: #faad14 !important;
stroke-width: 3 !important;
}
.react-flow__edge:hover .react-flow__edge-path {
stroke: #52c41a !important;
stroke-width: 3 !important;
}
// Custom arrow styling
.er-custom-arrow {
pointer-events: none;
z-index: 10;
}
// Cardinality indicators
.er-cardinality-indicator {
background: rgba(255, 255, 255, 0.95) !important;
border: 1px solid #8a2be2 !important;
border-radius: 3px !important;
padding: 2px 6px !important;
font-size: 10px !important;
font-weight: bold !important;
color: #8a2be2 !important;
box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
}
// Relationship direction indicators
.er-direction-arrow {
fill: #8a2be2;
stroke: #8a2be2;
stroke-width: 1;
&.selected {
fill: #faad14;
stroke: #faad14;
}
}
.er-relationship-label {
background: rgba(138, 43, 226, 0.9);
color: white;
padding: 4px 8px;
border-radius: 4px;
font-size: 10px;
font-weight: bold;
&:hover + .relationship-tooltip {
opacity: 1 !important;
}
}
// Add button styles
.er-add-button {
position: fixed;
bottom: 30px;
right: 30px;
width: 105px;
height: 42px;
border-radius: 16px;
background: linear-gradient(135deg, #8a2be2, #9932cc);
border: none;
color: white;
padding: 3px;
display: flex;
align-items: center;
justify-content: center;
svg {
width: 99px;
height: 36px;
max-width: 100%;
max-height: 100%;
}
cursor: pointer;
box-shadow: 0 4px 16px rgba(138, 43, 226, 0.3);
transition: all 0.2s ease;
z-index: 1000;
display: flex;
align-items: center;
justify-content: center;
&:hover {
transform: scale(1.1);
box-shadow: 0 6px 20px rgba(138, 43, 226, 0.4);
}
&:active {
transform: scale(0.95);
}
&:disabled {
opacity: 0.5;
cursor: not-allowed;
transform: none;
}
}
// Breadcrumb styles
.er-breadcrumb-dropdown {
display: inline-flex;
align-items: center;
cursor: pointer;
padding: 4px 8px;
border-radius: 4px;
transition: background-color 0.2s ease;
&:hover {
background-color: rgba(0, 169, 157, 0.1);
}
.dropdown-arrow {
margin-left: 4px;
font-size: 12px;
transition: transform 0.2s ease;
}
&.open .dropdown-arrow {
transform: rotate(180deg);
}
}
// Service menu styles
.er-service-menu {
background: rgba(26, 26, 26, 0.95) !important;
border: 1px solid rgba(0, 169, 157, 0.3) !important;
border-radius: 8px !important;
backdrop-filter: blur(10px) !important;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
.MuiMenuItem-root {
color: #ffffff !important;
padding: 12px 16px !important;
border-radius: 4px !important;
margin: 4px 8px !important;
transition: all 0.2s ease !important;
&:hover {
background-color: rgba(0, 169, 157, 0.1) !important;
}
}
.MuiListItemIcon-root {
color: #00a99d !important;
min-width: 32px !important;
}
}
// ReactFlow specific overrides
.react-flow__edges {
z-index: 1;
}
.react-flow__edge {
pointer-events: all;
path {
stroke: #8a2be2;
stroke-width: 2;
}
&.selected path {
stroke: #faad14 !important;
stroke-width: 3 !important;
}
}
// Panel styles
.er-info-panel {
background: rgba(26, 26, 26, 0.9);
padding: 16px 20px;
border-radius: 12px;
border: 1px solid rgba(138, 43, 226, 0.3);
color: #fff;
font-size: 13px;
backdrop-filter: blur(10px);
min-width: 280px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
.panel-header {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 8px;
font-weight: bold;
font-size: 14px;
}
.panel-service-info {
font-size: 12px;
opacity: 0.9;
margin-bottom: 8px;
.service-header {
display: flex;
align-items: center;
gap: 4px;
margin-bottom: 4px;
font-weight: bold;
}
.data-source-selector {
font-size: 11px;
opacity: 0.7;
display: flex;
align-items: center;
gap: 4px;
cursor: pointer;
padding: 2px 4px;
border-radius: 3px;
transition: background-color 0.2s ease;
&:hover {
background-color: rgba(138, 43, 226, 0.1);
}
}
}
.panel-stats {
font-size: 12px;
opacity: 0.8;
border-top: 1px solid rgba(138, 43, 226, 0.2);
padding-top: 8px;
.stats-row {
margin-bottom: 4px;
}
.mock-data-indicator {
font-size: 11px;
color: #faad14;
display: flex;
align-items: center;
gap: 4px;
margin-top: 4px;
.indicator-dot {
width: 6px;
height: 6px;
background: #faad14;
border-radius: 50%;
}
}
}
}
.er-legend-panel {
background: rgba(26, 26, 26, 0.9);
padding: 12px 16px;
border-radius: 8px;
border: 1px solid rgba(138, 43, 226, 0.3);
color: #fff;
font-size: 12px;
backdrop-filter: blur(5px);
min-width: 200px;
.legend-header {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 8px;
font-weight: bold;
}
.legend-content {
font-size: 11px;
line-height: 1.4;
.legend-item {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 4px;
.legend-symbol {
color: #8a2be2;
}
}
.legend-footer {
font-size: 10px;
opacity: 0.7;
margin-top: 8px;
border-top: 1px solid rgba(138, 43, 226, 0.2);
padding-top: 6px;
line-height: 1.3;
}
}
}
// Responsive design
@media (max-width: 768px) {
.er-info-panel {
min-width: 240px;
padding: 12px 16px;
font-size: 12px;
.panel-header {
font-size: 13px;
}
}
.er-legend-panel {
min-width: 180px;
padding: 10px 12px;
font-size: 11px;
}
.er-add-button {
width: 95px;
height: 38px;
bottom: 20px;
right: 20px;
padding: 2px;
svg {
width: 89px;
height: 32px;
}
}
}
@media (max-width: 480px) {
.er-database-wrapper {
padding: 60px;
}
.er-schema-group {
padding: 40px;
}
.er-table-node {
width: 220px;
}
}