glam/frontend/src/pages/Visualize.css
2025-12-01 00:37:24 +01:00

979 lines
16 KiB
CSS

/* Unified Visualize Page Styles */
.visualize-page {
display: flex;
height: calc(100vh - 60px);
overflow: hidden;
}
/* Sidebar Toggle (collapsed state) */
.sidebar-toggle {
position: fixed;
top: 80px;
left: 10px;
z-index: 100;
background: white;
border: 1px solid #e0e0e0;
border-radius: 8px;
padding: 0.75rem;
cursor: pointer;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
transition: all 0.2s;
}
.sidebar-toggle:hover {
background: #f8f9fa;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
/* Sidebar Styles */
.sidebar {
width: 320px;
background: white;
border-right: 1px solid #e0e0e0;
overflow-y: auto;
display: flex;
flex-direction: column;
flex-shrink: 0;
box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
transition: width 0.3s ease, opacity 0.3s ease;
}
.sidebar.collapsed {
width: 0;
opacity: 0;
overflow: hidden;
}
/* Sidebar Header */
.sidebar-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 1.5rem;
background: linear-gradient(135deg, #4a7dff 0%, #2c5ce6 100%);
color: white;
border-bottom: 1px solid #e0e0e0;
}
.sidebar-header-content h2 {
margin: 0 0 0.25rem 0;
font-size: 1.25rem;
font-weight: 700;
}
.sidebar-subtitle {
margin: 0;
font-size: 0.875rem;
opacity: 0.9;
}
.sidebar-collapse-button {
background: rgba(255, 255, 255, 0.2);
border: none;
border-radius: 6px;
padding: 0.5rem;
cursor: pointer;
color: white;
transition: background 0.2s;
}
.sidebar-collapse-button:hover {
background: rgba(255, 255, 255, 0.3);
}
/* Search Section */
.search-section {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 1rem 1.5rem;
border-bottom: 1px solid #e0e0e0;
position: relative;
}
.search-icon {
color: #666;
flex-shrink: 0;
}
.search-input {
flex: 1;
border: none;
outline: none;
font-size: 0.875rem;
padding: 0.5rem 0;
}
.search-clear {
background: #e0e0e0;
border: none;
border-radius: 50%;
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: background 0.2s;
}
.search-clear:hover {
background: #ccc;
}
/* Load Data Section */
.load-section {
border-bottom: 1px solid #e0e0e0;
}
.load-header {
display: flex;
align-items: center;
gap: 0.75rem;
width: 100%;
padding: 1rem 1.5rem;
background: #f8f9fa;
border: none;
cursor: pointer;
font-size: 0.9375rem;
font-weight: 500;
color: #172a59;
transition: background 0.2s;
}
.load-header:hover {
background: #ebefff;
}
.load-header span {
flex: 1;
text-align: left;
}
.load-chevron {
transition: transform 0.2s;
}
.load-chevron.expanded {
transform: rotate(180deg);
}
.load-content {
padding: 1rem 1.5rem;
background: white;
}
.load-file {
margin-bottom: 1rem;
}
.load-file-label {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.75rem 1rem;
border: 2px dashed #4a7dff;
border-radius: 8px;
background: #f8f9fa;
cursor: pointer;
transition: all 0.2s;
font-size: 0.875rem;
color: #172a59;
}
.load-file-label:hover {
border-color: #2c5ce6;
background: #ebefff;
}
.load-file-input {
display: none;
}
.load-hint {
margin: 0.5rem 0 0 0;
font-size: 0.75rem;
color: #666;
}
.load-divider {
display: flex;
align-items: center;
margin: 1rem 0;
color: #666;
font-size: 0.8125rem;
}
.load-divider::before,
.load-divider::after {
content: '';
flex: 1;
height: 1px;
background: #e0e0e0;
}
.load-divider span {
padding: 0 0.75rem;
}
.load-textarea {
width: 100%;
padding: 0.75rem;
border: 1px solid #e0e0e0;
border-radius: 8px;
font-family: 'Monaco', 'Courier New', monospace;
font-size: 0.75rem;
resize: vertical;
transition: border-color 0.2s;
}
.load-textarea:focus {
outline: none;
border-color: #4a7dff;
}
.load-button {
width: 100%;
padding: 0.75rem;
margin-top: 1rem;
background: #4a7dff;
color: white;
border: none;
border-radius: 8px;
font-weight: 500;
cursor: pointer;
transition: background 0.2s;
}
.load-button:hover:not(:disabled) {
background: #2c5ce6;
}
.load-button:disabled {
background: #ccc;
cursor: not-allowed;
}
/* Generate Section */
.generate-section {
padding: 1rem 1.5rem;
background: #f8f9fa;
border-bottom: 1px solid #e0e0e0;
}
.generate-header {
display: flex;
align-items: center;
gap: 0.75rem;
margin: 0 0 1rem 0;
font-size: 0.9375rem;
font-weight: 600;
color: #172a59;
}
.generate-content {
display: flex;
flex-direction: column;
gap: 1.25rem;
}
.generate-group {
padding: 1rem;
background: white;
border-radius: 8px;
border: 1px solid #e0e0e0;
}
.generate-group h4 {
margin: 0 0 0.5rem 0;
font-size: 0.875rem;
font-weight: 600;
color: #172a59;
}
.generate-desc {
margin: 0 0 0.75rem 0;
font-size: 0.75rem;
color: #666;
line-height: 1.4;
}
.generate-button {
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
width: 100%;
padding: 0.75rem 1rem;
background: linear-gradient(135deg, #4a7dff 0%, #2c5ce6 100%);
color: white;
border: none;
border-radius: 6px;
font-weight: 500;
font-size: 0.875rem;
cursor: pointer;
transition: all 0.2s;
}
.generate-button:hover:not(:disabled) {
background: linear-gradient(135deg, #2c5ce6 0%, #1a4cbb 100%);
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(74, 125, 255, 0.3);
}
.generate-button:disabled {
opacity: 0.7;
cursor: not-allowed;
transform: none;
box-shadow: none;
}
.generate-button--disabled {
background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
cursor: not-allowed;
}
.generate-button--disabled:hover {
background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
transform: none;
box-shadow: none;
}
.generate-hint {
margin: 0.5rem 0 0 0;
font-size: 0.6875rem;
color: #999;
font-style: italic;
}
/* Spinning animation for loading state */
@keyframes spinning {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.spinning {
animation: spinning 1s linear infinite;
}
/* Available Schemas Section */
.schemas-section {
border-bottom: 1px solid #e0e0e0;
}
.schemas-header {
display: flex;
align-items: center;
gap: 0.75rem;
width: 100%;
padding: 1rem 1.5rem;
background: #f8f9fa;
border: none;
cursor: pointer;
font-size: 0.9375rem;
font-weight: 500;
color: #172a59;
transition: background 0.2s;
}
.schemas-header:hover {
background: #ebefff;
}
.schemas-header span {
flex: 1;
text-align: left;
}
.schemas-header .chevron {
transition: transform 0.2s;
}
.schemas-header .chevron.expanded {
transform: rotate(180deg);
}
.schemas-list {
padding: 0.5rem 1rem 1rem;
background: white;
max-height: 400px;
overflow-y: auto;
}
.schema-group {
margin-bottom: 1rem;
}
.schema-group h4 {
margin: 0 0 0.5rem 0;
padding: 0.5rem 0;
font-size: 0.75rem;
font-weight: 600;
color: #4a7dff;
text-transform: uppercase;
letter-spacing: 0.05em;
border-bottom: 1px solid #ebefff;
}
.schema-button {
display: flex;
align-items: center;
gap: 0.75rem;
width: 100%;
padding: 0.625rem 0.75rem;
background: transparent;
border: 1px solid transparent;
border-radius: 6px;
text-align: left;
font-size: 0.8125rem;
color: #172a59;
cursor: pointer;
transition: all 0.2s;
margin-bottom: 0.25rem;
}
.schema-button:hover:not(:disabled) {
background: #ebefff;
border-color: #4a7dff;
}
.schema-button.active {
background: #ebefff;
border-color: #4a7dff;
font-weight: 500;
}
.schema-button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.schema-button svg {
flex-shrink: 0;
color: #666;
}
.schema-button:hover:not(:disabled) svg,
.schema-button.active svg {
color: #4a7dff;
}
.no-results {
padding: 1rem;
text-align: center;
color: #666;
font-size: 0.875rem;
}
/* Current File Section */
.current-file-section {
padding: 1rem 1.5rem;
background: #ebefff;
border-bottom: 1px solid #4a7dff;
}
.current-file-section h3 {
margin: 0 0 0.5rem 0;
font-size: 0.75rem;
font-weight: 600;
color: #4a7dff;
text-transform: uppercase;
letter-spacing: 0.05em;
}
.current-file-name {
margin: 0 0 0.25rem 0;
font-size: 0.875rem;
font-weight: 500;
color: #172a59;
word-break: break-word;
}
.current-file-type {
font-size: 0.75rem;
color: #666;
background: white;
padding: 0.25rem 0.5rem;
border-radius: 4px;
}
/* Status Section */
.status-section {
padding: 1rem 1.5rem;
background: #f8f9fa;
border-bottom: 1px solid #e0e0e0;
}
.status-section h3 {
margin: 0 0 0.75rem 0;
font-size: 0.875rem;
color: #172a59;
font-weight: 600;
}
.status-section p {
margin: 0.5rem 0;
font-size: 0.8125rem;
color: #666;
}
.status-section strong {
color: #172a59;
}
/* Node Info Section */
.node-info-section {
padding: 1rem 1.5rem;
background: #ebefff;
border-bottom: 1px solid #4a7dff;
}
.node-info-section h3 {
margin: 0 0 0.75rem 0;
font-size: 0.875rem;
color: #172a59;
font-weight: 600;
}
.node-details {
margin: 0.75rem 0;
}
.node-details p {
margin: 0.5rem 0;
font-size: 0.8125rem;
color: #172a59;
}
.node-details strong {
color: #4a7dff;
}
.node-id {
font-family: 'Monaco', 'Courier New', monospace;
font-size: 0.75rem;
color: #666;
word-break: break-all;
display: block;
padding: 0.5rem;
background: white;
border-radius: 4px;
margin-top: 0.25rem;
}
.clear-button {
width: 100%;
padding: 0.625rem;
background: white;
border: 1px solid #4a7dff;
color: #4a7dff;
border-radius: 6px;
cursor: pointer;
font-weight: 500;
font-size: 0.875rem;
transition: all 0.2s;
}
.clear-button:hover {
background: #4a7dff;
color: white;
}
/* Hover Info Section */
.hover-info-section {
padding: 1rem 1.5rem;
background: #fff9e6;
border-bottom: 1px solid #ffc107;
}
.hover-info-section h3 {
margin: 0 0 0.5rem 0;
font-size: 0.875rem;
color: #172a59;
font-weight: 600;
}
.hover-info-section p {
margin: 0.5rem 0;
font-size: 0.8125rem;
color: #666;
}
/* Main Content */
.main-content {
flex: 1;
background: #f8f9fa;
position: relative;
overflow: hidden;
display: flex;
flex-direction: column;
}
/* Toolbar */
.toolbar {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.75rem 1rem;
background: white;
border-bottom: 1px solid #e0e0e0;
z-index: 10;
}
.toolbar-left,
.toolbar-right {
display: flex;
align-items: center;
gap: 0.5rem;
}
.toolbar-button {
display: flex;
align-items: center;
gap: 0.375rem;
padding: 0.5rem 0.75rem;
background: transparent;
border: 1px solid #e0e0e0;
border-radius: 6px;
font-size: 0.8125rem;
color: #172a59;
cursor: pointer;
transition: all 0.2s;
}
.toolbar-button:hover {
background: #f8f9fa;
border-color: #4a7dff;
}
.toolbar-button--primary {
background: #4a7dff;
border-color: #4a7dff;
color: white;
}
.toolbar-button--primary:hover {
background: #2c5ce6;
border-color: #2c5ce6;
}
.toolbar-title {
font-size: 0.875rem;
font-weight: 500;
color: #172a59;
margin-right: 0.5rem;
max-width: 300px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* Dropdowns */
.dropdown {
position: relative;
}
.dropdown-menu {
position: absolute;
top: calc(100% + 4px);
right: 0;
min-width: 220px;
background: white;
border: 1px solid #e0e0e0;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
z-index: 100;
overflow: hidden;
}
.dropdown-menu--layout {
min-width: 280px;
}
.dropdown-item {
display: flex;
align-items: flex-start;
gap: 0.75rem;
width: 100%;
padding: 0.75rem 1rem;
background: transparent;
border: none;
text-align: left;
cursor: pointer;
transition: background 0.2s;
}
.dropdown-item:hover {
background: #f8f9fa;
}
.dropdown-item--active {
background: #ebefff;
}
.dropdown-item svg {
flex-shrink: 0;
margin-top: 2px;
color: #666;
}
.dropdown-item--active svg {
color: #4a7dff;
}
.dropdown-item-title {
display: block;
font-size: 0.875rem;
font-weight: 500;
color: #172a59;
}
.dropdown-item-desc {
display: block;
font-size: 0.75rem;
color: #666;
margin-top: 2px;
}
.dropdown-divider {
height: 1px;
background: #e0e0e0;
margin: 0.25rem 0;
}
.dropdown-header {
padding: 0.5rem 1rem;
font-size: 0.6875rem;
font-weight: 600;
color: #4a7dff;
text-transform: uppercase;
letter-spacing: 0.05em;
}
/* Loading Overlay */
.loading-overlay {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
gap: 1rem;
}
.spinner {
width: 48px;
height: 48px;
border: 4px solid #ebefff;
border-top-color: #4a7dff;
border-radius: 50%;
animation: spin 0.8s linear infinite;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
/* Error Message */
.error-message {
max-width: 700px;
margin: auto;
padding: 2rem;
background: white;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
border-left: 4px solid #dc3545;
}
.error-message h2 {
margin-top: 0;
color: #dc3545;
}
.error-message p {
color: #666;
line-height: 1.6;
}
.error-details {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.error-details p {
margin: 0.5rem 0;
color: #555;
line-height: 1.5;
}
.error-details p:first-child {
font-weight: 500;
color: #333;
}
/* Format suggestions in error message */
.error-details p:has( ) {
padding-left: 1rem;
margin-left: 0.5rem;
border-left: 2px solid #e0e0e0;
}
/* Welcome Message */
.welcome-message {
max-width: 600px;
margin: auto;
padding: 2rem;
background: white;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
text-align: center;
}
.welcome-message h2 {
margin-top: 0;
color: #172a59;
}
.welcome-message > p {
color: #666;
line-height: 1.6;
margin-bottom: 1.5rem;
}
.welcome-message .features {
text-align: left;
margin-top: 1.5rem;
padding: 1rem;
background: #f8f9fa;
border-radius: 8px;
}
.welcome-message .features h3 {
margin: 0 0 0.5rem 0;
font-size: 0.9375rem;
color: #172a59;
}
.welcome-message .features ul {
margin: 0 0 1rem 0;
padding-left: 1.5rem;
}
.welcome-message .features li {
margin: 0.5rem 0;
color: #666;
font-size: 0.875rem;
}
/* Graph Visualization */
.graph-visualization {
flex: 1;
width: 100%;
height: 100%;
}
/* UML Canvas */
.uml-canvas {
flex: 1;
width: 100%;
overflow: hidden;
}
/* Source View */
.source-view {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: white;
border-top: 1px solid #e0e0e0;
max-height: 40vh;
overflow: auto;
z-index: 5;
}
.source-view details {
padding: 0;
}
.source-view summary {
padding: 0.75rem 1rem;
background: #f8f9fa;
cursor: pointer;
font-weight: 500;
color: #172a59;
border-bottom: 1px solid #e0e0e0;
}
.source-view summary:hover {
background: #ebefff;
}
.source-view pre {
margin: 0;
padding: 1rem;
background: #1e1e1e;
overflow: auto;
}
.source-view code {
font-family: 'Monaco', 'Courier New', monospace;
font-size: 0.75rem;
color: #d4d4d4;
white-space: pre;
}
/* Responsive Design */
@media (max-width: 1024px) {
.sidebar {
width: 280px;
}
.toolbar-title {
max-width: 150px;
}
}
@media (max-width: 768px) {
.visualize-page {
flex-direction: column;
}
.sidebar {
width: 100%;
max-height: 40vh;
border-right: none;
border-bottom: 1px solid #e0e0e0;
}
.sidebar.collapsed {
max-height: 0;
}
.main-content {
flex: 1;
}
.toolbar {
flex-wrap: wrap;
gap: 0.5rem;
}
.toolbar-left,
.toolbar-right {
flex-wrap: wrap;
}
.toolbar-title {
width: 100%;
order: -1;
margin-bottom: 0.5rem;
}
}