Skip to content
Devix Open Source

Make a code

Type anything, put your logo in the middle, and watch it tell you when the logo is too big to survive.

Live preview
<div class="demo demo--wide">
  <div class="demo-split">
    <div class="demo-controls">
      <label class="demo-label" for="value">What it carries</label>
      <input class="demo-input" id="value" value="https://devix.pk/resources/qr-code">

      <div class="demo-row">
        <label class="demo-label" for="level">Correction</label>
        <div class="demo-seg" id="level" role="group" aria-label="Error correction">
          <button type="button" data-level="L">L</button>
          <button type="button" data-level="M" aria-pressed="true">M</button>
          <button type="button" data-level="Q">Q</button>
          <button type="button" data-level="H">H</button>
        </div>
      </div>

      <div class="demo-row">
        <label class="demo-label" for="logo">Logo</label>
        <input id="logo" type="range" min="0" max="0.3" step="0.01" value="0">
        <output id="logoOut">off</output>
      </div>

      <div class="demo-row">
        <div class="demo-seg" id="shape" role="group" aria-label="Module shape">
          <button type="button" data-shape="square" aria-pressed="true">Square</button>
          <button type="button" data-shape="rounded">Rounded</button>
          <button type="button" data-shape="dot">Dots</button>
        </div>
        <button class="demo-btn" id="png">Download PNG</button>
      </div>

      <dl class="demo-kv" id="facts"></dl>
    </div>

    <div id="code"></div>
  </div>
</div>