Skip to content
Home
Barkod Okuyucu
Barkod Oluşturma
Blog
More
barkod oluşturma
About
Contacts
Disclaimer
Kullanım Şartları
Gizlilik Politikası
Home
Barkod Okuyucu
Barkod Oluşturma
Blog
More
barkod oluşturma
About
Contacts
Disclaimer
Kullanım Şartları
Gizlilik Politikası
Menu
Barkod Oluşturucu ve Tarayıcı - Ücretsiz Online Araç
Barkod Oluştur
Barkod Tara
Barkod Verisi
Barkod Türü
Code 128
Code 39
EAN-13
UPC-A
QR Kod
Barkod Oluştur
📥 İndir
🖨️ Yazdır
📋 Kopyala
📤 Paylaş
Tür:
Değer:
📷 Taramayı Başlat
⏹️ Taramayı Durdur
Taranan Barkod:
Barkod Önizleme
Barkod burada görünecek
Son Barkodlar
🔄 Oluştur
📷 Tara
`); printWindow.document.close(); printWindow.print(); }async function copyBarcode() { if (!generatedBarcode) return;try { if (generatedBarcode.canvas) { const blob = await new Promise(resolve => { generatedBarcode.canvas.toBlob(resolve); }); await navigator.clipboard.write([ new ClipboardItem({ 'image/png': blob }) ]); } else { await navigator.clipboard.writeText(generatedBarcode.value); } showSuccess('success-copied'); } catch (error) { // Fallback to copying text try { await navigator.clipboard.writeText(generatedBarcode.value); showSuccess('success-copied'); } catch (fallbackError) { console.error('Copy failed:', fallbackError); } } }async function shareBarcode() { if (!generatedBarcode || !navigator.share) return;try { if (generatedBarcode.canvas) { const blob = await new Promise(resolve => { generatedBarcode.canvas.toBlob(resolve); }); const file = new File([blob], `barcode_${generatedBarcode.value}.png`, { type: 'image/png' }); await navigator.share({ title: 'Barcode', text: `Barcode: ${generatedBarcode.value}`, files: [file] }); } else { await navigator.share({ title: 'Barcode', text: `Barcode: ${generatedBarcode.value}` }); } } catch (error) { console.error('Share failed:', error); } }async function startScanner() { const startBtn = document.getElementById('startScanBtn'); const stopBtn = document.getElementById('stopScanBtn'); try { html5QrCode = new Html5Qrcode("reader"); const config = { fps: 10, qrbox: { width: 250, height: 250 }, aspectRatio: 1.0 };await html5QrCode.start( { facingMode: "environment" }, config, onScanSuccess, onScanFailure );isScanning = true; startBtn.classList.add('hidden'); stopBtn.classList.remove('hidden'); } catch (error) { console.error('Scanner start error:', error); showError('camera-error'); } }async function stopScanner() { const startBtn = document.getElementById('startScanBtn'); const stopBtn = document.getElementById('stopScanBtn'); if (html5QrCode && isScanning) { try { await html5QrCode.stop(); html5QrCode.clear(); } catch (error) { console.error('Scanner stop error:', error); } }isScanning = false; startBtn.classList.remove('hidden'); stopBtn.classList.add('hidden'); }function onScanSuccess(decodedText, decodedResult) { const resultContainer = document.getElementById('scanResult'); const resultValue = document.getElementById('scanResultValue'); resultValue.textContent = decodedText; resultContainer.classList.remove('hidden'); // Auto-fill generator with scanned result document.getElementById('barcodeInput').value = decodedText; autoDetectBarcodeType(decodedText); // Show success message showSuccess('scan-success'); // Stop scanner after successful scan stopScanner(); }function onScanFailure(error) { // Ignore scan failures - they're normal during scanning }function showError(messageKey) { hideMessages(); const errorDiv = document.getElementById('errorMessage'); errorDiv.textContent = translations[currentLanguage][messageKey]; errorDiv.classList.remove('hidden'); }function showSuccess(messageKey) { hideMessages(); const successDiv = document.getElementById('successMessage'); successDiv.textContent = translations[currentLanguage][messageKey]; successDiv.classList.remove('hidden'); // Auto-hide after 3 seconds setTimeout(() => { successDiv.classList.add('hidden'); }, 3000); }function hideMessages() { document.getElementById('errorMessage').classList.add('hidden'); document.getElementById('successMessage').classList.add('hidden'); }// Keyboard shortcuts document.addEventListener('keydown', function(e) { if (e.ctrlKey || e.metaKey) { switch (e.key) { case 'Enter': e.preventDefault(); generateBarcode(); break; case 'd': e.preventDefault(); if (generatedBarcode) downloadBarcode(); break; case 'p': e.preventDefault(); if (generatedBarcode) printBarcode(); break; } } });// Handle input on Enter key document.getElementById('barcodeInput').addEventListener('keypress', function(e) { if (e.key === 'Enter') { generateBarcode(); } });// PWA install prompt let deferredPrompt; window.addEventListener('beforeinstallprompt', (e) => { deferredPrompt = e; // You could show a custom install button here });