barcode-scanner / styles.css
kedar-bhumkar's picture
Upload 4 files
474a754 verified
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
background-color: #f5f5f5;
color: #333;
line-height: 1.6;
}
.container {
max-width: 900px;
margin: 2rem auto;
padding: 2rem;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
margin-bottom: 2rem;
color: #2c3e50;
}
h2 {
color: #3498db;
margin-bottom: 1rem;
}
h3 {
color: #2c3e50;
margin-bottom: 0.8rem;
}
.upload-section {
margin-bottom: 2rem;
text-align: center;
}
.upload-label {
display: inline-block;
padding: 12px 24px;
background-color: #3498db;
color: white;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}
.upload-label:hover {
background-color: #2980b9;
}
input[type="file"] {
display: none;
}
.preview-section {
display: flex;
flex-wrap: wrap;
gap: 2rem;
margin-bottom: 2rem;
}
.image-preview, .result-section {
flex: 1;
min-width: 300px;
}
#scanner-container {
position: relative;
max-width: 100%;
margin-top: 1rem;
border-radius: 5px;
overflow: hidden;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
#preview {
max-width: 100%;
display: block;
}
#scanCanvas {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 10;
pointer-events: none;
}
#status {
margin-bottom: 1rem;
padding: 10px;
background-color: #f8f9fa;
border-radius: 5px;
font-style: italic;
}
#result {
padding: 15px;
background-color: #e9f7fe;
border-radius: 5px;
border-left: 4px solid #3498db;
word-break: break-all;
min-height: 50px;
white-space: pre-line;
}
.info-section, .troubleshooting-section {
margin-top: 2rem;
padding: 1.5rem;
background-color: #f8f9fa;
border-radius: 5px;
}
.info-section {
border-left: 4px solid #2c3e50;
}
.troubleshooting-section {
border-left: 4px solid #e74c3c;
margin-top: 1.5rem;
}
.info-section ul, .troubleshooting-section ol {
margin-left: 1.5rem;
margin-top: 0.5rem;
}
.info-section p, .troubleshooting-section p {
margin-bottom: 0.5rem;
}
.troubleshooting-section li {
margin-bottom: 0.5rem;
}
.troubleshooting-section strong {
color: #e74c3c;
}
/* Security warning */
.security-warning {
background-color: #fff3cd;
color: #856404;
padding: 15px;
margin-bottom: 20px;
border-radius: 5px;
border-left: 4px solid #ffc107;
font-size: 0.95rem;
line-height: 1.5;
}
.security-warning strong {
color: #e67e22;
}
/* Camera styles */
.camera-controls {
display: flex;
justify-content: center;
gap: 10px;
margin: 1rem 0;
}
.camera-controls button {
padding: 10px 20px;
background-color: #3498db;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
font-size: 1rem;
}
.camera-controls button:hover {
background-color: #2980b9;
}
.camera-controls button:disabled {
background-color: #95a5a6;
cursor: not-allowed;
}
#stop-camera {
background-color: #e74c3c;
}
#stop-camera:hover {
background-color: #c0392b;
}
#switch-camera {
background-color: #2ecc71;
}
#switch-camera:hover {
background-color: #27ae60;
}
#focus-mode {
background-color: #9b59b6;
}
#focus-mode:hover {
background-color: #8e44ad;
}
#focus-mode.active {
background-color: #e74c3c;
}
#focus-mode.active:hover {
background-color: #c0392b;
}
#capture-image {
background-color: #f39c12;
}
#capture-image:hover {
background-color: #e67e22;
}
#retry-permission {
background-color: #f39c12;
margin-top: 10px;
}
#retry-permission:hover {
background-color: #d35400;
}
.return-to-camera-btn {
display: block;
margin: 15px auto;
padding: 10px 20px;
background-color: #3498db;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
font-size: 1rem;
}
.return-to-camera-btn:hover {
background-color: #2980b9;
}
.camera-container {
position: relative;
width: 100%;
max-width: 640px;
margin: 0 auto 1rem;
border-radius: 5px;
overflow: hidden;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
#camera-feed {
width: 100%;
display: block;
}
/* Scanning indicator and animation */
.scan-indicator {
position: absolute;
top: 10px;
right: 10px;
width: 12px;
height: 12px;
border-radius: 50%;
background-color: #e74c3c;
box-shadow: 0 0 5px rgba(231, 76, 60, 0.7);
z-index: 20;
}
.scan-indicator.pulse {
animation: pulse 0.2s ease-out;
}
@keyframes pulse {
0% {
transform: scale(1);
opacity: 1;
}
50% {
transform: scale(1.5);
opacity: 0.7;
}
100% {
transform: scale(1);
opacity: 1;
}
}
/* Scanning animation */
.camera-container::after {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 3px;
background: linear-gradient(to right, transparent, #3498db, transparent);
animation: scanner-animation 2s linear infinite;
z-index: 15;
opacity: 0.7;
}
@keyframes scanner-animation {
0% {
top: 0;
}
50% {
top: 100%;
}
50.1% {
top: 0;
}
100% {
top: 100%;
}
}
/* Enhancement toggle */
.enhancement-toggle-container {
display: flex;
align-items: center;
margin-top: 10px;
padding: 8px 12px;
background-color: #f8f9fa;
border-radius: 5px;
border-left: 3px solid #3498db;
}
#enhancement-toggle {
margin-right: 10px;
width: 18px;
height: 18px;
cursor: pointer;
}
.enhancement-toggle-container label {
font-size: 0.9rem;
cursor: pointer;
}
/* Debug mode */
.debug-toggle-container {
background-color: #f8f9fa;
border-left: 3px solid #e74c3c;
}
.debug-info {
margin-top: 15px;
padding: 10px;
background-color: #2c3e50;
color: #ecf0f1;
border-radius: 5px;
font-family: monospace;
font-size: 0.85rem;
max-height: 300px;
overflow-y: auto;
}
.debug-entry {
padding: 5px 0;
border-bottom: 1px solid #34495e;
}
.debug-entry:first-child {
border-top: 1px solid #34495e;
}
.debug-entry strong {
color: #3498db;
}
.debug-entry ul {
margin: 5px 0 5px 20px;
padding: 0;
list-style-type: none;
}
.debug-entry li {
margin: 2px 0;
}
/* Focus mode styles */
.focus-mode-active .camera-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
max-width: none;
margin: 0;
z-index: 1000;
border-radius: 0;
}
.focus-mode-active #camera-feed {
width: 100%;
height: 100%;
object-fit: cover;
}
.focus-mode-active .camera-controls {
position: fixed;
bottom: 20px;
left: 0;
right: 0;
z-index: 1001;
background-color: rgba(0, 0, 0, 0.5);
padding: 10px;
border-radius: 0;
}
.focus-mode-active .enhancement-toggle-container,
.focus-mode-active .debug-toggle-container {
display: none;
}
.focus-mode-active #status {
position: fixed;
top: 20px;
left: 0;
right: 0;
z-index: 1001;
background-color: rgba(0, 0, 0, 0.5);
color: white;
border-radius: 0;
text-align: center;
margin: 0 auto;
max-width: 80%;
}
.focus-mode-active .scan-indicator {
width: 16px;
height: 16px;
}
.focus-mode-active .scan-indicator.pulse {
animation: focus-pulse 0.2s ease-out;
}
@keyframes focus-pulse {
0% {
transform: scale(1);
opacity: 1;
}
50% {
transform: scale(2);
opacity: 0.7;
}
100% {
transform: scale(1);
opacity: 1;
}
}
@media (max-width: 768px) {
.container {
padding: 1rem;
margin: 1rem;
}
.preview-section {
flex-direction: column;
}
.camera-controls {
flex-direction: column;
align-items: center;
}
.camera-controls button {
width: 100%;
max-width: 300px;
}
}