Skip to content

Commit ba6ef60

Browse files
committed
Add some status border arround QR-Code. Update README incl. UI-image. Added version to UI footer.
1 parent d595c97 commit ba6ef60

File tree

5 files changed

+39
-25
lines changed

5 files changed

+39
-25
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# BoardingPass QR-Code Generator
22

3-
This is a frontend for the Barcode Generator from [Shooshx](https://shooshx.github.io/BoardingBarcode/). Its has the following additional features:
3+
<img src="https://img.shields.io/github/deployments/bitnulleins/BoardingPass-QR-Code-Generator/github-pages?label=deployment"> <img src="https://img.shields.io/github/v/tag/bitnulleins/BoardingPass-QR-Code-Generator?label=version"> <img src="https://img.shields.io/github/stars/bitnulleins/BoardingPass-QR-Code-Generator">
4+
5+
This is a frontend for the Barcode Generator from [Shooshx](https://github.com/shooshx/BoardingBarcode). Its has the following additional features:
46

57
* Responsive lightweight UI
68
* A way to save permalink for generated QR Code
9+
* Upload existing QR Code (cropped)
710
* Settings modal box
811

912
You can open the tool [here](https://bitnulleins.github.io/BoardingPass-QR-Code-Generator/).
@@ -28,7 +31,8 @@ Surname | Booking-Ref ...
2831

2932
This information is then encoded in a QR code so that it can be read by machine by the inspection bodies. There are two standards "aztec" (2D QR code) or PDF417 (1D code known by many airlines). The raw text can now be manipulated to encode other information.
3033

31-
That's why it's so important to never show your board card on social media. There is a lot of personal information on it.
34+
> [!IMPORTANT]
35+
> That's why it's so important to never show your board card on social media. There is a lot of personal information on it.
3236
3337
## Other useful info
3438

css/style.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ h1 {
1919
margin:0;
2020
}
2121

22-
2322
h2 {
2423
margin-top:0px;
2524
text-transform:uppercase;
@@ -170,8 +169,8 @@ input, select {
170169
width:100%;
171170
text-align: center;
172171
font-size:0.8em;
172+
z-index:1000;
173173
opacity: 0.3;
174-
text-transform: uppercase;
175174
}
176175

177176
@media screen and (max-width: 500px) {

index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,19 @@ <h2>Settings</h2>
5757
</div>
5858
<div class="column">
5959
<label for="to">To</label>
60-
<input id="toEd" for="to" type="text" value="" placeholder="ABC" oninput="formatField('to', true)">
60+
<input id="toEd" for="to" type="text" value="" placeholder="FRA" oninput="formatField('to', true)">
6161
</div>
6262
<div class="column">
6363
<label for="flightOps">Flight Operator</label>
64-
<input id="fOpEd" name="flightOps" type="text" placeholder="XX" value="" oninput="formatField('fOp',true)">
64+
<input id="fOpEd" name="flightOps" type="text" placeholder="LH" value="" oninput="formatField('fOp',true)">
6565
</div>
6666
<div class="column">
6767
<label for="number">Flightnumber</label>
68-
<input id="fNumEd" name="number" type="text" value="" placeholder="0000" oninput="formatField('fNum', true)">
68+
<input id="fNumEd" name="number" type="text" value="" placeholder="1234" oninput="formatField('fNum', true)">
6969
</div>
7070
<div class="column">
7171
<label for="seat">Seat</label>
72-
<input id="seatNumEd" name="seat" type="text" value="" placeholder="10F" oninput="formatSeat(true)">
72+
<input id="seatNumEd" name="seat" type="text" value="" placeholder="35A" oninput="formatSeat(true)">
7373
</div>
7474
<div class="column">
7575
<label for="class">Class</label>
@@ -105,7 +105,7 @@ <h2>QR Code</h2>
105105
</div>
106106
</div>
107107
</div>
108-
<div id="copyright">Frontend by <a href="https://github.com/bitnulleins/BoardingPass-QR-Code-Generator">bitnulleins</a> | Backend by <a href="https://shooshx.github.io/BoardingBarcode/">Shooshx</a></div>
108+
<div id="copyright">USE AT OWN RISK</div>
109109
<input id="dayOfYearEd" class="hide" value="0">
110110
<select id="eccSelect" class="hide" onchange="update()">
111111
<option value="0">-1</option>

js/frontend.js

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ var fields = {}
99
var run, getDayOfYear
1010
var ctx = null
1111

12+
fetch('https://api.github.com/repos/bitnulleins/BoardingPass-QR-Code-Generator/releases/latest')
13+
.then(response => response.json())
14+
.then(data => {
15+
document.getElementById('copyright').innerHTML += " | " + data.tag_name
16+
})
17+
1218
var fldDef = {
1319
'bookRef': { pad: 7, desc:"Booking Ref"},
1420
'from': { pad: 3, desc:"From"},
@@ -44,24 +50,11 @@ function start()
4450

4551
// Update
4652
format()
47-
update_bookmark()
53+
update()
4854
}
4955

50-
function update_bookmark() {
51-
let queries = []
52-
queries['name'] = fields.name
53-
queries['fOp'] = fields.fOp
54-
queries['fNum'] = fields.fNum
55-
queries['from'] = fields.from
56-
queries['to'] = fields.to
57-
queries['date'] = fields.date
58-
queries['seat'] = fields.seat
59-
queries['bookRef'] = fields.bookRef
60-
queries['seqNum'] = fields.seqNum
61-
queries['cls'] = fields.cls
62-
56+
function update_bookmark(queries) {
6357
let query = Object.entries(queries).map(([k,v]) => `${k}=${v}`)
64-
6558
document.getElementById('bookmark').href='?' + query.join('&')
6659
}
6760

@@ -78,7 +71,25 @@ function err(msg) {
7871

7972
function update(fromRaw)
8073
{
81-
update_bookmark()
74+
let queries = []
75+
queries['name'] = fields.name
76+
queries['fOp'] = fields.fOp
77+
queries['fNum'] = fields.fNum
78+
queries['from'] = fields.from
79+
queries['to'] = fields.to
80+
queries['date'] = fields.date
81+
queries['seat'] = fields.seat
82+
queries['bookRef'] = fields.bookRef
83+
queries['seqNum'] = fields.seqNum
84+
queries['cls'] = fields.cls
85+
86+
if (Object.values(queries).includes('')) {
87+
document.querySelector('.qrcode').style.border = '4px solid red'
88+
} else {
89+
document.querySelector('.qrcode').style.border = '4px solid green'
90+
}
91+
92+
update_bookmark(queries)
8293

8394
if (!fromRaw)
8495
textEdit.innerHTML = textIn

ui.png

-12.4 KB
Loading

0 commit comments

Comments
 (0)