Files
elcalc/styles.css
Chop 643a4210ea feat: Implement grid snapping and panning functionality in ObjectFlowDesigner
- Added grid snapping to object creation and dragging for better alignment.
- Introduced panning support with right-click and mouse wheel events for canvas navigation.
- Enhanced object properties for transformers and nodes, including detailed information display.
- Updated connection properties to include cable type, cross-section, and length.
- Implemented validation for overhead cable connections to ensure correct node types.
- Improved rendering logic to account for scrolling and grid display.
- Added CSS styles for warnings and specific node types for better UI feedback.
2025-06-26 21:51:42 +02:00

385 lines
5.9 KiB
CSS

* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
color: #333;
}
.container {
display: flex;
flex-direction: column;
height: 100vh;
}
.header {
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.header h1 {
color: #4a5568;
font-size: 1.8rem;
font-weight: 600;
}
.controls {
display: flex;
gap: 1rem;
}
.btn {
padding: 0.5rem 1rem;
border: none;
border-radius: 8px;
cursor: pointer;
font-weight: 500;
transition: all 0.3s ease;
text-decoration: none;
display: inline-block;
}
.btn-primary {
background: #4299e1;
color: white;
}
.btn-primary:hover {
background: #3182ce;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(66, 153, 225, 0.4);
}
.btn-secondary {
background: #718096;
color: white;
}
.btn-secondary:hover {
background: #4a5568;
transform: translateY(-2px);
}
.btn-danger {
background: #e53e3e;
color: white;
}
.btn-danger:hover {
background: #c53030;
transform: translateY(-2px);
}
.btn-outline {
background: transparent;
color: #4299e1;
border: 2px solid #4299e1;
}
.btn-outline:hover {
background: #4299e1;
color: white;
}
.btn:active {
transform: translateY(0);
}
.main-content {
display: flex;
flex: 1;
overflow: hidden;
}
.toolbar {
width: 250px;
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
padding: 1.5rem;
border-right: 1px solid rgba(255, 255, 255, 0.2);
overflow-y: auto;
}
.toolbar h3,
.toolbar h4 {
color: #4a5568;
margin-bottom: 1rem;
}
.object-palette {
margin-bottom: 2rem;
}
.palette-item {
display: flex;
flex-direction: column;
align-items: center;
padding: 1rem;
margin-bottom: 1rem;
background: white;
border-radius: 12px;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
border: 2px solid transparent;
}
.palette-item:hover {
transform: translateY(-3px);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
border-color: #4299e1;
}
.palette-item span {
font-weight: 600;
color: #4a5568;
margin: 0.5rem 0;
}
.palette-item small {
color: #718096;
font-size: 0.8rem;
text-align: center;
}
.triangle-preview {
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-bottom: 25px solid #48bb78;
}
.square-preview {
width: 30px;
height: 30px;
background: #4299e1;
border-radius: 4px;
}
.connection-mode {
border-top: 1px solid rgba(0, 0, 0, 0.1);
padding-top: 1rem;
}
.connection-mode .btn {
width: 100%;
margin-bottom: 0.5rem;
}
.canvas-container {
flex: 1;
position: relative;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(5px);
border-radius: 0 0 0 20px;
overflow: hidden;
}
#canvas {
width: 100%;
height: 100%;
background: white;
cursor: default;
border-radius: 0 0 0 20px;
}
.properties-panel {
width: 300px;
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
padding: 1.5rem;
border-left: 1px solid rgba(255, 255, 255, 0.2);
overflow-y: auto;
}
.properties-panel h3 {
color: #4a5568;
margin-bottom: 1rem;
}
.no-selection {
color: #718096;
font-style: italic;
text-align: center;
padding: 2rem 0;
}
.property-group {
margin-bottom: 1.5rem;
padding: 1rem;
background: white;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.property-group h4 {
color: #4a5568;
margin-bottom: 0.5rem;
font-size: 0.9rem;
text-transform: uppercase;
letter-spacing: 1px;
}
.property-group input,
.property-group textarea,
.property-group select {
width: 100%;
padding: 0.5rem;
border: 1px solid #e2e8f0;
border-radius: 4px;
font-size: 0.9rem;
margin-bottom: 0.5rem;
}
.property-group textarea {
resize: vertical;
min-height: 60px;
}
.tooltip {
position: absolute;
background: rgba(0, 0, 0, 0.8);
color: white;
padding: 0.5rem;
border-radius: 4px;
font-size: 0.8rem;
pointer-events: none;
z-index: 1000;
display: none;
}
.mode-connecting #canvas {
cursor: crosshair;
}
.mode-selecting #canvas {
cursor: default;
}
/* Animation classes */
.shake {
animation: shake 0.5s ease-in-out;
}
@keyframes shake {
0%,
100% {
transform: translateX(0);
}
25% {
transform: translateX(-5px);
}
75% {
transform: translateX(5px);
}
}
.pulse {
animation: pulse 1s infinite;
}
@keyframes pulse {
0% {
transform: scale(1);
}
50% {
transform: scale(1.05);
}
100% {
transform: scale(1);
}
}
/* Connection label styling */
.connection-label {
background: rgba(255, 255, 255, 0.9);
border: 1px solid #4a5568;
border-radius: 4px;
padding: 2px 6px;
font-size: 11px;
color: #4a5568;
pointer-events: none;
}
.property-group label {
display: block;
margin-bottom: 0.25rem;
font-weight: 500;
color: #4a5568;
font-size: 0.85rem;
}
/* Warning styling for overhead cable validation */
.warning {
color: #d69e2e;
background-color: #fef5e7;
border: 1px solid #f6e05e;
border-radius: 4px;
padding: 0.5rem;
margin: 0.5rem 0;
font-size: 0.85rem;
}
.warning strong {
color: #c05621;
}
.pole-node {
background: #4a5568 !important;
border-color: #2d3748 !important;
}
.cable-box-node {
background: #4299e1 !important;
border-color: #2c5282 !important;
}
/* Power system specific styling */
.transformer-preview {
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-bottom: 25px solid #48bb78;
}
.node-preview {
width: 30px;
height: 30px;
background: linear-gradient(45deg, #4299e1 50%, #4a5568 50%);
border-radius: 4px;
}
/* Responsive design */
@media (max-width: 1024px) {
.main-content {
flex-direction: column;
}
.toolbar,
.properties-panel {
width: 100%;
max-height: 200px;
}
.canvas-container {
border-radius: 0;
}
#canvas {
border-radius: 0;
}
}