Maze QR

A real QR code, drawn as a living maze.

People wander the corridors, a monster hunts them, a forest grows round it by day and a city by night, and it is built to stay readable while it moves. Type anything and scan.

Docs

One script, one function. No server, no dependencies, no build step.

  1. 1. Add one scriptmazeqr.min.js from jsDelivr (below), npm (npm i @phoseinq/mazeqr) or the latest release.
  2. 2. Stay on 1.x@1 always gets the latest 1.x; a breaking 2.0 never arrives on its own.
  3. 3. DrawrenderArtisticQr(text, size) returns a live canvas.

On a web page

<div id="qr"></div>
<script src="https://cdn.jsdelivr.net/npm/@phoseinq/mazeqr@1/dist/mazeqr.min.js"></script>
<script>
  var canvas = renderArtisticQr("https://example.com/", 1000);
  canvas.style.width = "100%";
  document.getElementById("qr").appendChild(canvas);
</script>

With npm (Vite, webpack…)

TypeScript types are included.

npm install @phoseinq/mazeqr
import { renderArtisticQr, mazeCheer } from "@phoseinq/mazeqr";

const canvas = renderArtisticQr("https://example.com/", 1000);
document.getElementById("qr").appendChild(canvas);

Day and night

Leave night out and the maze follows <html data-theme="dark">, cross-fading when it changes:

document.documentElement.setAttribute("data-theme", "dark");   // the maze turns to night by itself

A still image (PNG)

var still = renderArtisticQr("https://example.com/", 1200, {still: true, night: false});
var png = still.toDataURL("image/png");

The "copied" reaction

navigator.clipboard.writeText(url).then(function () { mazeCheer(url); });
  1. ۱. یک اسکریپت اضافه کنیدmazeqr.min.js را از jsDelivr (پایین)، npm (npm i @phoseinq/mazeqr) یا آخرین Release بردارید.
  2. ۲. روی 1.x بمانید@1 همیشه آخرین نسخه‌ی 1.x را می‌گیرد؛ نسخه‌ی 2 که ممکن است ناسازگار باشد هیچ‌وقت خودکار نمی‌آید.
  3. ۳. بکشیدrenderArtisticQr(text, size) یک canvas زنده برمی‌گرداند.

روی یک صفحه‌ی وب

<div id="qr"></div>
<script src="https://cdn.jsdelivr.net/npm/@phoseinq/mazeqr@1/dist/mazeqr.min.js"></script>
<script>
  var canvas = renderArtisticQr("https://example.com/", 1000);
  canvas.style.width = "100%";
  document.getElementById("qr").appendChild(canvas);
</script>

با npm (مثل Vite یا webpack)

تایپ‌های TypeScript هم همراهش هست.

npm install @phoseinq/mazeqr
import { renderArtisticQr, mazeCheer } from "@phoseinq/mazeqr";

const canvas = renderArtisticQr("https://example.com/", 1000);
document.getElementById("qr").appendChild(canvas);

روز و شب

اگر night را ندهید، هزارتو از <html data-theme="dark"> پیروی می‌کند و وقتی عوض شود، آرام به شب می‌رود:

document.documentElement.setAttribute("data-theme", "dark");   // the maze turns to night by itself

یک تصویر ثابت (PNG)

var still = renderArtisticQr("https://example.com/", 1200, {still: true, night: false});
var png = still.toDataURL("image/png");

واکنش «کپی شد»

navigator.clipboard.writeText(url).then(function () { mazeCheer(url); });