-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcapture.html
More file actions
226 lines (193 loc) · 4.75 KB
/
capture.html
File metadata and controls
226 lines (193 loc) · 4.75 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Region Capture</title>
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: #0f172a;
color: #e2e8f0;
min-height: 100vh;
}
.shell {
display: grid;
grid-template-columns: minmax(0, 1fr) 340px;
min-height: 100vh;
}
.stage {
padding: 20px;
overflow: auto;
background:
radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 35%),
linear-gradient(180deg, #020617 0%, #111827 100%);
}
.frame {
position: relative;
max-width: 1200px;
margin: 0 auto;
border-radius: 16px;
padding: 16px;
background: rgba(15, 23, 42, 0.8);
border: 1px solid rgba(148, 163, 184, 0.2);
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.image-wrap {
position: relative;
display: inline-block;
max-width: 100%;
cursor: crosshair;
user-select: none;
}
.image-wrap img {
display: block;
max-width: 100%;
border-radius: 12px;
}
.selection {
position: absolute;
border: 2px solid #38bdf8;
background: rgba(56, 189, 248, 0.18);
box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.45);
pointer-events: none;
display: none;
}
.selection.visible {
display: block;
}
.sidebar {
padding: 24px;
background: #f8fafc;
color: #0f172a;
border-left: 1px solid #cbd5e1;
}
h1 {
font-size: 20px;
margin: 0 0 8px;
}
.lede {
font-size: 13px;
line-height: 1.5;
color: #475569;
margin-bottom: 18px;
}
.card {
background: white;
border: 1px solid #e2e8f0;
border-radius: 12px;
padding: 14px;
margin-bottom: 14px;
}
.label {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.05em;
color: #64748b;
margin-bottom: 6px;
}
.value {
font-size: 13px;
line-height: 1.5;
word-break: break-word;
}
textarea {
width: 100%;
min-height: 150px;
resize: vertical;
border-radius: 10px;
border: 1px solid #cbd5e1;
padding: 12px;
font: inherit;
}
textarea:focus {
outline: 2px solid rgba(37, 99, 235, 0.25);
border-color: #2563eb;
}
.actions {
display: grid;
gap: 10px;
}
button {
border: none;
border-radius: 10px;
padding: 12px 14px;
font: inherit;
font-weight: 700;
cursor: pointer;
transition: background 0.2s ease, transform 0.15s ease;
}
button:hover {
transform: translateY(-1px);
}
.primary {
background: #2563eb;
color: white;
}
.secondary {
background: #e2e8f0;
color: #0f172a;
}
.danger {
background: #fee2e2;
color: #991b1b;
}
.status {
font-size: 12px;
color: #475569;
}
.error {
color: #b91c1c;
}
@media (max-width: 980px) {
.shell {
grid-template-columns: 1fr;
}
.sidebar {
border-left: none;
border-top: 1px solid #cbd5e1;
}
}
</style>
</head>
<body>
<div class="shell">
<div class="stage">
<div class="frame">
<div class="image-wrap" id="image-wrap">
<img id="screenshot-image" alt="Captured viewport screenshot">
<div class="selection" id="selection-box"></div>
</div>
</div>
</div>
<aside class="sidebar">
<h1>Capture Region Feedback</h1>
<p class="lede">Drag a box over the screenshot, describe the change, and save it back into the page history.</p>
<div class="card">
<div class="label">Source</div>
<div class="value" id="source-url"></div>
</div>
<div class="card">
<div class="label">Selection</div>
<div class="value" id="selection-summary">Draw a box on the screenshot.</div>
</div>
<div class="card">
<div class="label">Requested Change</div>
<textarea id="note-field" placeholder="Describe what should change in this region..."></textarea>
</div>
<div class="actions">
<button class="primary" id="save-btn">Save Region Feedback</button>
<button class="secondary" id="reset-btn">Reset Selection</button>
<button class="danger" id="cancel-btn">Cancel</button>
</div>
<p class="status" id="status-line"></p>
</aside>
</div>
<script src="shared.js"></script>
<script src="capture.js"></script>
</body>
</html>