-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
172 lines (144 loc) · 7.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<!doctype html>
<html lang="en">
<head>
<title>LBG - Welcome</title>
<meta name="COPYRIGHT" content="Javier Fernando Huamanchumo Arauco 2021">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="google-site-verification" content="2e5Brq50XynRKU_QLjS2Ge8AJcwy-nKxaHP0Hur1zGc" />
<meta name="description" content="Free and simple online barcode images generator. Lazy barcode generator let's you enter a list of barcode values, select a symbology, and generate barcodes using bwipjs-Online Barcode API">
<meta name="keywords" content="bwipjs generator, online, free, online barcodes, barcode images list, export barcodes images, barcode, barcodes images, barcodes generator, barcodes list generator, barcodes list, code 128, datamatrix, gs1, qrcode">
<meta name="REVISIT-AFTER" content="7 days">
<meta name="ROBOTS" content="all">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-aFq/bzH65dt+w6FI2ooMVUpc+21e0SRygnTpmBvdBgSdnuTN7QbdgL+OapgHtvPp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
crossorigin="anonymous"></script>
<link rel="stylesheet" href="main.css">
<script type="text/javascript" src="bwip-js/dist/bwip-js-min.js"></script>
<script src="barcodes.js"></script>
<script src="export.js"></script>
</head>
<body>
<div class="container-fluid" style="max-width: 1020px;">
<!-- Header -->
<div class="header" id="myHeader">
<h1>Lazy barcodes generator</h1>
<p>A simple display of barcodes using <a
href="https://github.com/metafloor/bwip-js/wiki/Online-Barcode-API">bwipjs-Online Barcode API</a>
</p>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="darkModeToggle">
<label class="form-check-label" for="darkModeToggle">Dark mode</label>
</div>
<!-- Entry -->
<div class="row border main-form">
<div class="col-xl-3 d-none d-sm-block p-4" >
<ul>
<li>To add more symbologies, just edit this file and add more elements from the <a
href="https://github.com/metafloor/bwip-js/wiki/BWIPP-Barcode-Types">supported barcodes</a>
list.
</li>
<li>
Yo can use , ; and break lines to separate each barcode value
</li>
<li>
There's no limit for the number of codes, but each row shows 4 barcodes at most
</li>
</ul>
</div>
<form id="dataForm" class="col-xl-6 p-4 order-3">
<div class="form-group row">
<label for="exampleFormControlSelect1" class="form-label">Barcodes</label>
<textarea id="barcodesEntry" class="form-control" rows="6">AAA1234;BBB1234</textarea>
</div>
<br>
<div class="row">
<button type="button" class="btn btn-primary btn-lg btn-block"
onclick="generateBarcodes()">Generate</button>
</div>
<br>
<div class="row">
<button id="exportBtn" disabled="true" type="button" class="btn btn-secondary btn-lg btn-block"
onclick="exportPdf()">Export</button>
</div>
</form>
<div class="col-xl-3 p-4 order-2 order-xl-last">
<form id="dataForm">
<div class="form-group row">
<label for="symbologySelect" class="form-label">Symbology</label>
<select class="form-control" id="symbologySelector">
<option value="code128">Code 128</option>
<option value="datamatrix">Data Matrix</option>
<option value="gs1datamatrix">GS1 Data Matrix</option>
<option value="pdf417">PDF417</option>
<option value="qrcode">QR Code</option>
</select>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" checked="true" id="addTextCheck">
<label class="form-check-label" for="addTextCheck">
Show text
</label>
</div>
</form>
</div>
</div>
</div>
<br>
<!-- Barcodes container -->
<div id="barcodesContainer"></div>
<!-- Scripts-->
<script>
$(document).ready(function () {
$("#barcodesContainer").on("DOMSubtreeModified", function () {
var containerIsEmpty = $(this).html() == '';
$("#exportBtn").prop("disabled", containerIsEmpty)
});
});
const darkModeToggle = document.querySelector('#darkModeToggle');
const body = document.querySelector('body');
// Check for previously stored preferences in localStorage
const darkModeEnabled = localStorage.getItem('darkModeEnabled');
const lastSymbology = localStorage.getItem('lastSymbology');
const lastRequest = localStorage.getItem('lastRequest');
if (lastRequest && lastRequest.trim() !== '') {
// Do something if lastRequest is not empty
document.getElementById("barcodesEntry").value = lastRequest
}
if (lastSymbology && lastSymbology.trim() !== '') {
// Do something if lastRequest is not empty
document.getElementById("symbologySelector").value = lastSymbology
}
if (darkModeEnabled === 'true') {
body.classList.add('bg-dark');
body.classList.add('text-light');
darkModeToggle.checked = true;
}
darkModeToggle.addEventListener('click', () => {
if (darkModeToggle.checked) {
body.classList.add('bg-dark');
body.classList.add('text-light');
localStorage.setItem('darkModeEnabled', 'true');
} else {
body.classList.remove('bg-dark');
body.classList.remove('text-light');
localStorage.setItem('darkModeEnabled', 'false');
}
});
</script>
</body>
<footer id="myFooter" class="text-center">
<body>Made with lazy ❤️ by Javier Huamanchumo Arauco</body>
</footer>
</html>