forked from pnshiralkar/QR-Code-Based-Voting-Platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qrs.html
54 lines (42 loc) · 1.37 KB
/
qrs.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
<html>
<head>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<style>
.imgdiv {
width: 22vw;
display: inline-block;
padding: 1vw 0;
text-align: center
}
.img {
width: 100%
}
h1{
margin: 2px;
}
</style>
<script>
// Keep photos in folder named "qrCodes"
// Config
var num_p = 93; // Number of photos
var num_s = 0; // Number of sketches/paintings
var num_zeroes = 4; // Length of number (P0011 = 4)
function pad(num, size) {
var s = num + "";
while (s.length < size) s = "0" + s;
return s;
}
$(document).ready(function () {
for (var i = 1; i <= num_p; i++) {
$("body").append('<div class="imgdiv"><img src="qrCodes/P' + pad(i, num_zeroes) + '.png" alt="" class="img"><h1>P' + pad(i, num_zeroes) + '</h1></div>')
}
for (var i = 1; i <= num_s; i++) {
$("body").append('<div class="imgdiv"><img src="qrCodes/S' + pad(i, num_zeroes) + '.png" alt="" class="img"><h1>S' + pad(i, num_zeroes) + '</h1></div>')
}
});
</script>
</head>
<body>
</body>
</html>