nemaquant / static /style.css
tyrwh
Adding confidence threshold plotting, fixing image browser issues
e3446e1
/* Modern, consistent styling for NemaQuant */
:root {
--primary-color: #2563eb;
--primary-hover: #1d4ed8;
--secondary-color: #64748b;
--secondary-hover: #475569;
--success-color: #22c55e;
--danger-color: #ef4444;
--background: #f8fafc;
--card-bg: #ffffff;
--border-color: #e2e8f0;
--text-color: #1e293b;
--text-muted: #64748b;
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
--shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
margin: 0;
padding: 20px;
background-color: var(--background);
color: var(--text-color);
line-height: 1.5;
min-height: 100vh;
}
h1 {
text-align: center;
color: var(--text-color);
font-size: 1.875rem;
font-weight: 600;
margin: 1rem 0;
}
.container {
max-width: 1600px;
margin: 0 auto;
display: grid;
grid-template-columns: minmax(300px, 1fr) minmax(600px, 2fr);
gap: 1.5rem;
padding: 0 1rem;
}
.left-panel, .right-panel {
display: flex;
flex-direction: column;
gap: 1rem;
}
@media (max-width: 1024px) {
.container {
grid-template-columns: 1fr;
}
}
.card {
background-color: var(--card-bg);
border-radius: 0.5rem;
box-shadow: var(--shadow);
padding: 1.25rem;
}
.card.compact {
padding: 1rem;
}
.card h2 {
margin: 0 0 1rem 0;
color: var(--text-color);
font-size: 1.25rem;
font-weight: 600;
display: flex;
align-items: center;
gap: 0.5rem;
}
.card.compact h2 {
font-size: 1rem;
margin-bottom: 0.75rem;
}
/* Form Elements */
.form-group {
margin-bottom: 1rem;
}
.form-group:last-child {
margin-bottom: 0;
}
label {
display: block;
margin-bottom: 0.5rem;
font-weight: 500;
color: var(--text-color);
font-size: 0.875rem;
}
select,
input[type="text"],
input[type="number"],
textarea {
width: 100%;
padding: 0.5rem;
border: 1px solid var(--border-color);
border-radius: 0.375rem;
background-color: white;
color: var(--text-color);
font-size: 0.875rem;
transition: border-color 0.15s ease;
}
select:focus,
input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
/* File Upload */
.file-upload {
border: 2px dashed var(--border-color);
border-radius: 0.5rem;
padding: 1.5rem;
text-align: center;
cursor: pointer;
transition: all 0.15s ease;
}
.file-upload:hover,
.file-upload.drag-over {
border-color: var(--primary-color);
background-color: rgba(37, 99, 235, 0.05);
}
.file-upload input[type="file"] {
display: none;
}
.file-upload-text {
color: var(--text-muted);
margin: 0.5rem 0;
font-size: 0.875rem;
}
.file-list {
margin-top: 0.75rem;
text-align: left;
}
.file-item {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.375rem;
font-size: 0.875rem;
border-radius: 0.25rem;
}
.file-item:hover {
background-color: var(--background);
}
/* Image Preview Section */
.preview-section {
display: flex;
flex-direction: column;
margin-bottom: 1rem;
}
.image-preview {
position: relative;
border-radius: 0.5rem;
overflow: hidden;
background-color: var(--background);
display: flex;
align-items: center;
justify-content: center;
height: 400px;
cursor: default;
user-select: none;
}
.image-preview img {
object-fit: contain;
max-width: 100%;
max-height: 100%;
transform-origin: center;
transition: transform 0.1s ease-out;
display: block;
}
.image-controls {
display: flex;
gap: 0.5rem;
margin-top: 1rem;
justify-content: center;
}
/* Panning cursor states */
.image-preview.can-pan {
cursor: grab;
}
.image-preview.panning {
cursor: grabbing;
}
.image-info {
margin: 1rem 0;
padding: 0.75rem;
background-color: var(--background);
border-radius: 0.375rem;
font-size: 0.875rem;
}
/* Results Section */
.results-section {
display: flex;
flex-direction: column;
gap: 1rem;
min-height: 200px;
max-height: 400px;
}
.results-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 0.5rem;
}
.export-buttons {
display: flex;
gap: 0.5rem;
}
.table-container {
flex: 1;
overflow-y: auto;
border: 1px solid var(--border-color);
border-radius: 0.5rem;
background: white;
}
.results-table {
width: 100%;
border-collapse: collapse;
font-size: 0.875rem;
}
.results-table th {
background-color: var(--background);
font-weight: 600;
position: sticky;
top: 0;
z-index: 1;
border-bottom: 2px solid var(--border-color);
}
.results-table th,
.results-table td {
padding: 0.75rem;
text-align: left;
}
.results-table tbody tr {
border-bottom: 1px solid var(--border-color);
cursor: pointer;
transition: all 0.15s ease;
}
.results-table tbody tr:hover {
background-color: rgba(37, 99, 235, 0.05);
}
.results-table tbody tr.selected {
background-color: rgba(37, 99, 235, 0.1);
}
.text-right {
text-align: right !important;
}
.view-button {
display: inline-flex;
align-items: center;
gap: 0.25rem;
padding: 0.375rem 0.75rem;
font-size: 0.75rem;
color: var(--primary-color);
background-color: rgba(37, 99, 235, 0.1);
border-radius: 0.375rem;
transition: all 0.15s ease;
}
.view-button:hover {
background-color: rgba(37, 99, 235, 0.2);
}
.view-button i {
font-size: 1rem;
}
/* Status Log */
.status-log {
background-color: var(--background);
border-radius: 0.375rem;
padding: 0.75rem;
font-family: ui-monospace, monospace;
font-size: 0.75rem;
line-height: 1.4;
height: 120px;
overflow-y: auto;
white-space: pre-wrap;
color: var(--text-color);
border: 1px solid var(--border-color);
}
/* Buttons */
button {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.375rem;
padding: 0.5rem 1rem;
border: none;
border-radius: 0.375rem;
font-weight: 500;
font-size: 0.875rem;
cursor: pointer;
transition: all 0.15s ease;
}
button:disabled {
opacity: 0.65;
cursor: not-allowed;
}
.btn-primary {
background-color: var(--primary-color);
color: white;
}
.btn-primary:hover:not(:disabled) {
background-color: var(--primary-hover);
}
.btn-secondary {
background-color: var(--secondary-color);
color: white;
}
.btn-secondary:hover:not(:disabled) {
background-color: var(--secondary-hover);
}
/* Progress Bar */
.progress-container {
margin: 1rem 0;
}
.progress-info {
display: flex;
justify-content: space-between;
margin-bottom: 0.5rem;
font-size: 0.875rem;
}
progress {
width: 100%;
height: 0.5rem;
border-radius: 1rem;
overflow: hidden;
background-color: var(--border-color);
}
progress::-webkit-progress-bar {
background-color: var(--border-color);
}
progress::-webkit-progress-value {
background-color: var(--primary-color);
transition: width 0.3s ease;
}
progress::-moz-progress-bar {
background-color: var(--primary-color);
}
/* Loading States */
.loading {
position: relative;
pointer-events: none;
}
.loading::after {
content: "";
position: absolute;
inset: 0;
background-color: rgba(255, 255, 255, 0.7);
display: flex;
align-items: center;
justify-content: center;
}
/* Processing State */
body.processing .progress-container {
position: relative;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
.processing #start-processing i {
animation: spin 1s linear infinite;
}
.progress-container::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 2px;
background: linear-gradient(90deg,
var(--primary-color) 0%,
var(--primary-hover) 50%,
var(--primary-color) 100%);
background-size: 200% 100%;
animation: shimmer 2s infinite linear;
opacity: 0;
transition: opacity 0.3s ease;
}
body.processing .progress-container::before {
opacity: 1;
}
@keyframes shimmer {
to { background-position: 200% 0; }
}
/* Update progress bar styles for processing state */
body.processing progress::-webkit-progress-value {
background: linear-gradient(90deg,
var(--primary-color) 0%,
var(--primary-hover) 50%,
var(--primary-color) 100%);
background-size: 200% 100%;
animation: shimmer 2s infinite linear;
}
body.processing progress::-moz-progress-bar {
background: linear-gradient(90deg,
var(--primary-color) 0%,
var(--primary-hover) 50%,
var(--primary-color) 100%);
background-size: 200% 100%;
animation: shimmer 2s infinite linear;
}
/* Tooltips */
[data-tooltip] {
position: relative;
cursor: help;
}
[data-tooltip]::after {
content: attr(data-tooltip);
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%);
padding: 0.5rem 1rem;
background: rgba(0, 0, 0, 0.8);
color: white;
border-radius: 0.375rem;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
font-size: 0.875rem;
white-space: normal;
text-align: center;
max-width: 300px;
width: max-content;
pointer-events: none;
opacity: 0;
transition: opacity 0.2s ease;
z-index: 1000;
margin-bottom: 0.5rem;
}
[data-tooltip]:hover::after {
opacity: 1;
}
/* File Upload Styles */
.file-summary {
background: var(--bg-secondary);
border-radius: 6px;
padding: 0.75rem;
margin-bottom: 0.75rem;
}
.summary-header {
display: flex;
align-items: center;
gap: 0.5rem;
color: var(--text-primary);
font-weight: 500;
}
.summary-header i {
color: var(--primary-color);
}
.total-size {
color: var(--text-muted);
font-size: 0.9em;
}
.more-files {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.5rem;
color: var(--text-muted);
font-style: italic;
border-top: 1px dashed var(--border-color);
margin-top: 0.5rem;
}
.more-files i {
color: var(--text-muted);
}
.file-item {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.5rem;
border-radius: 4px;
background: var(--bg-primary);
margin: 0.25rem 0;
}
.file-item:hover {
background: var(--bg-secondary);
}
.file-item i {
color: var(--primary-color);
}
.file-name {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.file-size {
color: var(--text-muted);
font-size: 0.9em;
}
/* Pagination */
.pagination-container {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.75rem;
margin-top: 1rem;
padding-top: 1rem;
border-top: 1px solid var(--border-color);
}
.pagination-controls {
display: flex;
align-items: center;
gap: 0.25rem;
}
.pagination-btn {
min-width: 2rem;
height: 2rem;
padding: 0 0.5rem;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid var(--border-color);
border-radius: 0.375rem;
background-color: var(--card-bg);
color: var(--text-color);
font-size: 0.875rem;
cursor: pointer;
transition: all 0.2s ease-in-out;
}
.pagination-btn:hover:not(:disabled) {
background-color: var(--background);
border-color: var(--primary-color);
color: var(--primary-color);
}
.pagination-btn.active {
background-color: var(--primary-color);
border-color: var(--primary-color);
color: white;
}
.pagination-btn:disabled {
opacity: 0.5;
cursor: not-allowed;
border-color: var(--border-color);
}
.pagination-ellipsis {
color: var(--text-muted);
padding: 0 0.25rem;
user-select: none;
}
.pagination-info {
color: var(--text-muted);
font-size: 0.875rem;
}
/* Sortable Table Headers */
.results-table th[data-sort] {
cursor: pointer;
user-select: none;
position: relative;
padding-right: 1.5rem;
}
.results-table th[data-sort] .sort-icon {
position: absolute;
right: 0.5rem;
top: 50%;
transform: translateY(-50%);
opacity: 0.3;
transition: opacity 0.2s ease;
}
.results-table th[data-sort]:hover .sort-icon {
opacity: 1;
}
.results-table th.sort-asc .sort-icon,
.results-table th.sort-desc .sort-icon {
opacity: 1;
color: var(--primary-color);
}
.results-table th.sort-asc .sort-icon {
transform: translateY(-50%) rotate(180deg);
}
.range-with-value {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
gap: 1em;
}
#confidence-value {
font-size: 1.1em;
min-width: 2.5em;
text-align: right;
margin-top: 0;
align-self: auto;
}