/
hikas
/
QrScanner
Обзор
Документация
Войти
/
hikas
/
QrScanner
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
css/style.css
421 строка
8 KB
TonyHikas
First
06 июн 2026, 23:09
06 июн 2026, 23:09
2cf3ba9
Код
Авторство
О чём код?
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; } :root { color-scheme: light dark; --bg: #f5f5f7; --surface: #ffffff; --surface-elevated: rgba(255, 255, 255, 0.85); --text: #1d1d1f; --text-secondary: #6e6e73; --accent: #0071e3; --accent-hover: #0077ed; --border: rgba(0, 0, 0, 0.08); --shadow: 0 8px 32px rgba(0, 0, 0, 0.12); --overlay: rgba(0, 0, 0, 0.45); --frame-color: #ffffff; --scan-line: rgba(0, 113, 227, 0.7); --success: #34c759; --error: #ff3b30; --radius: 16px; --radius-sm: 12px; --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px); } @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #0a0a0f; --surface: #1c1c1e; --surface-elevated: rgba(28, 28, 30, 0.9); --text: #f5f5f7; --text-secondary: #98989d; --accent: #0a84ff; --accent-hover: #409cff; --border: rgba(255, 255, 255, 0.1); --shadow: 0 8px 32px rgba(0, 0, 0, 0.5); --overlay: rgba(0, 0, 0, 0.6); --frame-color: #ffffff; --scan-line: rgba(10, 132, 255, 0.8); } } :root[data-theme="dark"] { --bg: #0a0a0f; --surface: #1c1c1e; --surface-elevated: rgba(28, 28, 30, 0.9); --text: #f5f5f7; --text-secondary: #98989d; --accent: #0a84ff; --accent-hover: #409cff; --border: rgba(255, 255, 255, 0.1); --shadow: 0 8px 32px rgba(0, 0, 0, 0.5); --overlay: rgba(0, 0, 0, 0.6); --frame-color: #ffffff; --scan-line: rgba(10, 132, 255, 0.8); } :root[data-theme="light"] { --bg: #f5f5f7; --surface: #ffffff; --surface-elevated: rgba(255, 255, 255, 0.85); --text: #1d1d1f; --text-secondary: #6e6e73; --accent: #0071e3; --accent-hover: #0077ed; --border: rgba(0, 0, 0, 0.08); --shadow: 0 8px 32px rgba(0, 0, 0, 0.12); --overlay: rgba(0, 0, 0, 0.45); --frame-color: #ffffff; --scan-line: rgba(0, 113, 227, 0.7); } html, body { height: 100%; overflow: hidden; } body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; } .app { display: flex; flex-direction: column; height: 100%; max-width: 480px; margin: 0 auto; } /* Header */ .header { display: flex; align-items: center; justify-content: space-between; padding: calc(12px + var(--safe-top)) 20px 12px; flex-shrink: 0; } .header__title { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.02em; } .theme-toggle { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: none; border-radius: 50%; background: var(--surface); color: var(--text); cursor: pointer; box-shadow: 0 1px 4px var(--border); transition: background 0.2s, transform 0.15s; } .theme-toggle:active { transform: scale(0.92); } .icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; } .icon--sun, .icon--moon { display: none; } :root[data-theme="dark"] .icon--sun, :root[data-theme="light"] .icon--moon { display: block; } @media (prefers-color-scheme: dark) { :root:not([data-theme]) .icon--sun { display: block; } } @media (prefers-color-scheme: light) { :root:not([data-theme]) .icon--moon { display: block; } } /* Scanner */ .scanner { flex: 1; display: flex; flex-direction: column; padding: 0 16px; min-height: 0; } .scanner__viewport { position: relative; flex: 1; border-radius: var(--radius); overflow: hidden; background: #000; min-height: 0; } .scanner__video { width: 100%; height: 100%; object-fit: cover; display: block; } .scanner__overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--overlay); pointer-events: none; } .scanner__frame { position: relative; width: min(65vw, 240px); aspect-ratio: 1; } .scanner__corner { position: absolute; width: 28px; height: 28px; border-color: var(--frame-color); border-style: solid; opacity: 0.9; } .scanner__corner--tl { top: 0; left: 0; border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; } .scanner__corner--tr { top: 0; right: 0; border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; } .scanner__corner--bl { bottom: 0; left: 0; border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; } .scanner__corner--br { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; } .scanner__line { position: absolute; left: 8%; right: 8%; height: 2px; background: linear-gradient(90deg, transparent, var(--scan-line), transparent); box-shadow: 0 0 12px var(--scan-line); animation: scan 2.4s ease-in-out infinite; } @keyframes scan { 0%, 100% { top: 10%; opacity: 0.4; } 50% { top: 85%; opacity: 1; } } .scanner__hint { position: absolute; bottom: 24px; font-size: 0.875rem; color: rgba(255, 255, 255, 0.85); text-align: center; padding: 0 24px; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); } .scanner__status { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 12px 20px; border-radius: var(--radius-sm); background: var(--surface-elevated); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: 0.875rem; color: var(--text-secondary); text-align: center; max-width: 80%; line-height: 1.4; } .scanner__status--error { color: var(--error); } .scanner__status--success { color: var(--success); } .scanner__viewport--found .scanner__frame { animation: pulse 0.4s ease; } @keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.04); } 100% { transform: scale(1); } } /* Result */ .result { margin-top: 12px; padding: 16px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); animation: slideUp 0.3s ease; flex-shrink: 0; } @keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } } .result__label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); margin-bottom: 8px; } .result__value { font-size: 0.9375rem; line-height: 1.5; word-break: break-all; color: var(--text); max-height: 120px; overflow-y: auto; } .result__copy { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 8px 14px; border: none; border-radius: 8px; background: var(--accent); color: #fff; font-size: 0.8125rem; font-weight: 500; cursor: pointer; transition: background 0.2s, transform 0.15s; } .result__copy:active { transform: scale(0.96); } .result__copy:hover { background: var(--accent-hover); } .result__copy .icon { width: 16px; height: 16px; stroke: #fff; } /* Footer */ .footer { padding: 12px 16px calc(16px + var(--safe-bottom)); flex-shrink: 0; } .gallery-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 0.9375rem; font-weight: 500; cursor: pointer; transition: background 0.2s, transform 0.15s; box-shadow: 0 2px 8px var(--border); } .gallery-btn:active { transform: scale(0.98); background: var(--bg); } .gallery-btn .icon { width: 22px; height: 22px; } .gallery-input { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }