Skip to content

Instantly share code, notes, and snippets.

@prof3ssorSt3v3
Created July 21, 2018 18:27
Show Gist options
  • Select an option

  • Save prof3ssorSt3v3/3da2d1c3bedff48babd4665a25483394 to your computer and use it in GitHub Desktop.

Select an option

Save prof3ssorSt3v3/3da2d1c3bedff48babd4665a25483394 to your computer and use it in GitHub Desktop.
<!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