-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
410 lines (378 loc) · 19.1 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ConnectiFy</title>
<meta name="application-name" content="ConnectiFy">
<meta name="description" content="Wi-Fi connection cards with QR code (LinkCard) generator">
<meta name="author" content="Bruno Kraychete da Costa">
<meta name="keywords" content="wifi, wi-fi, qrcode, nfc, connection, card-generator, link-card, connection-card">
<link rel="stylesheet" href="./css/bootstrap-5.3.2.min.css">
<link rel="stylesheet" href="./css/bootstrap-icons-1.11.1.min.css">
<link rel="stylesheet" href="./css/connectify.css">
<link rel="stylesheet" href="./css/forkongithub.css">
<link rel="stylesheet" href="./css/password-meter.css">
<link rel="stylesheet" href="./css/advanced-bootstrap-range.css">
<link rel="shortcut icon" href="./images/connectify-logo.svg" type="image/svg+xml">
<!-- <link rel="manifest" href="manifest.json"> -->
</head>
<body>
<nav class="navbar navbar-expand-lg bg-dark d-print-none" data-bs-theme="dark">
<div class="container-fluid">
<a class="navbar-brand" href="#">
<img alt="connectify logo" widht="60" height="40" src="./images/connectify-logo-xxs.png">
<!-- <object class="align-middle" width="60" height="40" data="./images/connectify-logo.svg"></object> -->
ConnectiFy
</a>
<a href="https://hits.seeyoufarm.com">
<img src="https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fbrunokc.github.io%2Fconnectify%2F&count_bg=%2379C83D&title_bg=%23555555&icon=eclipsemosquitto.svg&icon_color=%23E7E7E7&title=views&edge_flat=false"
alt="page counter" class="pb-1"/>
</a>
<div id="navbar" class="collapse navbar-collapse ms-3">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link" href="#about">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#contact">Contact</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/brunokc/connectify/">@GitHub</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="fork-github-ribbon text-end d-print-none">
<span id="forkongithub">
<a href="https://github.com/brunokc/connectify/">Fork me on GitHub</a>
</span>
</div>
<div class="container">
<section id="generator">
<h1 id="title" class="my-4 d-print-none">ConnectiFy</h1>
<form id="form" class="d-print-none">
<div class="container-fluid">
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label for="ssid" class="form-label">SSID</label>
<div class="input-group mb-3">
<span class="input-group-text d-none d-sm-block"><i class="bi bi-reception-4"></i></span>
<input type="text" id="ssid" name="ssid" class="form-control rounded-start-sm"
placeholder="SSID" required>
<div class="input-group-text" data-toggle="tooltip" title="Is your network hidden?">
<input class="form-check-input m-auto me-1" type="checkbox" id="hidden">
<label class="form-label m-auto" for="hidden">Hidden</label>
</div>
</div>
</div>
<div class="form-group mb-3">
<label for="encryption" class="form-label">Encryption</label>
<div class="input-group">
<select name="encryption" id="encryption" class="form-select">
<option value="WPA">WPA/WPA2/WPA3</option>
<option value="WEP">WEP (not recommended)</option>
<option value="nopass">None (not recommended)</option>
</select>
</div>
</div>
<div class="form-group mb-3" id="password-p">
<label for="password" class="form-label">Password</label>
<div class="input-group">
<span class="input-group-text d-none d-sm-block"><i class="bi bi-lock-fill"></i></span>
<input type="password" id="password" class="form-control font-monospace rounded-start-sm"
placeholder="Password" autocomplete="off" aria-describedby="passwordHelp" required>
<div class="input-group-text" data-toggle="tooltip" title="Autogenerate Wi-Fi password">
<input class="form-check-input me-1" type="checkbox" id="autogenpass" checked>
<label class="form-label m-auto" for="autogenpass">Auto</label>
</div>
<button class="btn btn-outline-secondary dropdown-toggle dropdown-toggle-split"
type="button" data-bs-toggle="dropdown" data-bs-auto-close="outside"
aria-expanded="false">
<span class="visually-hidden">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<div class="dropdown-item" data-toggle="tooltip" title="Use lowercase characters">
<input class="form-check-input me-1 pass-auto-gen-control" type="checkbox"
id="passUseLowercase" checked>
<label class="form-label" for="passUseLowercase">Use lowercase</label>
</div>
</li>
<li>
<div class="dropdown-item" data-toggle="tooltip" title="Use uppercase characters">
<input class="form-check-input me-1 pass-auto-gen-control" type="checkbox"
id="passUseUppercase" checked>
<label class="form-label" for="passUseUppercase">Use uppercase</label>
</div>
</li>
<li>
<div class="dropdown-item" data-toggle="tooltip" title="Use digits">
<input class="form-check-input me-1 pass-auto-gen-control" type="checkbox"
id="passUseDigits" checked>
<label class="form-label" for="passUseDigits">Use digits</label>
</div>
</li>
<li>
<div class="dropdown-item" data-toggle="tooltip" title="Use symbols">
<input class="form-check-input me-1 pass-auto-gen-control" type="checkbox"
id="passUseSymbols" checked>
<label class="form-label" for="passUseSymbols">Use symbols</label>
</div>
</li>
<li>
<div class="dropdown-item" data-toggle="tooltip" title="Use brackets">
<input class="form-check-input me-1 pass-auto-gen-control" type="checkbox"
id="passUseBrackets" checked>
<label class="form-label" for="passUseBrackets">Use brackets</label>
</div>
</li>
</ul>
</div>
<div class="form-group">
<input id="passwordLength" type="range" title="Password length"
min="12" max="22" step="1" value="16"
class="form-range range-with-labels range-with-notches pass-auto-gen-control">
<!-- <div class="range-notches text-body-tertiary"></div> -->
<div class="range-labels text-body-tertiary"></div>
</div>
<div>
<div class="password-meter">
<div class="meter-section rounded me-2" data-toogle="tooltip" title="Weak"></div>
<div class="meter-section rounded me-2" data-toogle="tooltip" title="Medium"></div>
<div class="meter-section rounded me-2" data-toogle="tooltip" title="Good"></div>
<div class="meter-section rounded" data-toogle="tooltip" title="Very good"></div>
</div>
<div id="passwordHelp" class="form-text text-muted">
Use 12 or more characters with a mix of letters, numbers & symbols.
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-3 text-center" id="template-p">
<label class="form-label">LinkCard Template</label>
<div class="input-group">
<!-- Using dark theme to get dark previous/next arrows -->
<div id="templateCarousel" class="carousel slide p-2 col-centered" data-bs-theme="dark">
<div class="carousel-inner">
<div class="carousel-item active">
<object type="image/svg+xml" data="./templates/card1.svg"></object>
</div>
<div class="carousel-item">
<object type="image/svg+xml" data="./templates/card2-black.svg"></object>
</div>
<div class="carousel-item">
<object type="image/svg+xml" data="./templates/card2-white.svg"></object>
</div>
<div class="carousel-item">
<object type="image/svg+xml" data="./templates/card3.svg"></object>
</div>
<div class="carousel-item">
<object type="image/svg+xml" data="./templates/card4.svg"></object>
</div>
<div class="carousel-item">
<object type="image/svg+xml" data="./templates/card5.svg"></object>
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#templateCarousel"
data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#templateCarousel"
data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
</div>
</div>
</div>
<div class="form-group text-center">
<button id="generate" type="submit" class="btn btn-primary">Generate LinkCard</button>
</div>
</div>
</div>
</form>
<div id="linkcardModal" class="modal fade" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Your LinkCard</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="linkcard m-4" id="linkcard"></div>
<p id="instructions-text" class="mt-3 text-center d-print-none">
Test you LinkCard by pointing your mobile camera here.
</p>
</div>
<div class="modal-footer d-print-none">
<a href="#" id="download" class="btn btn-primary" target="_blank" type="image/svg+xml"
data-toggle="tooltip" title="Download your LinkCard as an SVG image">Download</a>
<a href="javascript:window.print()" class="btn btn-primary" data-toggle="tooltip"
title="Print the QR code">Print</a>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</section>
<section id="about" class="d-print-none">
<h1 class="anchor mt-4">About</h1>
<p>
ConnectiFy provides a practical solution for simplifying Wi-Fi access for your friends and guests,
or for your customers. Instead of sharing a simple, easily guessable password, you can create a
<b>LinkCard</b>, a customized card containing your Wi-Fi information. Just place it in a common
area and guide your guests to it. They can effortlessly join your network by scanning the QR code
on the card. If you have a pre-programmed NFC card (not included), they can also tap it for a
hassle-free connection (note: device support for connecting to a Wi-Fi network via NFC may vary).
</p>
<p>
LinkCards are credit-card-sized and are fully customizable. A selection of templates is
available, or you can create your own unique designs. ConnectiFy currently only supports
templates in SVG (Scalable Vector Graphics) format.
</p>
<p>
<b>This app does not save any of the data you provide, nor does it transmit it anywhere</b>.
However, if you still don't want to trust your browser, this app, or the authors, no worries.
Simply <a href="https://github.com/brunokc/connectify">clone the project</a> and run the
Python script <code>generate-card.py</code> (inspecting the code first, if your prefer) to
generate your LinkCards locally on your machine.
</p>
<p>
Simplify Wi-Fi sharing with ConnectiFy.
</p>
<h2 class="mt-4">Supported Scanners</h2>
<p>Both Android and iOS support reading QR codes:</p>
<h3>Android</h3>
<p>
The Android Camera App has support for WiFi QR codes since Android 10.
</p>
<h3>iOS</h3>
<p>
The iOS Camera App has <a href="https://www.macrumors.com/2017/06/06/iphone-can-scan-qr-codes-ios-11/">
support for WiFi QR codes since iOS 11</a>.
</p>
<h2 class="mt-4 mb-4">LinkCard Examples</h2>
<div id="exampleContainer">
<object class="me-5 mb-3" data="./images/card.svg" type="image/svg+xml"></object>
<object class="me-5 mb-3" data="./images/card2-black.svg" type="image/svg+xml"></object>
<object class="me-5 mb-3" data="./images/card3.svg" type="image/svg+xml"></object>
</div>
</section>
<section id="contact" class="d-print-none">
<h1 class="anchor mt-3">Contact</h1>
<p>
ConnectiFy was written by <a href="https://github.com/brunokc/">Bruno K. da Costa</a>,
using <a href="https://github.com/kazuhikoarase/qrcode-generator/">qrcode-generator</a>,
<a href="http://jquery.com/">jQuery</a> and <a href="https://getbootstrap.com/">Bootstrap 5</a>.
</p>
<p>If you have any comments, suggestions, bugs or complaints: please submit an issue through
the <a href="https://github.com/brunokc/connectify/issues">project website</a>.
</p>
</section>
</div>
<footer class="footer d-print-none">
<div class="container">
<object type="image/svg+xml" data="./images/connectify-logo.svg" width="60" height="40"
class="align-middle" alt="connectify logo"></object>
by <a href="https://github.com/brunokc">@brunokc</a>
<br>
<span class="qrcode-copyright">
QR Code is a registered trademark of DENSO WAVE INCORPORATED in the United States and other countries.
</span>
</div>
</footer>
<script src="./js/bootstrap-5.3.2.bundle.min.js"></script>
<script src="./js/jquery-3.5.1.slim.min.js"></script>
<script src="./js/qrcode.js" defer></script>
<script src="./js/connectify.js"></script>
<script src="./js/password-generator.js" defer></script>
<script src="./js/password-meter.js" defer></script>
<script src="./js/advanced-bootstrap-range.js" defer></script>
<script type="text/javascript">
let oldpassvalue = "";
$(document).ready(() => {
$('#form').on("submit", function() {
generateCardAsync();
const linkCardModal = new bootstrap.Modal('#linkcardModal', {});
linkCardModal.show();
return false;
});
$('#encryption').on("change", function() {
if ($(this).val() != 'nopass') {
$('#password-p').show();
$('#password').attr('required');
}
else {
$('#password-p').hide();
$('#password').removeAttr('required');
}
});
function triggerInput(elementId) {
// Get a reference to your input element
const control = document.getElementById(elementId);
// Create a new input event
const inputEvent = new Event('input', {
bubbles: true, // Ensure the event bubbles up the DOM
cancelable: true, // Allow the event to be canceled
});
// Dispatch the input event on the input element
control.dispatchEvent(inputEvent);
}
$("#autogenpass").on("change", function() {
const autogenDisabled = !$(this).is(":checked");
// Enable/disable subordinate controls
$(".pass-auto-gen-control")
.prop({ disabled: autogenDisabled })
.parent().toggleClass("disabled", autogenDisabled);
const pwd = $("#password");
if (autogenDisabled) {
// Restore any previous typed password
pwd.attr("type", "password");
pwd.val(oldpassvalue);
oldpassvalue = "";
} else {
const length = parseInt($("#passwordLength").val());
const password = generatePassword(length, {
useLowercase: $("#passUseLowercase").is(":checked"),
useUppercase: $("#passUseUppercase").is(":checked"),
useDigits: $("#passUseDigits").is(":checked"),
useSymbols: $("#passUseSymbols").is(":checked"),
useBrackets: $("#passUseBrackets").is(":checked"),
});
// Save any previous typed password
oldpassvalue = pwd.val();
pwd.val(password);
pwd.attr("type", "text");
}
// Trigger input on the password field so the password strength can be
// re-evaluated ("input" events are not automatically triggered when
// the value is changed programmatically).
// For some reason, $("#password").trigger("input") is not working, so
// synthesize an event to force the event listeners to run.
//pwd.trigger("input");
triggerInput("password");
});
$(".pass-auto-gen-control").on("change", function() {
// Trigger 'change' event on the autogenerate checkbox so a new password
// is generated and its strength re-evaluated.
$("#autogenpass").trigger("change");
});
$("#autogenpass").trigger("change");
// $("#password").trigger("input");
// $('#form').tooltip({
// selector: "[data-toggle=tooltip]"
// });
// Enabling tooltips
// const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]');
// const tooltipList = [...tooltipTriggerList].map(
// tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl));
});
</script>
</body>
</html>