Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-05-05 11:31:51 +04:00
parent 679e404dc8
commit b4ad6da49e
3 changed files with 76 additions and 12 deletions

View File

@@ -122,16 +122,24 @@
}
</button>
<!-- QR section: shown after QR is created -->
@if (qrImageUrl()) {
<div class="qr-section">
<p class="qr-section__label">{{ 'create.qr_label' | translate }}</p>
<img class="qr-section__img" [src]="qrImageUrl()!" width="240" height="240" alt="QR" />
<!-- QR popup overlay -->
@if (qrImageUrl()) {
<div class="qr-overlay" (click)="closeQr()">
<div class="qr-modal" (click)="$event.stopPropagation()">
<button class="qr-modal__close" type="button" (click)="closeQr()" aria-label="Close">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<path d="M18 6L6 18M6 6l12 12"/>
</svg>
</button>
<p class="qr-modal__label">{{ 'create.qr_label' | translate }}</p>
<img class="qr-modal__img" [src]="qrImageUrl()!" width="260" height="260" alt="QR" />
@if (qrPolling()) {
<p class="qr-section__hint">{{ 'create.qr_waiting' | translate }}</p>
<p class="qr-modal__hint">{{ 'create.qr_waiting' | translate }}</p>
}
</div>
}
</div>
}
</div>
<div class="card__footer">

View File

@@ -175,12 +175,49 @@
}
// ─── QR section ─────────────────────────────────────────────────────────────
.qr-section {
// ─── QR popup ───────────────────────────────────────────────────────────────
.qr-overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.55);
z-index: 1000;
display: flex;
align-items: center;
justify-content: center;
animation: overlay-in 0.2s ease;
}
.qr-modal {
position: relative;
background: #fff;
border-radius: 20px;
padding: 32px 28px 24px;
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
padding: 16px 0 8px;
gap: 14px;
box-shadow: 0 20px 60px rgba(0,0,0,0.25);
animation: modal-in 0.22s cubic-bezier(.34,1.56,.64,1);
max-width: 340px;
width: 90vw;
&__close {
position: absolute;
top: 12px;
right: 12px;
width: 36px;
height: 36px;
border-radius: 50%;
border: none;
background: #f1f5f9;
color: #475569;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.15s;
&:hover { background: #e2e8f0; }
}
&__label {
font-size: 13px;
@@ -202,6 +239,16 @@
}
}
@keyframes overlay-in {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes modal-in {
from { opacity: 0; transform: scale(0.85); }
to { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.45; }

View File

@@ -243,4 +243,13 @@ export class CreatePage {
onNoteChange(value: string): void {
this.note.set(value);
}
closeQr(): void {
this.qrImageUrl.set(null);
this.qrPolling.set(false);
if (this.pollHandle !== null) {
clearInterval(this.pollHandle);
this.pollHandle = null;
}
}
}