feat(settings): option to show/hide camera button, preview click opens camera

This commit is contained in:
dev
2026-09-24 12:00:20 +03:00
parent e4704c2dc6
commit e6c69c8a78
8 changed files with 49 additions and 10 deletions
+6 -3
View File
@@ -43,8 +43,10 @@ h1{font-size:1.5rem;font-weight:600;margin-bottom:8px;letter-spacing:-.02em;text
.files-card .paste-hint{text-align:left}
@media(hover:none){.paste-hint{display:none}}
.preview-wrap{width:100%;display:flex;flex-direction:column;align-items:center;gap:8px}
.preview{max-width:100%;width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:var(--radius);background:var(--card);display:block;border:1px dashed var(--border)}
.preview{max-width:100%;width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:var(--radius);background:var(--card);display:block;border:1px dashed var(--border);cursor:pointer;transition:border-color .15s}
.preview.has-photo{border-style:solid}
.preview:hover,.preview:focus-visible{border-color:var(--accent)}
.preview-caption{font-size:.85rem;color:var(--muted);text-align:center;line-height:1.35}
.remove-photo{background:none;border:none;color:#ef4444;font-size:.85rem;cursor:pointer;padding:4px;display:none}
.remove-photo.show{display:block}
@@ -107,10 +109,11 @@ nav a:hover{color:var(--text)}
<div class="photo-col">
<div class="photo-card">
<div class="preview-wrap">
<img class="preview" id="preview" alt="Фото" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='480'%3E%3Crect width='100%25' height='100%25' fill='none' stroke='%23475569' stroke-width='2' stroke-dasharray='8 8'/%3E%3Ctext x='50%25' y='50%25' fill='%2364748b' font-family='sans-serif' font-size='28' text-anchor='middle' dominant-baseline='middle'%3EФото%3C/text%3E%3C/svg%3E">
<img class="preview" id="preview" alt="Фото" title="Открыть камеру" tabindex="0" role="button" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='480'%3E%3Crect width='100%25' height='100%25' fill='none' stroke='%23475569' stroke-width='2' stroke-dasharray='8 8'/%3E%3Ctext x='50%25' y='50%25' fill='%2364748b' font-family='sans-serif' font-size='28' text-anchor='middle' dominant-baseline='middle'%3EФото%3C/text%3E%3C/svg%3E">
<p class="preview-caption" id="previewCaption">Нажми чтобы сделать фото</p>
<button type="button" class="remove-photo" id="removePhotoBtn">Убрать фото</button>
</div>
<div class="photo-btns">
<div class="photo-btns" id="camBtns">
<button type="button" class="cam" id="openCamBtn">Камера</button>
</div>
</div>