Created
July 21, 2018 18:27
-
-
Save prof3ssorSt3v3/3da2d1c3bedff48babd4665a25483394 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>QR Codes</title> | |
| <meta name="viewport" content="width=device-width"> | |
| <link rel="stylesheet" href="main.css"> | |
| <style> | |
| img{ | |
| width: 100%; | |
| } | |
| div img{ | |
| width: 50%; | |
| } | |
| </style> | |
| <script src="qrcode.js"></script> | |
| </head> | |
| <body> | |
| <header> | |
| <h1>QR Codes</h1> | |
| </header> | |
| <main> | |
| <!-- using | |
| https://davidshimjs.github.io/qrcodejs/ | |
| --> | |
| <div id="output"></div> | |
| <img src="qrcode-encoding.png" /> | |
| </main> | |
| <script> | |
| let qrcode = new QRCode("output", { | |
| text: "http://fillmurray.com/", | |
| width: 177, | |
| height: 177, | |
| colorDark : "#990000", | |
| colorLight : "#ffffff", | |
| correctLevel : QRCode.CorrectLevel.H | |
| }); | |
| document.body.addEventListener('click', ()=>{ | |
| qrcode.clear(); | |
| qrcode.makeCode("http://google.ca/"); | |
| }) | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment