Skip to content

Instantly share code, notes, and snippets.

@aarontgrogg
aarontgrogg / QR Code Creator
Last active August 29, 2015 14:09
Create a QR Code for the current page, so it can be easily scanned by other devices.
javascript:(function(){var%20e=document.createElement("div");e.setAttribute("id","qrcode");e.setAttribute("style","box-sizing:content-box;position:fixed;top:0;left:0;z-index:99993;width:100%;height:100%;padding-top:50px;text-align:center;background-color:rgba(0,0,0,.5);box-sizing:border-box;");e.innerHTML='<img%20style="box-sizing:content-box;box-shadow:0%200%2020px%20#000;"%20src="//api.qrserver.com/v1/create-qr-code/?data='+encodeURIComponent(window.location)+'&size=500x500"%20/>'+"<div%20style=\"box-sizing:content-box;position:absolute;top:10px;right:10px;color:#fff;font-size:20px;width:20px;height:20px;line-height:20px;text-align:center;cursor:pointer;font-weight:bold;background-color:#333;padding:3px;-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);transform:rotate(-45deg);border-radius:20px;border:4px%20solid%20#fff;box-shadow:0%200%2020px%20#000;\"%20onclick=\"document.getElementById('qrcode').parentNode.removeChild(document.getElementById('qrcode'));\">+";document.body.appendChild(e)})()