Giter Site home page Giter Site logo

stevinz / qrim Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 1.0 108 KB

Stylized JavaScript QR Code image generator with UTF8 support.

Home Page: https://stevinz.github.io/qrim

License: MIT License

JavaScript 100.00%
canvas es-module es6 html5 javascript qr-code qr-generator qr-maker qrcode stylized

qrim's Introduction

Qrim

Qrim (QR Image Maker), a JavaScript library for generating QR Code images.

Originally forked from qrcode.js. Removed legacy code, refactored to support ES modules, included UTF8 character support, and added stylization options.

Install

  • Option 1: Copy file qrim.module.js, import from file...
import { QRCode } from 'qrim.module.js';
  • Option 2: Install from npm, import from 'qrim'...
npm install qrim
import { QRCode } from 'qrim';
  • Option 3: Import directly from CDN...
import { QRCode } from 'https://unpkg.com/qrim/build/qrim.module.js';

Usage

<div id="qrcode"></div>

<script type='module'>

import { QRCode } from 'qrim';

const el = document.getElementById("qrcode");
const qr = new QRCode(el, "http://www.code.com");

</script>

Options

Parameters object, all properties are optional

const qr = new QRCode(el, {
    text: "http://www.domain.com",          // text to generate
    size: 1024,                             // image dimensions
    colorDark : "#000000",                  // block color
    colorLight : "#ffffff",                 // background color
    border: 1,                              // border size, in # of blocks
    padding: 1,                             // padding size, in # of blocks
    opacity: 1,                             // image opacity
    style: QRCode.Styles.Square,            // Square | Blob | Dots
    correctLevel: QRErrorCorrectLevel.H,    // L | M | Q | H
});

Methods

// make new code from new text
qr.makeCode("http://www.newcode.com");

// ...or make new code from updated parameters
const params = {
    text: "http://www.newcode.com",
    size: 2048,
    opacity: 0.5,
};
qr.makeCode(params);

qrim's People

Contributors

bitdeli-chef avatar davidcl64 avatar davidshimjs avatar dwilkie avatar evanhahn avatar ghigo avatar lukem512 avatar markvantilburg avatar pirosikick avatar sailxjx avatar stevinz avatar taku0 avatar tptee avatar trianman avatar ysangkok avatar

Stargazers

 avatar

Forkers

huaizhic

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.