mirror of
https://github.com/pischule/memevizor.git
synced 2025-12-19 06:56:42 +00:00
Add QR code positioning support via qrOffset URL parameter
Add support for positioning the QR code element by introducing a new qrOffset URL parameter. The parameter controls the bottom and right positioning of the QR code with a default value of 20px if not specified. This allows for better control over the QR code placement in the layout.
This commit is contained in:
@@ -71,10 +71,13 @@
|
||||
// Parse query parameters for QR code size
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const qrSize = parseInt(urlParams.get('qrSize')) || 100; // Default to 100px if not specified
|
||||
const qrOffset = parseInt(urlParams.get('qrOffset')) || 20; // Default to 20px if not specified
|
||||
|
||||
const qrCodeElement = document.getElementById('qr-code');
|
||||
qrCodeElement.style.width = `${qrSize}px`;
|
||||
qrCodeElement.style.height = `${qrSize}px`;
|
||||
qrCodeElement.style.bottom = `${qrOffset}px`;
|
||||
qrCodeElement.style.right = `${qrOffset}px`;
|
||||
}
|
||||
|
||||
// Configure QR code on page load
|
||||
|
||||
Reference in New Issue
Block a user