From db17f1860c58e2feb46f7a83f1261c5e8a61d4c4 Mon Sep 17 00:00:00 2001 From: Sergey Antropoff Date: Thu, 23 Jul 2026 09:07:23 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20lightbox=20=D0=B4=D0=BB=D1=8F=20QR-=D0=BA=D0=BE=D0=B4?= =?UTF-8?q?=D0=BE=D0=B2=20=D0=B2=20HTML-=D0=BA=D0=B0=D1=82=D0=B0=D0=BB?= =?UTF-8?q?=D0=BE=D0=B3=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Клик по QR открывает крупный просмотр с подписью; закрытие по Esc, кнопке и клику на фон. В global и server index. Co-authored-by: Cursor --- .../templates/export/global-index.html.j2 | 155 +++++++++++++++++- .../hysteria2/templates/export/index.html.j2 | 155 +++++++++++++++++- 2 files changed, 308 insertions(+), 2 deletions(-) diff --git a/roles/hysteria2/templates/export/global-index.html.j2 b/roles/hysteria2/templates/export/global-index.html.j2 index ec63c7a..1da825e 100644 --- a/roles/hysteria2/templates/export/global-index.html.j2 +++ b/roles/hysteria2/templates/export/global-index.html.j2 @@ -247,7 +247,96 @@ width: 160px; height: 160px; image-rendering: pixelated; + cursor: zoom-in; + border-radius: 4px; + transition: transform 0.2s ease, box-shadow 0.2s ease; } + .qr-block img:hover { + transform: scale(1.03); + box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); + } + .lightbox { + position: fixed; + inset: 0; + z-index: 200; + display: flex; + align-items: center; + justify-content: center; + padding: 1.5rem; + background: rgba(8, 12, 18, 0.72); + backdrop-filter: blur(10px); + -webkit-backdrop-filter: blur(10px); + opacity: 0; + visibility: hidden; + pointer-events: none; + transition: opacity 0.22s ease, visibility 0.22s ease; + } + .lightbox.open { + opacity: 1; + visibility: visible; + pointer-events: auto; + } + .lightbox-panel { + position: relative; + max-width: min(92vw, 420px); + width: 100%; + padding: 1.25rem 1.25rem 1rem; + background: var(--bg-card); + border: 1px solid var(--border); + border-radius: 18px; + box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45); + text-align: center; + transform: translateY(12px) scale(0.96); + transition: transform 0.22s ease; + } + .lightbox.open .lightbox-panel { + transform: translateY(0) scale(1); + } + .lightbox-panel img { + width: 100%; + max-width: 320px; + height: auto; + aspect-ratio: 1; + background: #fff; + border-radius: 12px; + padding: 0.75rem; + image-rendering: pixelated; + } + .lightbox-caption { + margin-top: 0.85rem; + font-size: 0.95rem; + font-weight: 650; + color: var(--text); + } + .lightbox-hint { + margin-top: 0.25rem; + font-size: 0.75rem; + color: var(--muted); + } + .lightbox-close { + position: absolute; + top: 0.65rem; + right: 0.65rem; + width: 36px; + height: 36px; + border: 1px solid var(--border); + border-radius: 999px; + background: var(--bg-input); + color: var(--muted); + cursor: pointer; + font-size: 1.25rem; + line-height: 1; + display: flex; + align-items: center; + justify-content: center; + transition: color 0.15s, border-color 0.15s, background 0.15s; + } + .lightbox-close:hover { + color: var(--accent); + border-color: var(--accent); + background: var(--accent-soft); + } + body.lightbox-open { overflow: hidden; } .files { display: flex; flex-wrap: wrap; @@ -361,7 +450,17 @@ {% if user.has_png | default(false) %}
- QR {{ user.name | e }} + QR {{ user.name | e }}
{% endif %} @@ -383,6 +482,15 @@
Сгенерировано Ansible · {{ generated_at | default('') }}
Скопировано!
+ + diff --git a/roles/hysteria2/templates/export/index.html.j2 b/roles/hysteria2/templates/export/index.html.j2 index 9371a3a..9c843a2 100644 --- a/roles/hysteria2/templates/export/index.html.j2 +++ b/roles/hysteria2/templates/export/index.html.j2 @@ -178,7 +178,96 @@ width: 100%; height: auto; image-rendering: pixelated; + cursor: zoom-in; + border-radius: 4px; + transition: transform 0.2s ease, box-shadow 0.2s ease; } + .qr-block img:hover { + transform: scale(1.03); + box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); + } + .lightbox { + position: fixed; + inset: 0; + z-index: 200; + display: flex; + align-items: center; + justify-content: center; + padding: 1.5rem; + background: rgba(8, 12, 18, 0.72); + backdrop-filter: blur(10px); + -webkit-backdrop-filter: blur(10px); + opacity: 0; + visibility: hidden; + pointer-events: none; + transition: opacity 0.22s ease, visibility 0.22s ease; + } + .lightbox.open { + opacity: 1; + visibility: visible; + pointer-events: auto; + } + .lightbox-panel { + position: relative; + max-width: min(92vw, 420px); + width: 100%; + padding: 1.25rem 1.25rem 1rem; + background: var(--bg-card); + border: 1px solid var(--border); + border-radius: 18px; + box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45); + text-align: center; + transform: translateY(12px) scale(0.96); + transition: transform 0.22s ease; + } + .lightbox.open .lightbox-panel { + transform: translateY(0) scale(1); + } + .lightbox-panel img { + width: 100%; + max-width: 320px; + height: auto; + aspect-ratio: 1; + background: #fff; + border-radius: 12px; + padding: 0.75rem; + image-rendering: pixelated; + } + .lightbox-caption { + margin-top: 0.85rem; + font-size: 0.95rem; + font-weight: 650; + color: var(--text); + } + .lightbox-hint { + margin-top: 0.25rem; + font-size: 0.75rem; + color: var(--muted); + } + .lightbox-close { + position: absolute; + top: 0.65rem; + right: 0.65rem; + width: 36px; + height: 36px; + border: 1px solid var(--border); + border-radius: 999px; + background: var(--bg-input); + color: var(--muted); + cursor: pointer; + font-size: 1.25rem; + line-height: 1; + display: flex; + align-items: center; + justify-content: center; + transition: color 0.15s, border-color 0.15s, background 0.15s; + } + .lightbox-close:hover { + color: var(--accent); + border-color: var(--accent); + background: var(--accent-soft); + } + body.lightbox-open { overflow: hidden; } .files { display: flex; flex-wrap: wrap; @@ -283,7 +372,17 @@ {% if user.has_png %}
- QR-код {{ user.name | e }} + QR-код {{ user.name | e }}
{% endif %} @@ -305,6 +404,15 @@
Скопировано!
+ +