annotate index.html @ 0:6b5cab0b3f91

Initial
author nanaya <me@myconan.net>
date Sat, 15 Oct 2016 16:38:11 +0900
parents
children 30cd1768611b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
1 <!doctype html>
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
2 <head>
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
3 <meta charset="utf-8">
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
4 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
5 <title>QR Code Generator</title>
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
6
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
7 <style type="text/css">
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
8 * {
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
9 position: relative;
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
10 box-sizing: border-box;
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
11 }
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
12
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
13 html {
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
14 height: 100%;
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
15 margin: 0;
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
16 padding: 0;
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
17 font-family: sans-serif;
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
18 font-size: 12px;
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
19 }
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
20
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
21 body {
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
22 margin: 0;
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
23 padding: 10px;
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
24 height: 100%;
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
25 }
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
26
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
27 .inputbox {
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
28 width: 100%;
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
29 margin-bottom: 10px;
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
30 resize: vertical;
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
31 font-family: monospace;
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
32 }
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
33
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
34 .page {
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
35 width: 100%;
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
36 height: 100%;
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
37 max-width: 600px;
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
38 margin: 0 auto;
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
39 display: flex;
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
40 flex-direction: column;
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
41 padding: 10px;
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
42 }
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
43
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
44 .page__main {
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
45 flex: 1;
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
46 }
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
47
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
48 .title {
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
49 font-size: 16px;
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
50 }
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
51 </style>
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
52 </head>
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
53 <body>
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
54 <div class="page">
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
55 <div class="page__main">
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
56 <h1>QR Code Generator</h1>
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
57
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
58 <p>
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
59 Type something and get its QR code immediately.
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
60 </p>
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
61
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
62 <textarea class="inputbox js-qr-input" rows="4" autofocus></textarea>
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
63
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
64 <div class="js-qr-output"></div>
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
65 </div>
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
66
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
67 <div>
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
68 <hr>
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
69
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
70 <a href="https://bitbucket.org/nanaya1/qr-html">Source</a>
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
71 </div>
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
72 </div>
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
73
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
74 <script src="jquery.min.js"></script>
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
75 <script src="qrcode.min.js"></script>
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
76
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
77 <script>
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
78 var outputDom = document.getElementsByClassName("js-qr-output")[0];
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
79 var qr = new QRCode(outputDom);
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
80
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
81 $(".js-qr-input").on("input", function(e) {
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
82 var text = e.target.value;
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
83
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
84 if (text !== "") {
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
85 qr.makeCode(text);
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
86 }
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
87 });
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
88 </script>
6b5cab0b3f91 Initial
nanaya <me@myconan.net>
parents:
diff changeset
89 </body>