dolibarr.handybarcodescanner/css/scanner.css
data cf244aac31 Initial release: HandyBarcodeScanner Dolibarr Module v1.0
Features:
- Order mode: Scan products, select supplier, add to draft orders
- Shop mode: Scan products, access supplier shop links
- Inventory mode: Scan products, update stock levels

- Touch-optimized mobile interface
- QuaggaJS for browser-based barcode scanning
- Supports EAN-13, EAN-8, Code128, Code39
- Integrated into Dolibarr standard layout
- Admin settings with QR code for mobile access
- German and English translations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 11:08:17 +01:00

545 lines
8.7 KiB
CSS

/* HandyBarcodeScanner - Dolibarr integrated CSS */
/* General */
.hidden {
display: none !important;
}
.scanner-wrapper {
max-width: 800px;
margin: 0 auto;
}
/* Scanner Video Box */
.scanner-box {
background: #333;
border-radius: 8px;
overflow: hidden;
margin-bottom: 15px;
}
.scanner-video-box {
position: relative;
width: 100%;
aspect-ratio: 4/3;
max-height: 300px;
background: #000;
}
#scanner-video {
width: 100%;
height: 100%;
object-fit: cover;
}
.scan-region-highlight {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 70%;
height: 60%;
border: 3px solid var(--butactionbg, #0077b3);
border-radius: 8px;
box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
pointer-events: none;
}
.scanner-video-box.scanning .scan-region-highlight {
animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
0%, 100% { border-color: var(--butactionbg, #0077b3); }
50% { border-color: #00b894; }
}
/* Scanner Controls */
.scanner-controls {
padding: 15px;
background: #444;
}
.scanner-controls .button {
min-width: 150px;
font-size: 16px;
padding: 10px 25px;
}
/* Last Scan Info */
.scanner-last-scan {
padding: 10px 15px;
background: var(--colorbacklinepair1, #f8f8f8);
border-radius: 6px;
font-size: 14px;
}
.scanner-last-scan .badge {
font-family: monospace;
font-size: 14px;
padding: 4px 10px;
}
/* Result Area */
.scanner-result {
animation: slideUp 0.3s ease;
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(15px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Product Card */
.product-card {
background: var(--colorbacklinepair1, #f8f8f8);
border: 1px solid var(--colorborder, #ddd);
border-radius: 8px;
padding: 15px;
margin-bottom: 15px;
}
.product-name {
font-size: 18px;
font-weight: 600;
margin-bottom: 5px;
color: var(--colortextlink, #333);
}
.product-ref {
font-size: 13px;
color: var(--colortexttitlenotab, #666);
margin-bottom: 10px;
}
.product-stock {
font-size: 14px;
padding: 6px 12px;
background: var(--colorbacktitle1, #e8e8e8);
border-radius: 6px;
display: inline-block;
}
/* Supplier Selection */
.supplier-list {
margin: 15px 0;
}
.supplier-label {
font-size: 14px;
font-weight: 600;
color: var(--colortexttitlenotab, #666);
margin-bottom: 10px;
display: block;
}
.supplier-option {
display: flex;
align-items: center;
padding: 12px 15px;
background: var(--colorbacklinepair1, #fff);
border: 2px solid var(--colorborder, #ddd);
border-radius: 8px;
margin-bottom: 8px;
cursor: pointer;
transition: all 0.2s ease;
}
.supplier-option:hover {
background: var(--colorbacklinepair2, #f5f5f5);
}
.supplier-option.selected {
border-color: var(--butactionbg, #0077b3);
background: rgba(0, 119, 179, 0.05);
}
.supplier-option:active {
transform: scale(0.99);
}
.supplier-radio {
width: 20px;
height: 20px;
border: 2px solid var(--colorborder, #999);
border-radius: 50%;
margin-right: 12px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.supplier-option.selected .supplier-radio {
border-color: var(--butactionbg, #0077b3);
}
.supplier-option.selected .supplier-radio::after {
content: '';
width: 10px;
height: 10px;
background: var(--butactionbg, #0077b3);
border-radius: 50%;
}
.supplier-info {
flex: 1;
}
.supplier-name {
font-size: 15px;
font-weight: 500;
}
.supplier-price {
font-size: 16px;
font-weight: 700;
color: var(--butactionbg, #0077b3);
text-align: right;
white-space: nowrap;
}
.cheapest-badge {
background: #00b894;
color: #fff;
font-size: 10px;
font-weight: 700;
padding: 2px 6px;
border-radius: 3px;
margin-left: 8px;
text-transform: uppercase;
}
/* Quantity Input */
.quantity-section {
margin: 20px 0;
text-align: center;
}
.quantity-label {
font-size: 14px;
font-weight: 600;
color: var(--colortexttitlenotab, #666);
margin-bottom: 10px;
display: block;
}
.quantity-controls {
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
}
.qty-btn {
width: 50px;
height: 50px;
border: 1px solid var(--colorborder, #ddd);
border-radius: 8px;
background: var(--colorbacklinepair1, #f8f8f8);
color: var(--colortextlink, #333);
font-size: 24px;
font-weight: bold;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.15s ease;
}
.qty-btn:hover {
background: var(--colorbacktitle1, #e8e8e8);
}
.qty-btn:active {
transform: scale(0.95);
}
.qty-input {
width: 80px;
height: 50px;
text-align: center;
font-size: 20px;
font-weight: 700;
border: 1px solid var(--colorborder, #ddd);
border-radius: 8px;
background: #fff;
}
.qty-input:focus {
border-color: var(--butactionbg, #0077b3);
outline: none;
}
/* Action Buttons */
.action-btn {
width: 100%;
padding: 14px;
font-size: 16px;
font-weight: 600;
border: none;
border-radius: 6px;
cursor: pointer;
transition: all 0.2s ease;
margin-top: 15px;
}
.action-btn:active {
transform: scale(0.98);
}
.btn-primary {
background: var(--butactionbg, #0077b3);
color: #fff;
}
.btn-primary:hover {
opacity: 0.9;
}
.btn-secondary {
background: var(--colorbacklinepair1, #f8f8f8);
color: var(--colortextlink, #333);
border: 1px solid var(--colorborder, #ddd);
}
.btn-danger {
background: #dc3545;
color: #fff;
}
/* Inventory Mode */
.stock-display {
display: flex;
justify-content: space-around;
align-items: center;
padding: 20px;
background: var(--colorbacklinepair1, #f8f8f8);
border: 1px solid var(--colorborder, #ddd);
border-radius: 8px;
margin-bottom: 15px;
}
.stock-item {
text-align: center;
}
.stock-value {
font-size: 28px;
font-weight: 700;
color: var(--butactionbg, #0077b3);
}
.stock-label {
font-size: 12px;
color: var(--colortexttitlenotab, #666);
text-transform: uppercase;
margin-top: 5px;
}
.stock-arrow {
font-size: 24px;
color: var(--colortexttitlenotab, #999);
}
/* Shop Mode Links */
.shop-links {
margin-top: 15px;
}
.shop-link-btn {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px 18px;
background: var(--colorbacklinepair1, #fff);
border: 1px solid var(--colorborder, #ddd);
border-radius: 8px;
margin-bottom: 10px;
text-decoration: none;
color: var(--colortextlink, #333);
transition: all 0.2s ease;
}
.shop-link-btn:hover {
background: var(--colorbacklinepair2, #f5f5f5);
text-decoration: none;
}
.shop-link-btn:active {
transform: scale(0.99);
}
.shop-link-name {
font-size: 15px;
font-weight: 600;
}
.shop-link-arrow {
font-size: 18px;
color: var(--butactionbg, #0077b3);
}
/* Confirmation Dialog */
.confirm-dialog {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.6);
display: flex;
align-items: center;
justify-content: center;
z-index: 10000;
padding: 20px;
}
.confirm-content {
background: #fff;
border-radius: 12px;
padding: 25px;
width: 100%;
max-width: 350px;
text-align: center;
box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.confirm-title {
font-size: 18px;
font-weight: 600;
margin-bottom: 10px;
}
.confirm-message {
font-size: 14px;
color: #666;
margin-bottom: 20px;
}
.confirm-buttons {
display: flex;
gap: 10px;
}
.confirm-buttons .action-btn {
flex: 1;
margin-top: 0;
padding: 12px;
font-size: 14px;
}
/* Toast Notifications - use Dolibarr's setEventMessages style */
.scanner-toast {
position: fixed;
bottom: 80px;
left: 50%;
transform: translateX(-50%);
padding: 12px 24px;
border-radius: 6px;
font-size: 14px;
font-weight: 500;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
z-index: 10001;
animation: toastIn 0.3s ease;
}
.scanner-toast.success {
background: #00b894;
color: #fff;
}
.scanner-toast.error {
background: #dc3545;
color: #fff;
}
@keyframes toastIn {
from {
opacity: 0;
transform: translateX(-50%) translateY(15px);
}
to {
opacity: 1;
transform: translateX(-50%) translateY(0);
}
}
/* Error State */
.error-message {
text-align: center;
padding: 30px 20px;
color: #dc3545;
}
.error-icon {
font-size: 40px;
margin-bottom: 15px;
}
.error-text {
font-size: 15px;
}
/* No Supplier State */
.no-supplier {
text-align: center;
padding: 15px;
background: #fff3cd;
border: 1px solid #ffc107;
border-radius: 8px;
color: #856404;
margin-bottom: 15px;
}
/* Mobile Optimizations */
@media (max-width: 768px) {
.scanner-wrapper {
padding: 0 10px;
}
.scanner-video-box {
max-height: 250px;
}
.qty-btn {
width: 60px;
height: 60px;
font-size: 28px;
}
.qty-input {
width: 100px;
height: 60px;
font-size: 24px;
}
.action-btn {
padding: 16px;
font-size: 17px;
}
.supplier-option {
padding: 15px;
}
.stock-value {
font-size: 32px;
}
}
/* Touch optimizations */
@media (pointer: coarse) {
.qty-btn,
.supplier-option,
.action-btn,
.shop-link-btn {
min-height: 48px;
}
}