GithubHelp home page GithubHelp logo

cyberzilla / easyqrcodejs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ushelp/easyqrcodejs

0.0 1.0 0.0 70 KB

Cross-browser QRCode generator for pure javascript. Supports Title, Subtitle and Logo image settings. 跨浏览器纯 JavaScript 二维码生成库。支持设置二维码标题,子标题和 Logo 图片。

License: MIT License

HTML 21.37% JavaScript 78.63%

easyqrcodejs's Introduction

EasyQRCodeJS

EasyQRCodeJS 是一个基于 QRCodeJS 的跨浏览器的纯 JavaScript QRCode 生成库。并支持二维码图片标题,副标题生成,Logo 图片生成。

EasyQRCodeJS is a Cross-Browser pure JavaScript QRCode generation library based on QRCodeJS. And support two-dimensional code picture title, subtitle generation, Logo image generation.

Feature/特点

  • 中文

    • 跨浏览器,支持基于 HTML5 Canvas 和 table 的二维码生成。

    • 支持为二维码生成设置标题,副标题

    • 支持为二维码生成添加 Logo 图片

    • 支持背景透明的 PNG 图片

    • 不依赖任何第三方

  • English

    • Cross-Browser that supports HTML5 Canvas and table.

    • Support for setting the title and subtitle

    • Supports adding Logo images

    • Support for transparent PNG images

    • Has no dependencies.

Demo/示例

Demo

Installation/安装

  • Download install/下载安装

     <script src="dist/easy.qrcode.min.js" type="text/javascript" charset="utf-8"></script>
     
  • Npm install/Npm 安装

     npm install easyqrcodejs

Basic Usages

<div id="qrcode"></div>
<script type="text/javascript">
	new QRCode(document.getElementById("qrcode"), "https://github.com/ushelp/EasyQRCodeJS");
</script>

or with some options

<div id="qrcode"></div>
<script type="text/javascript">
	var qrcode = new QRCode(document.getElementById("qrcode"), {
		text: "https://github.com/ushelp/EasyQRCodeJS",
		width: 256,
		height: 256,
		colorDark : "#000000",
		colorLight : "#ffffff",
		correctLevel : QRCode.CorrectLevel.H,
		
		// ==== Title
		title: 'QR Title', // content 
		titleFont: "bold 18px Arial", //font. default is "bold 16px Arial"
		titleColor: "#004284", // color. default is "#000"
		titleBgColor: "#fff", // background color. default is "#fff"
		titleHeight: 70, // height, including subTitle. default is 50
		titleTop: 25, // draws y coordinates. default is 30
		
		// ==== SubTitle
		subTitle: 'QR subTitle', // content
		subTitleFont: "14px Arial", // font. default is "14px Arial"
		subTitleColor: "#004284", // color. default is "gray"
		subTitleTop: 40, // draws y coordinates. default is 50
		
		// ==== Logo
		logo:"../demo/logo.png", // Relative address, relative to `easy.qrcode.min.js`
	//	logo:"http://127.0.0.1:8020/easy-qrcodejs/demo/logo.png", 
	//	logoWidth:80, // widht. default is automatic width
	//	logoHeight:80 // height. default is automatic height
	//	logoBgColor:'#fffff', // Logo backgroud color, Invalid when `logBgTransparent` is true; default is '#ffffff'
	//	logoBgTransparent:false, // Whether use transparent image, default is false
					
	});
</script>

and you can use some methods

qrcode.clear(); // clear the code.
qrcode.makeCode("https://github.com/ushelp/EasyQRCodeJS"); // make another code.

Browser Compatibility

IE6~10, Chrome, Firefox, Safari, Opera, Mobile Safari, Android, Windows Mobile, ETC.

License

MIT License

End

Email:[email protected]

http://www.easyproject.cn

支付宝钱包扫一扫捐助:

我们相信,每个人的点滴贡献,都将是推动产生更多、更好免费开源产品的一大步。

感谢慷慨捐助,以支持服务器运行和鼓励更多社区成员。

支付宝钱包扫一扫捐助

We believe that the contribution of each bit by bit, will be driven to produce more and better free and open source products a big step.

Thank you donation to support the server running and encourage more community members.

PayPal

easyqrcodejs's People

Contributors

ushelp avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.