Add result card indexes
Browse files- frontend/app.js +4 -1
- frontend/style.css +11 -1
frontend/app.js
CHANGED
|
@@ -266,10 +266,12 @@ function pageSuffix(url) {
|
|
| 266 |
|
| 267 |
function renderResults(data) {
|
| 268 |
const grid = $("#results-grid")
|
| 269 |
-
|
|
|
|
| 270 |
const pid = item.post_id
|
| 271 |
const pg = item.url ? pageSuffix(item.url) : ""
|
| 272 |
const label = pid + pg
|
|
|
|
| 273 |
let badge = ""
|
| 274 |
if (!item.scanned) {
|
| 275 |
badge = `<span class="not-scanned">not scanned</span>`
|
|
@@ -290,6 +292,7 @@ function renderResults(data) {
|
|
| 290 |
${download}
|
| 291 |
</div>
|
| 292 |
${badge}
|
|
|
|
| 293 |
</div>`
|
| 294 |
}).join("")
|
| 295 |
grid.querySelectorAll(".result-link").forEach(el => {
|
|
|
|
| 266 |
|
| 267 |
function renderResults(data) {
|
| 268 |
const grid = $("#results-grid")
|
| 269 |
+
const offset = (data.page - 1) * PAGE_SIZE
|
| 270 |
+
grid.innerHTML = data.items.map((item, i) => {
|
| 271 |
const pid = item.post_id
|
| 272 |
const pg = item.url ? pageSuffix(item.url) : ""
|
| 273 |
const label = pid + pg
|
| 274 |
+
const index = offset + i + 1
|
| 275 |
let badge = ""
|
| 276 |
if (!item.scanned) {
|
| 277 |
badge = `<span class="not-scanned">not scanned</span>`
|
|
|
|
| 292 |
${download}
|
| 293 |
</div>
|
| 294 |
${badge}
|
| 295 |
+
<span class="result-index">${index}</span>
|
| 296 |
</div>`
|
| 297 |
}).join("")
|
| 298 |
grid.querySelectorAll(".result-link").forEach(el => {
|
frontend/style.css
CHANGED
|
@@ -293,8 +293,9 @@ input:focus, select:focus { outline: none; border-color: var(--accent); backgrou
|
|
| 293 |
padding: .25rem .15rem 1rem;
|
| 294 |
}
|
| 295 |
.result-card {
|
|
|
|
| 296 |
min-width: 0;
|
| 297 |
-
padding: .55rem;
|
| 298 |
background: var(--panel);
|
| 299 |
border: 1px solid var(--line);
|
| 300 |
border-radius: 6px;
|
|
@@ -372,6 +373,15 @@ input:focus, select:focus { outline: none; border-color: var(--accent); backgrou
|
|
| 372 |
.exif-5, .exif-6 { background: #232323; color: #aaa; }
|
| 373 |
.exif-7 { background: #2a172a; color: #d9a; }
|
| 374 |
.not-scanned, .no-exif { color: var(--dim); background: #181818; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 375 |
#viewer {
|
| 376 |
position: fixed;
|
| 377 |
inset: 0;
|
|
|
|
| 293 |
padding: .25rem .15rem 1rem;
|
| 294 |
}
|
| 295 |
.result-card {
|
| 296 |
+
position: relative;
|
| 297 |
min-width: 0;
|
| 298 |
+
padding: .55rem .55rem 1.85rem;
|
| 299 |
background: var(--panel);
|
| 300 |
border: 1px solid var(--line);
|
| 301 |
border-radius: 6px;
|
|
|
|
| 373 |
.exif-5, .exif-6 { background: #232323; color: #aaa; }
|
| 374 |
.exif-7 { background: #2a172a; color: #d9a; }
|
| 375 |
.not-scanned, .no-exif { color: var(--dim); background: #181818; }
|
| 376 |
+
.result-index {
|
| 377 |
+
position: absolute;
|
| 378 |
+
right: .55rem;
|
| 379 |
+
bottom: .45rem;
|
| 380 |
+
color: var(--dim);
|
| 381 |
+
font-family: Consolas, "SFMono-Regular", monospace;
|
| 382 |
+
font-size: .72rem;
|
| 383 |
+
font-weight: 800;
|
| 384 |
+
}
|
| 385 |
#viewer {
|
| 386 |
position: fixed;
|
| 387 |
inset: 0;
|