Files
elcalc/styles.css

929 lines
15 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: 100px;
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
padding: 1rem 0.75rem;
border-right: 1px solid rgba(255, 255, 255, 0.2);
overflow: visible;
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.toolbar-section {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.5rem;
}
.toolbar-label {
font-size: 0.7rem;
font-weight: 600;
color: #718096;
text-transform: uppercase;
letter-spacing: 0.5px;
writing-mode: horizontal-tb;
text-align: center;
line-height: 1.2;
}
.icon-toolbar {
display: flex;
flex-direction: column;
gap: 0.5rem;
align-items: center;
width: 100%;
}
.icon-btn {
width: 44px;
height: 44px;
border: none;
border-radius: 8px;
background: white;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
border: 2px solid transparent;
position: relative;
}
.icon-btn:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
border-color: #4299e1;
}
.icon-btn.active {
background: #4299e1;
border-color: #3182ce;
transform: translateY(-1px);
}
.icon-btn.active:hover {
background: #3182ce;
}
/* Tooltip enhancements */
.icon-btn::after {
content: attr(title);
position: absolute;
left: 100%;
top: 50%;
transform: translateY(-50%);
margin-left: 8px;
padding: 6px 8px;
background: rgba(0, 0, 0, 0.8);
color: white;
font-size: 0.7rem;
border-radius: 4px;
white-space: nowrap;
opacity: 0;
pointer-events: none;
transition: opacity 0.3s ease;
z-index: 1000;
}
.icon-btn:hover::after {
opacity: 1;
}
/* Object Icons */
.icon-triangle {
width: 0;
height: 0;
border-left: 12px solid transparent;
border-right: 12px solid transparent;
border-bottom: 20px solid #48bb78;
}
.icon-btn.active .icon-triangle {
border-bottom-color: white;
}
.icon-box {
width: 24px;
height: 24px;
background: #4299e1;
border-radius: 3px;
}
.icon-btn.active .icon-box {
background: white;
}
.icon-pole {
width: 4px;
height: 28px;
background: #8b4513;
border-radius: 2px;
position: relative;
}
.icon-pole::before {
content: "";
position: absolute;
top: 2px;
left: -6px;
width: 16px;
height: 2px;
background: #4a5568;
border-radius: 1px;
}
.icon-pole::after {
content: "";
position: absolute;
top: 6px;
left: -6px;
width: 16px;
height: 2px;
background: #4a5568;
border-radius: 1px;
}
.icon-btn.active .icon-pole {
background: white;
}
.icon-btn.active .icon-pole::before,
.icon-btn.active .icon-pole::after {
background: white;
}
.icon-end {
width: 20px;
height: 20px;
border: 3px solid #e53e3e;
border-radius: 50%;
position: relative;
}
.icon-end::before {
content: "";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 8px;
height: 8px;
background: #e53e3e;
border-radius: 50%;
}
.icon-btn.active .icon-end {
border-color: white;
}
.icon-btn.active .icon-end::before {
background: white;
}
/* Cable Icons */
.icon-underground {
width: 24px;
height: 3px;
background: #2d3748;
border-radius: 1.5px;
position: relative;
}
.icon-underground::before {
content: "";
position: absolute;
top: -3px;
left: 0;
width: 100%;
height: 1px;
background: repeating-linear-gradient(
to right,
#2d3748 0px,
#2d3748 2px,
transparent 2px,
transparent 4px
);
}
.icon-btn.active .icon-underground {
background: white;
}
.icon-btn.active .icon-underground::before {
background: repeating-linear-gradient(
to right,
white 0px,
white 2px,
transparent 2px,
transparent 4px
);
}
.icon-overhead {
width: 24px;
height: 2px;
background: #2d3748;
border-radius: 1px;
}
.icon-btn.active .icon-overhead {
background: white;
}
/* Tool Icons */
.icon-select {
width: 20px;
height: 20px;
border: 2px solid #4a5568;
border-radius: 2px;
position: relative;
}
.icon-select::before {
content: "";
position: absolute;
top: 2px;
left: 2px;
width: 8px;
height: 8px;
border: 1px solid #4a5568;
border-radius: 1px;
}
.icon-btn.active .icon-select {
border-color: white;
}
.icon-btn.active .icon-select::before {
border-color: white;
}
.icon-delete {
width: 20px;
height: 20px;
position: relative;
}
.icon-delete::before,
.icon-delete::after {
content: "";
position: absolute;
top: 50%;
left: 50%;
width: 20px;
height: 2px;
background: #e53e3e;
border-radius: 1px;
}
.icon-delete::before {
transform: translate(-50%, -50%) rotate(45deg);
}
.icon-delete::after {
transform: translate(-50%, -50%) rotate(-45deg);
}
.icon-btn.active .icon-delete::before,
.icon-btn.active .icon-delete::after {
background: white;
}
/* Alignment Icons */
.icon-align-left {
width: 20px;
height: 16px;
position: relative;
}
.icon-align-left::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 2px;
background: #4a5568;
border-radius: 1px;
box-shadow: 0 4px 0 #4a5568, 0 8px 0 #4a5568, 0 12px 0 #4a5568;
}
.icon-btn.active .icon-align-left::before {
background: white;
box-shadow: 0 4px 0 white, 0 8px 0 white, 0 12px 0 white;
}
.icon-align-center {
width: 20px;
height: 16px;
position: relative;
}
.icon-align-center::before {
content: "";
position: absolute;
top: 0;
left: 2px;
width: 16px;
height: 2px;
background: #4a5568;
border-radius: 1px;
box-shadow: 0 4px 0 #4a5568, 0 8px 0 #4a5568, 0 12px 0 #4a5568;
}
.icon-btn.active .icon-align-center::before {
background: white;
box-shadow: 0 4px 0 white, 0 8px 0 white, 0 12px 0 white;
}
.icon-align-right {
width: 20px;
height: 16px;
position: relative;
}
.icon-align-right::before {
content: "";
position: absolute;
top: 0;
right: 0;
width: 100%;
height: 2px;
background: #4a5568;
border-radius: 1px;
box-shadow: 0 4px 0 #4a5568, 0 8px 0 #4a5568, 0 12px 0 #4a5568;
}
.icon-btn.active .icon-align-right::before {
background: white;
box-shadow: 0 4px 0 white, 0 8px 0 white, 0 12px 0 white;
}
.icon-align-top {
width: 16px;
height: 20px;
position: relative;
}
.icon-align-top::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 2px;
height: 100%;
background: #4a5568;
border-radius: 1px;
box-shadow: 4px 0 0 #4a5568, 8px 0 0 #4a5568, 12px 0 0 #4a5568;
}
.icon-btn.active .icon-align-top::before {
background: white;
box-shadow: 4px 0 0 white, 8px 0 0 white, 12px 0 0 white;
}
.icon-align-middle {
width: 16px;
height: 20px;
position: relative;
}
.icon-align-middle::before {
content: "";
position: absolute;
top: 2px;
left: 0;
width: 2px;
height: 16px;
background: #4a5568;
border-radius: 1px;
box-shadow: 4px 0 0 #4a5568, 8px 0 0 #4a5568, 12px 0 0 #4a5568;
}
.icon-btn.active .icon-align-middle::before {
background: white;
box-shadow: 4px 0 0 white, 8px 0 0 white, 12px 0 0 white;
}
.icon-align-bottom {
width: 16px;
height: 20px;
position: relative;
}
.icon-align-bottom::before {
content: "";
position: absolute;
bottom: 0;
left: 0;
width: 2px;
height: 100%;
background: #4a5568;
border-radius: 1px;
box-shadow: 4px 0 0 #4a5568, 8px 0 0 #4a5568, 12px 0 0 #4a5568;
}
.icon-btn.active .icon-align-bottom::before {
background: white;
box-shadow: 4px 0 0 white, 8px 0 0 white, 12px 0 0 white;
}
.icon-distribute-h {
width: 20px;
height: 16px;
position: relative;
}
.icon-distribute-h::before {
content: "";
position: absolute;
top: 7px;
left: 0;
width: 4px;
height: 2px;
background: #4a5568;
border-radius: 1px;
box-shadow: 8px 0 0 #4a5568, 16px 0 0 #4a5568;
}
.icon-distribute-h::after {
content: "";
position: absolute;
top: 2px;
left: 2px;
width: 1px;
height: 12px;
background: #4a5568;
border-radius: 0.5px;
box-shadow: 8px 0 0 #4a5568, 16px 0 0 #4a5568;
}
.icon-btn.active .icon-distribute-h::before {
background: white;
box-shadow: 8px 0 0 white, 16px 0 0 white;
}
.icon-btn.active .icon-distribute-h::after {
background: white;
box-shadow: 8px 0 0 white, 16px 0 0 white;
}
.icon-distribute-v {
width: 16px;
height: 20px;
position: relative;
}
.icon-distribute-v::before {
content: "";
position: absolute;
top: 0;
left: 7px;
width: 2px;
height: 4px;
background: #4a5568;
border-radius: 1px;
box-shadow: 0 8px 0 #4a5568, 0 16px 0 #4a5568;
}
.icon-distribute-v::after {
content: "";
position: absolute;
top: 2px;
left: 2px;
width: 12px;
height: 1px;
background: #4a5568;
border-radius: 0.5px;
box-shadow: 0 8px 0 #4a5568, 0 16px 0 #4a5568;
}
.icon-btn.active .icon-distribute-v::before {
background: white;
box-shadow: 0 8px 0 white, 0 16px 0 white;
}
.icon-btn.active .icon-distribute-v::after {
background: white;
box-shadow: 0 8px 0 white, 0 16px 0 white;
}
.icon-auto-arrange {
width: 20px;
height: 20px;
position: relative;
}
.icon-auto-arrange::before {
content: "";
position: absolute;
top: 2px;
left: 2px;
width: 6px;
height: 6px;
border: 2px solid #4a5568;
border-radius: 1px;
box-shadow: 10px 0 0 #4a5568, 0 10px 0 #4a5568, 10px 10px 0 #4a5568;
}
.icon-btn.active .icon-auto-arrange::before {
border-color: white;
box-shadow: 10px 0 0 white, 0 10px 0 white, 10px 10px 0 white;
}
.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: fixed;
background: rgba(0, 0, 0, 0.9);
color: white;
padding: 0.5rem;
border-radius: 4px;
font-size: 0.8rem;
pointer-events: none;
z-index: 999999;
display: none;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
border: 1px solid rgba(255, 255, 255, 0.2);
max-width: 200px;
word-wrap: break-word;
}
.mode-connect-underground #canvas,
.mode-connect-overhead #canvas {
cursor: crosshair;
}
.mode-place-triangle #canvas,
.mode-place-box #canvas,
.mode-place-pole #canvas,
.mode-place-end #canvas {
cursor: copy;
}
.mode-delete #canvas {
cursor: not-allowed;
}
.mode-select #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;
}
/* Node Type Selector Styles */
.node-type-selector {
display: flex;
gap: 8px;
margin: 8px 0;
}
.node-type-btn {
display: flex;
flex-direction: column;
align-items: center;
padding: 8px 12px;
border: 2px solid #e2e8f0;
border-radius: 8px;
background: #f7fafc;
cursor: pointer;
transition: all 0.2s ease;
flex: 1;
min-height: 60px;
font-family: inherit;
}
.node-type-btn:hover {
border-color: #4299e1;
background: #ebf8ff;
transform: translateY(-1px);
}
.node-type-btn.active {
border-color: #3182ce;
background: #3182ce;
color: white;
}
.node-type-btn .node-icon {
font-size: 16px;
margin-bottom: 4px;
display: block;
}
.node-type-btn .node-label {
font-size: 11px;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.node-type-btn.active .node-icon,
.node-type-btn.active .node-label {
color: white;
}
/* Different colors for each node type when active */
.node-type-btn[data-type="cable_box"].active {
border-color: #3182ce;
background: #3182ce;
}
.node-type-btn[data-type="pole"].active {
border-color: #4a5568;
background: #4a5568;
}
.node-type-btn[data-type="end_connection"].active {
border-color: #e53e3e;
background: #e53e3e;
}
/* 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;
}
}