Add embedding via 404 page

This commit is contained in:
BerriJ committed 2026-10-07 12:28:31 +02:00
1 parent 70b40307de
commit 4bf618efd0
5 files changed
+201 -92

No files matched your search

+14
View File
@@ -4,6 +4,20 @@ A simplified, SVG-only QR code generator based on QRCode.js. This lightweight li
Try it out at [OnlyQR Demo](https://onlyqr.0n8.de).
## Embedding via URL
Everything after the domain becomes the QR code content, and the page shows only the QR code, scaled to fit:
```html
<iframe src="https://onlyqr.0n8.de/hello-world" width="200" height="200" style="border:0"></iframe>
<iframe src="https://onlyqr.0n8.de/https%3A%2F%2Fexample.com?color=ff0000" width="200" height="200" style="border:0"></iframe>
```
- `?color=` takes a hex value without `#` (e.g. `ff0000`) or a CSS colour name. The default is `004c93`.
- Use `encodeURIComponent(text)` for the path, so that `?`, `#`, `%` and `/` in your text come through unchanged.
- Any other query parameters are treated as part of the text.
- This is handled by `404.html` on the static host, so it only works in iframes (not `<img src>`), and the HTTP status is 404.
## Changes from Original QRCode.js
- Removed Canvas and Table rendering methods