test / assets /css /styles.css
terryyz's picture
Upload folder using huggingface_hub
4797717 verified
/* Basic Reset */
:root {
--color-primary: #007bff;
--color-secondary: #6c757d;
--color-background: #f8f9fa;
--color-card-bg: #ffffff;
--color-text: #343a40;
--color-success: #28a745;
--color-shadow: rgba(0, 0, 0, 0.1);
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
line-height: 1.6;
color: var(--color-text);
background-color: var(--color-background);
min-height: 100vh;
display: flex;
flex-direction: column;
}
.container {
width: 90%;
max-width: 1000px;
margin: 0 auto;
padding: 1rem 0;
}
/* Header */
header {
background: var(--color-card-bg);
border-bottom: 1px solid #dee2e6;
box-shadow: 0 2px 4px var(--color-shadow);
}
.header-content {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 1rem;
}
header h1 {
font-size: 1.5rem;
color: var(--color-primary);
}
.built-with a {
color: var(--color-secondary);
text-decoration: none;
font-size: 0.9rem;
transition: color 0.3s;
}
.built-with a:hover {
color: var(--color-primary);
text-decoration: underline;
}
/* Main Content */
main {
flex-grow: 1;
padding-top: 2rem;
padding-bottom: 3rem;
}
h2 {
color: var(--color-primary);
margin-bottom: 1.5rem;
font-size: 1.75rem;
border-bottom: 2px solid #e9ecef;
padding-bottom: 0.5rem;
}
/* Form Styling */
#vlm-input {
background: var(--color-card-bg);
padding: 1.5rem;
border-radius: 8px;
box-shadow: 0 4px 12px var(--color-shadow);
margin-bottom: 2rem;
}
.input-group {
margin-bottom: 1.5rem;
}
label {
display: block;
font-weight: bold;
margin-bottom: 0.5rem;
color: var(--color-text);
}
textarea, input[type="text"] {
width: 100%;
padding: 0.75rem;
border: 1px solid #ced4da;
border-radius: 4px;
font-size: 1rem;
transition: border-color 0.3s, box-shadow 0.3s;
}
textarea:focus, input[type="text"]:focus {
border-color: var(--color-primary);
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
outline: none;
}
/* File Upload Area */
.file-upload-area {
text-align: center;
}
#image-upload {
/* Hide the default input, rely on custom preview area interaction */
display: none;
}
.image-preview {
border: 2px dashed #adb5bd;
border-radius: 8px;
padding: 2rem;
cursor: pointer;
background-color: #e9ecef;
transition: background-color 0.3s, border-color 0.3s;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 200px;
position: relative;
overflow: hidden;
}
.image-preview:hover {
background-color: #dee2e6;
border-color: var(--color-primary);
}
.image-preview i {
font-size: 3rem;
color: var(--color-secondary);
margin-bottom: 0.5rem;
}
.image-preview p {
color: var(--color-secondary);
font-size: 0.9rem;
}
#preview-img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: contain; /* Ensure the whole image is visible */
background-color: var(--color-card-bg);
}
.image-preview.has-image i,
.image-preview.has-image p {
display: none;
}
.image-preview.has-image #preview-img {
object-fit: cover; /* Use cover when image is loaded */
}
/* Button */
#submit-btn {
display: block;
width: 100%;
padding: 1rem;
border: none;
border-radius: 4px;
background-color: var(--color-primary);
color: white;
font-size: 1.1rem;
font-weight: bold;
cursor: pointer;
transition: background-color 0.3s, opacity 0.3s;
}
#submit-btn:hover:not(:disabled) {
background-color: #0056b3;
}
#submit-btn:disabled {
background-color: var(--color-secondary);
opacity: 0.7;
cursor: not-allowed;
}
/* VLM Output Area */
#vlm-output {
margin-top: 2rem;
}
.response-card {
background: var(--color-card-bg);
padding: 1.5rem;
border-left: 5px solid var(--color-success);
border-radius: 4px;
box-shadow: 0 2px 8px var(--color-shadow);
min-height: 150px;
display: flex;
align-items: center;
justify-content: center;
text-align: left;
}
#response-text {
white-space: pre-wrap;
font-family: monospace;
font-size: 1rem;
color: var(--color-text);
padding: 0;
margin: 0;
}
/* Utility */
.hidden {
display: none !important;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border-width: 0;
}
/* Spinner */
.spinner {
border: 4px solid rgba(0, 0, 0, 0.1);
border-top: 4px solid var(--color-primary);
border-radius: 50%;
width: 40px;
height: 40px;
animation: spin 1s linear infinite;
margin: 1rem auto;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* Footer */
footer {
background: var(--color-text);
color: white;
text-align: center;
padding: 1rem 0;
margin-top: auto;
}
footer p {
font-size: 0.9rem;
}
/* Responsiveness */
@media (min-width: 768px) {
header h1 {
font-size: 2rem;
}
.header-content {
padding: 1rem 0;
}
#vlm-input {
padding: 2rem;
}
#submit-btn {
width: 50%;
margin: 0 auto;
}
/* Layout adjustment for larger screens (if needed, though single column is fine here) */
}