Files
OCR/frontend/src/app/templates/templates.component.scss

318 lines
6.9 KiB
SCSS

.template-mapping-container {
height: calc(100vh - 100px);
padding: 1rem;
background-color: var(--surface-ground);
}
.panel-container {
display: flex;
flex-direction: column;
height: calc(100% - 1rem);
width: calc(100% - 1rem);
margin: 0.5rem;
background: var(--surface-card);
overflow: hidden;
border-radius: 8px;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.header-section {
padding: 1rem;
border-bottom: 1px solid var(--surface-border);
display: flex;
justify-content: space-between;
align-items: center;
h2 {
margin: 0;
font-size: 1.25rem;
font-weight: 600;
}
}
.preview-area, .mapping-area {
flex: 1;
overflow-y: auto;
padding: 1rem;
background-color: var(--surface-ground);
}
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
color: var(--text-color-secondary);
text-align: center;
}
.document-canvas {
position: relative;
width: 100%;
background: white;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
border-radius: 4px;
overflow: hidden;
}
/* Draggable Nodes */
.layout-node {
position: absolute;
box-sizing: content-box !important;
border: 6px solid transparent;
margin: -6px !important;
background-clip: padding-box;
background: rgba(255, 255, 255, 0.9);
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
border-radius: 4px;
transition: box-shadow 0.2s, border-color 0.2s;
overflow: hidden;
resize: both;
display: flex;
flex-direction: column;
justify-content: center;
min-width: 60px;
min-height: 25px;
padding: 4px 6px;
&:active {
cursor: grabbing;
}
.node-type {
font-size: 0.5rem;
color: var(--text-color-secondary);
text-transform: uppercase;
font-weight: 600;
margin-bottom: 0.1rem;
line-height: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.node-text {
font-size: 0.65rem;
color: var(--text-color);
line-height: 1.2;
white-space: normal;
word-break: break-word;
}
/* Color coding by block type - use borders now instead of thick left border */
&.header { box-shadow: inset 0 0 0 1.5px #3B82F6; }
&.vendor { box-shadow: inset 0 0 0 1.5px #8B5CF6; }
&.table_header { box-shadow: inset 0 0 0 1.5px #F59E0B; }
&.total { box-shadow: inset 0 0 0 1.5px #10B981; }
&.tax { box-shadow: inset 0 0 0 1.5px #EF4444; }
&:hover {
z-index: 10;
&.header { box-shadow: inset 0 0 0 2px #3B82F6, 0 4px 8px rgba(59, 130, 246, 0.2); }
&.vendor { box-shadow: inset 0 0 0 2px #8B5CF6, 0 4px 8px rgba(139, 92, 246, 0.2); }
&.table_header { box-shadow: inset 0 0 0 2px #F59E0B, 0 4px 8px rgba(245, 158, 11, 0.2); }
&.total { box-shadow: inset 0 0 0 2px #10B981, 0 4px 8px rgba(16, 185, 129, 0.2); }
&.tax { box-shadow: inset 0 0 0 2px #EF4444, 0 4px 8px rgba(239, 68, 68, 0.2); }
}
.drag-handle {
position: absolute;
top: 0px;
left: 0px;
font-size: 0.55rem;
color: var(--text-color-secondary);
background: white;
border-radius: 50%;
width: 14px;
height: 14px;
display: flex;
align-items: center;
justify-content: center;
cursor: grab;
opacity: 0;
transition: opacity 0.2s, transform 0.2s;
z-index: 25;
box-shadow: 0 1px 3px rgba(0,0,0,0.2);
border: 1px solid var(--surface-border);
&:active {
cursor: grabbing;
}
&:hover {
color: var(--primary-color);
transform: scale(1.1);
}
}
&:hover .drag-handle {
opacity: 1;
}
.close-icon {
position: absolute;
top: 0px;
right: 0px;
font-size: 0.55rem;
color: white;
background: #EF4444;
border-radius: 50%;
width: 14px;
height: 14px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
opacity: 0;
transition: opacity 0.2s, transform 0.2s;
z-index: 25;
box-shadow: 0 1px 3px rgba(0,0,0,0.3);
&:hover {
background: #DC2626;
transform: scale(1.1);
}
}
&:hover .close-icon {
opacity: 1;
}
}
/* Template Mapping Side */
.template-field-container {
background: white;
border: 1px solid var(--surface-border);
border-radius: 6px;
margin-bottom: 1rem;
overflow: hidden;
.field-header {
background: var(--surface-ground);
padding: 0.75rem 1rem;
border-bottom: 1px solid var(--surface-border);
display: flex;
justify-content: space-between;
align-items: center;
.badge {
font-size: 0.7rem;
padding: 0.2rem 0.5rem;
background: var(--primary-color);
color: var(--primary-color-text);
border-radius: 12px;
}
}
.drop-zone {
padding: 1rem;
min-height: 60px;
.placeholder {
color: var(--text-color-secondary);
font-style: italic;
font-size: 0.85rem;
}
}
}
.mapped-node {
background: var(--primary-50);
color: var(--primary-900);
padding: 0.5rem;
border-radius: 4px;
font-size: 0.9rem;
border: 1px solid var(--primary-200);
display: flex;
align-items: center;
}
/* CDK Drag Drop */
.cdk-drag-preview {
box-sizing: border-box;
border-radius: 4px;
box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2),
0 8px 10px 1px rgba(0, 0, 0, 0.14),
0 3px 14px 2px rgba(0, 0, 0, 0.12);
}
.cdk-drag-placeholder {
opacity: 0.3;
}
.cdk-drag-animating {
transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
}
/* Scanning Overlay Animation */
.scanning-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(255, 255, 255, 0.9);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
z-index: 100;
}
.scanner-container {
position: relative;
width: 120px;
height: 120px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 8px;
overflow: hidden;
background: #f8f9fa;
box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
border: 1px solid #e9ecef;
}
.scanner-doc {
z-index: 1;
}
.laser-beam {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 3px;
background: var(--primary-color, #3b82f6);
box-shadow: 0 0 10px 2px var(--primary-color, #3b82f6);
z-index: 2;
animation: scan-laser 2s ease-in-out infinite alternate;
}
.scanner-grid {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: linear-gradient(var(--primary-100, #dbeafe) 1px, transparent 1px),
linear-gradient(90deg, var(--primary-100, #dbeafe) 1px, transparent 1px);
background-size: 10px 10px;
z-index: 0;
opacity: 0.5;
animation: scan-grid 4s linear infinite;
}
@keyframes scan-laser {
0% { top: -5%; opacity: 0; }
10% { opacity: 1; }
90% { opacity: 1; }
100% { top: 105%; opacity: 0; }
}
@keyframes scan-grid {
0% { background-position: 0 0; }
100% { background-position: 20px 20px; }
}