-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrop.html
More file actions
164 lines (147 loc) · 4.01 KB
/
Copy pathcrop.html
File metadata and controls
164 lines (147 loc) · 4.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title data-i18n="crop_title">OnePass Auth – Выбор области сканирования</title>
<style>
body {
margin: 0;
padding: 0;
background: #000;
font-family: 'Inter', system-ui, -apple-system, sans-serif;
overflow: hidden;
user-select: none;
}
#container {
position: relative;
width: 100vw;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
#screenshot-canvas {
position: absolute;
top: 0;
left: 0;
display: block;
}
/* UI Overlay elements */
.header-bar {
position: absolute;
top: 20px;
left: 50%;
transform: translateX(-50%);
background: rgba(0, 0, 0, 0.85);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 30px;
padding: 12px 24px;
display: flex;
align-items: center;
gap: 16px;
z-index: 10;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
pointer-events: auto;
}
.header-bar__text {
color: #ffffff;
font-size: 14px;
font-weight: 500;
letter-spacing: 0.2px;
}
.header-bar__btn {
background: rgba(255, 255, 255, 0.1);
border: none;
color: #ffffff;
padding: 6px 14px;
font-size: 12px;
font-weight: 600;
border-radius: 15px;
cursor: pointer;
transition: background 0.2s;
}
.header-bar__btn:hover {
background: rgba(255, 255, 255, 0.2);
}
/* Message Toast */
.toast {
position: absolute;
bottom: 40px;
left: 50%;
transform: translateX(-50%);
background: #f05c5c;
color: #ffffff;
padding: 12px 24px;
border-radius: 20px;
font-size: 14px;
font-weight: 600;
z-index: 10;
box-shadow: 0 4px 16px rgba(240, 92, 92, 0.35);
opacity: 0;
transition: opacity 0.3s, transform 0.3s;
pointer-events: none;
}
.toast--visible {
opacity: 1;
transform: translateX(-50%) translateY(-10px);
}
.toast--success {
background: #3ecf8e;
box-shadow: 0 4px 16px rgba(62, 207, 142, 0.35);
}
/* Instructions overlay */
#instruction-overlay {
position: absolute;
inset: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
z-index: 5;
color: white;
text-align: center;
transition: opacity 0.5s;
}
#instruction-overlay h1 {
font-size: 24px;
font-weight: 700;
margin-bottom: 12px;
}
#instruction-overlay p {
font-size: 16px;
color: rgba(255, 255, 255, 0.7);
margin-bottom: 24px;
}
#instruction-overlay button {
background: #ffffff;
color: #000000;
border: none;
padding: 12px 24px;
border-radius: 25px;
font-size: 14px;
font-weight: 600;
cursor: pointer;
box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}
</style>
</head>
<body>
<div id="container">
<canvas id="screenshot-canvas"></canvas>
<div class="header-bar">
<span class="header-bar__text" data-i18n="crop_header_text">Выделите рамкой область с QR-кодом</span>
<button id="btn-cancel" class="header-bar__btn" data-i18n="crop_cancel">Отмена</button>
</div>
<div id="toast" class="toast"></div>
<div id="instruction-overlay">
<h1 data-i18n="crop_instruction_title">OnePass Auth – Сканирование QR</h1>
<p data-i18n="crop_instruction_desc">Зажмите левую кнопку мыши и выделите прямоугольником QR-код на экране</p>
<button id="btn-start" data-i18n="crop_instruction_start">Начать выделение</button>
</div>
</div>
<!-- Library Scripts -->
<script src="jsQR.js"></script>
<script type="module" src="crop.js"></script>
</body>
</html>