-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.html
More file actions
65 lines (64 loc) · 1.77 KB
/
Copy pathindex.html
File metadata and controls
65 lines (64 loc) · 1.77 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="shortcut icon" href="/favicon.ico">
<link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png">
<title>Referral QR code</title>
<style>
html,body
{
height: 100%;
font-family: sans-serif;
color: #444;
line-height: 2;
}
body
{
display: table;
margin: 0 auto;
}
.container
{
height: 100%;
display: table-cell;
vertical-align: middle;
text-align: center;
}
#qr_code canvas {
width: 80%;
height: 80%;
padding: 25px;
}
</style>
</head>
<body>
<div class="container">
<div id="qr_code"></div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.qrcode/1.0/jquery.qrcode.min.js" integrity="sha256-9MzwK2kJKBmsJFdccXoIDDtsbWFh8bjYK/C7UjB1Ay0=" crossorigin="anonymous"></script>
<script type="text/javascript">
$(document).ready(function() {
var params = parseParams(window.location.search);
if (!params.code) {
$('#qr_code').html('code not found');
}
else {
$('#qr_code').qrcode({width: 512, height: 512, text: decodeURIComponent(params.code)});
}
// for parsing windows.location.search or windows.location.hash
function parseParams(params) {
var hash = params.substring(1);
var param_list = {}
$.each(hash.split('&') , function( key, value ) {
var temp = value.split('=');
param_list[temp[0]] = temp[1];
});
return param_list;
}
});
</script>
</body>
</html>