-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
144 lines (130 loc) · 5.7 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>qrpwd - Password-Protected QR Code Tool</title>
<meta name="description" content="qrpwd is a tool for encoding and decoding information in password-protected QR codes. Use it to store and share password protected data.">
<meta property="og:title" content="qrpwd - Password-Protected QR Code Tool">
<meta property="og:description" content="qrpwd is a tool for encoding and decoding information in password-protected QR codes. Use it to store and share password protected data.">
<meta property="og:image" content="./qrpwd-logo.png">
<meta property="og:image:width" content="400">
<meta property="og:image:height" content="400">
<link rel="stylesheet" href="s.css">
<link rel="manifest" href="manifest.json">
</head>
<body>
<!-- Add new section for anchor links -->
<div class="anchor-links">
<a href="#decoder">Decoder</a>
<a href="#encoder">Encoder</a>
</div>
<div class="message">
<p>
<a href="https://github.com/franzenzenhofer/qrpwd" target="_blank">qrpwd</a> is a online and command line tool to save password protected data in encrypted QR codes.
So that this information can be easily backed up and retrieved via your normal photo backups / streams in Google Photos, Whatsapp, etc.
</p>
</div>
<!-- Add container for decoder section -->
<div id="decoder" class="container">
<div class="window">
<a href="/"><img src="./qrpwd-logo.png" alt="qrpwd logo" id="logo"></a>
<h1 class="window-title">
qrpwd Online Decoder
</h1>
<p class="tagline">Open Source - MIT License - <a href="https://github.com/franzenzenhofer/qrpwd" target="_blank">See the code.</a></p>
<div class="input-group">
<label for="input-file">Select QR code image:</label>
<input type="file" id="input-file" accept="image/*" style="display: none;">
<label for="input-file" class="file-input" id="choose_file">Choose file</label>
</div>
<div class="input-group">
<label for="password">Password:</label>
<input type="password" id="password" required>
</div>
<div class="input-group">
<button id="decode">Decode</button>
</div>
<div class="results">
<p id="result-filename"></p>
<pre id="result-message"></pre>
</div>
</div>
</div>
<div class="message">
<p>Also check out the <a href="https://github.com/franzenzenhofer/qrpwd" target="_blank">qrpwd command line tool</a> on <a href="https://github.com/franzenzenhofer/qrpwd" target="_blank">Github</a>.</p>
</div>
<!-- Add container for encoder section -->
<div id="encoder" class="container">
<div class="window">
<h1 class="window-title">
qrpwd Online Encoder
</h1>
<p lass="tagline">Open Source - MIT License - <a href="https://github.com/franzenzenhofer/qrpwd" target="_blank">See the code.</a></p>
<div class="input-group">
<label for="input-text">Enter text to encode:</label>
<textarea id="input-text" rows="5"></textarea>
</div>
<div class="input-group">
<label for="filename-encode">Hint (what kind of data?):</label>
<input type="text" id="filename-encode">
</div>
<div class="input-group">
<label for="password-encode">Password:</label>
<input type="password" id="password-encode" required>
<div id="password-error" style="color: red; display: none;">Please enter a password.</div>
</div>
<div class="input-group">
<button id="encode">Encode</button>
</div>
<div class="results">
<p>QR code:</p>
<a id="download-link" style="display: none;" download>Download</a>
<div id="result-qr"></div>
</div>
</div>
</div>
<div class="anchor-links">
<a href="#decoder">Decoder</a>
<a href="#encoder">Encoder</a>
</div>
<button id="install-button" style="display: none;">Install qrpwd as Offline App.</button>
<p class="footer">
qrpwd is a tool for encoding and decoding information in QR codes - password protected.
<br>Learn more at <a href="https://github.com/franzenzenhofer/qrpwd" target="_blank">https://github.com/franzenzenhofer/qrpwd</a>.
</p>
<script src="./index.min.js"></script>
<script src="./crypto-js.js"></script>
<script src="./qrcode.js"></script>
<script type="module" src="./decode-browser.js"></script>
<script type="module" src="./encode-browser.js"></script>
<script>
let deferredPrompt;
window.addEventListener('beforeinstallprompt', (event) => {
// Prevent Chrome 67 and earlier from automatically showing the prompt
event.preventDefault();
// Stash the event so it can be triggered later
deferredPrompt = event;
// Show the install button
const installButton = document.getElementById('install-button');
installButton.style.display = 'block';
installButton.addEventListener('click', () => {
// Show the prompt
deferredPrompt.prompt();
// Wait for the user to respond to the prompt
deferredPrompt.userChoice.then((choiceResult) => {
if (choiceResult.outcome === 'accepted') {
console.log('User accepted the install prompt');
} else {
console.log('User dismissed the install prompt');
}
// Reset the deferredPrompt variable
deferredPrompt = null;
// Hide the install button
installButton.style.display = 'none';
});
});
});
</script>
</body>
</html>