mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-05 16:33:36 +00:00
ln decoder for qr code scan and mobile qr modal fix
This commit is contained in:
1 parent
fde64074ed
commit
0925bb9f1c
3 files changed
+35
-21
No files matched your search
@@ -492,30 +492,36 @@ export function WalletModals({
|
||||
stopScanning();
|
||||
}
|
||||
}}>
|
||||
<DialogContent className="max-w-full h-screen flex flex-col items-center justify-center p-0 bg-black border-0 [&>button]:text-white [&>button]:hover:bg-black/70">
|
||||
<DialogContent className="max-w-full w-screen h-screen flex flex-col items-center justify-center p-0 bg-black border-0 [&>button]:fixed [&>button]:top-4 [&>button]:right-4 [&>button]:z-50 [&>button]:text-white [&>button]:hover:bg-black/70">
|
||||
{/* Full-screen camera container */}
|
||||
<div className="absolute inset-0">
|
||||
<div className="fixed inset-0">
|
||||
<div id="qr-reader" className="w-full h-full"></div>
|
||||
</div>
|
||||
|
||||
{/* Dark overlay with centered square cutout */}
|
||||
<div className="absolute inset-0 pointer-events-none">
|
||||
{/* Top overlay */}
|
||||
<div className="absolute top-0 left-0 right-0 h-[calc(50vh-150px)] bg-black/60"></div>
|
||||
{/* Bottom overlay */}
|
||||
<div className="absolute bottom-0 left-0 right-0 h-[calc(50vh-150px)] bg-black/60"></div>
|
||||
{/* Left overlay */}
|
||||
<div className="absolute top-[calc(50vh-150px)] bottom-[calc(50vh-150px)] left-0 right-[calc(50vw+150px)] bg-black/60"></div>
|
||||
{/* Right overlay */}
|
||||
<div className="absolute top-[calc(50vh-150px)] bottom-[calc(50vh-150px)] left-[calc(50vw+150px)] right-0 bg-black/60"></div>
|
||||
|
||||
{/* Centered square boundary box */}
|
||||
<div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[300px] h-[300px] border-2 border-white rounded-lg"></div>
|
||||
</div>
|
||||
{/* Dark overlay with centered square cutout using SVG mask */}
|
||||
<svg className="fixed inset-0 w-full h-full pointer-events-none" style={{ zIndex: 10 }}>
|
||||
<defs>
|
||||
<mask id="qr-scanner-mask">
|
||||
<rect width="100%" height="100%" fill="white" />
|
||||
<rect
|
||||
x="calc(50% - 150px)"
|
||||
y="calc(50% - 150px)"
|
||||
width="300"
|
||||
height="300"
|
||||
rx="8"
|
||||
fill="black"
|
||||
/>
|
||||
</mask>
|
||||
</defs>
|
||||
<rect width="100%" height="100%" fill="rgba(0, 0, 0, 0.6)" mask="url(#qr-scanner-mask)" />
|
||||
</svg>
|
||||
|
||||
{/* Centered square boundary box */}
|
||||
<div className="fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[300px] h-[300px] border-2 border-white rounded-lg pointer-events-none" style={{ zIndex: 20 }}></div>
|
||||
|
||||
{/* Error message */}
|
||||
{qrError && (
|
||||
<div className="absolute top-20 left-4 right-4 p-3 bg-destructive text-destructive-foreground rounded z-50">
|
||||
<div className="fixed top-20 left-4 right-4 p-3 bg-destructive text-destructive-foreground rounded" style={{ zIndex: 50 }}>
|
||||
{qrError}
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user