Spaces:
Sleeping
Sleeping
Ship gallery assets as LFS tar (fix broken images)
Browse files- static/index.html +106 -49
- static_assets.tar +2 -2
static/index.html
CHANGED
|
@@ -357,6 +357,52 @@
|
|
| 357 |
border-bottom: 1px dotted var(--text-dim); white-space: nowrap;
|
| 358 |
}
|
| 359 |
.pick-row a.plink:hover { color: var(--accent); border-color: var(--accent); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 360 |
.result-pair { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
|
| 361 |
.result-pair img { height: 44px; width: 66px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); }
|
| 362 |
.live-hint {
|
|
@@ -561,7 +607,7 @@
|
|
| 561 |
|
| 562 |
<div>
|
| 563 |
<div class="demo-step" style="margin-bottom:10px"><b>2</b> Choose an input photo</div>
|
| 564 |
-
<div class="
|
| 565 |
</div>
|
| 566 |
|
| 567 |
<div>
|
|
@@ -1383,15 +1429,15 @@
|
|
| 1383 |
url: 'https://www.pandacamera.com/products/escura-showa-400-iso-30exp-135-35mm-color-negative-film' },
|
| 1384 |
];
|
| 1385 |
const MOVIES = [
|
| 1386 |
-
{ file: 'static/demo/ref.jpg', title: 'Happy Together', meta: '1997 · Wong Kar-wai' },
|
| 1387 |
-
{ file: 'static/movies/mov_01.jpg', title: 'In the Mood for Love', meta: '2000 · Wong Kar-wai' },
|
| 1388 |
-
{ file: 'static/movies/mov_02.jpg', title: 'Days of Being Wild', meta: '1990 · Wong Kar-wai' },
|
| 1389 |
-
{ file: 'static/movies/mov_03.jpg', title: 'Close-Up', meta: '1990 · Abbas Kiarostami' },
|
| 1390 |
-
{ file: 'static/movies/mov_04.jpg', title: 'The Grand Budapest Hotel', meta: '2014 · Wes Anderson' },
|
| 1391 |
-
{ file: 'static/movies/mov_05.jpg', title: 'Barry Lyndon', meta: '1975 · Stanley Kubrick' },
|
| 1392 |
-
{ file: 'static/movies/mov_06.jpg', title: 'The Good, the Bad and the Ugly', meta: '1966 · Sergio Leone' },
|
| 1393 |
-
{ file: 'static/movies/mov_07.jpg', title: 'A Touch of Zen', meta: '1971 · King Hu' },
|
| 1394 |
-
{ file: 'static/movies/mov_08.jpg', title: 'Kagemusha', meta: '1980 · Akira Kurosawa' },
|
| 1395 |
];
|
| 1396 |
const INPUTS = [
|
| 1397 |
['01', 'Tokyo alley', true], ['02', 'Bicycle corridor', true],
|
|
@@ -1425,69 +1471,80 @@
|
|
| 1425 |
function refSrc() { return refType === 'movie' ? movie.file : 'static/lab/ref_' + film.id + '.jpg'; }
|
| 1426 |
function refName() { return refType === 'movie' ? movie.title : film.name; }
|
| 1427 |
|
|
|
|
|
|
|
| 1428 |
function refresh() {
|
| 1429 |
-
document.querySelectorAll('#movieList .
|
| 1430 |
el.classList.toggle('sel', refType === 'movie' && MOVIES[i] === movie));
|
| 1431 |
-
document.querySelectorAll('#filmList .
|
| 1432 |
el.classList.toggle('sel', refType === 'film' && FILMS[i] === film));
|
| 1433 |
-
document.querySelectorAll('#inputList .
|
| 1434 |
el.classList.toggle('sel', INPUTS[i] === input));
|
| 1435 |
|
| 1436 |
$('pairRef').src = refSrc();
|
| 1437 |
$('pairInput').src = input.src;
|
| 1438 |
$('pairInfo').innerHTML = '<b>' + refName() + '</b> → <b>' + input.name + '</b>';
|
| 1439 |
|
| 1440 |
-
|
| 1441 |
-
$('instantWrap').style.display =
|
| 1442 |
-
$('liveHint').style.display =
|
| 1443 |
-
|
| 1444 |
-
|
| 1445 |
-
|
| 1446 |
-
|
| 1447 |
-
}
|
| 1448 |
}
|
| 1449 |
|
| 1450 |
-
function
|
| 1451 |
-
const
|
| 1452 |
-
|
| 1453 |
-
|
| 1454 |
-
'<img class="
|
| 1455 |
-
'<div class="
|
| 1456 |
-
|
| 1457 |
-
|
| 1458 |
-
|
| 1459 |
-
|
| 1460 |
-
return
|
| 1461 |
}
|
| 1462 |
|
| 1463 |
MOVIES.forEach(m => {
|
| 1464 |
-
const
|
| 1465 |
-
|
| 1466 |
-
$('movieList').appendChild(
|
| 1467 |
});
|
| 1468 |
|
| 1469 |
FILMS.forEach(f => {
|
| 1470 |
-
const
|
| 1471 |
-
|
| 1472 |
-
row.querySelector('.canister').setAttribute('width', '26');
|
| 1473 |
-
row.querySelector('.canister').setAttribute('height', '35');
|
| 1474 |
const a = document.createElement('a');
|
| 1475 |
-
a.className = '
|
| 1476 |
-
a.textContent = 'about ↗';
|
| 1477 |
a.href = f.url;
|
| 1478 |
a.target = '_blank'; a.rel = 'noopener';
|
| 1479 |
-
a.title = 'About ' + f.name;
|
|
|
|
|
|
|
|
|
|
| 1480 |
a.addEventListener('click', e => e.stopPropagation());
|
| 1481 |
-
|
| 1482 |
-
|
| 1483 |
-
$('filmList').appendChild(
|
| 1484 |
});
|
| 1485 |
|
| 1486 |
INPUTS.forEach(inp => {
|
| 1487 |
-
const
|
| 1488 |
-
|
| 1489 |
-
|
| 1490 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1491 |
});
|
| 1492 |
|
| 1493 |
initCompare($('labCompare'));
|
|
|
|
| 357 |
border-bottom: 1px dotted var(--text-dim); white-space: nowrap;
|
| 358 |
}
|
| 359 |
.pick-row a.plink:hover { color: var(--accent); border-color: var(--accent); }
|
| 360 |
+
.look-card {
|
| 361 |
+
position: relative; border-radius: 10px; overflow: hidden;
|
| 362 |
+
border: 1.5px solid var(--line); cursor: pointer; flex: 0 0 auto;
|
| 363 |
+
transition: border-color .12s, transform .1s;
|
| 364 |
+
}
|
| 365 |
+
.look-card:hover { border-color: var(--text-dim); transform: translateY(-1px); }
|
| 366 |
+
.look-card.sel { border-color: var(--accent); }
|
| 367 |
+
.look-card img.bg { width: 100%; height: 96px; object-fit: cover; display: block; }
|
| 368 |
+
.look-card.film img.bg { height: 76px; }
|
| 369 |
+
.look-card .ov {
|
| 370 |
+
position: absolute; left: 0; right: 0; bottom: 0;
|
| 371 |
+
padding: 20px 10px 7px;
|
| 372 |
+
background: linear-gradient(transparent, rgba(0,0,0,.85));
|
| 373 |
+
}
|
| 374 |
+
.look-card .ov .pname { font-size: 12px; font-weight: 600; color: #fff; line-height: 1.3; }
|
| 375 |
+
.look-card .ov .pmeta { font-size: 10.5px; color: rgba(255,255,255,.72); margin-top: 1px; }
|
| 376 |
+
.look-card a.can-btn {
|
| 377 |
+
position: absolute; right: 7px; bottom: 7px; z-index: 3;
|
| 378 |
+
display: block; line-height: 0;
|
| 379 |
+
filter: drop-shadow(0 1px 3px rgba(0,0,0,.6));
|
| 380 |
+
transition: transform .12s;
|
| 381 |
+
}
|
| 382 |
+
.look-card a.can-btn:hover { transform: scale(1.12); }
|
| 383 |
+
.look-card.sel::after {
|
| 384 |
+
content: "✓"; position: absolute; top: 7px; right: 7px;
|
| 385 |
+
width: 20px; height: 20px; border-radius: 50%;
|
| 386 |
+
background: var(--accent); color: #17110a;
|
| 387 |
+
font-size: 12px; font-weight: 700;
|
| 388 |
+
display: flex; align-items: center; justify-content: center;
|
| 389 |
+
}
|
| 390 |
+
.input-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
|
| 391 |
+
.input-grid .in-card {
|
| 392 |
+
position: relative; border-radius: 8px; overflow: hidden;
|
| 393 |
+
border: 1.5px solid var(--line); cursor: pointer;
|
| 394 |
+
transition: border-color .12s;
|
| 395 |
+
}
|
| 396 |
+
.input-grid .in-card:hover { border-color: var(--text-dim); }
|
| 397 |
+
.input-grid .in-card.sel { border-color: var(--accent); }
|
| 398 |
+
.input-grid .in-card img { width: 100%; height: 64px; object-fit: cover; display: block; }
|
| 399 |
+
.input-grid .in-card.sel::after {
|
| 400 |
+
content: "✓"; position: absolute; top: 5px; right: 5px;
|
| 401 |
+
width: 17px; height: 17px; border-radius: 50%;
|
| 402 |
+
background: var(--accent); color: #17110a;
|
| 403 |
+
font-size: 10.5px; font-weight: 700;
|
| 404 |
+
display: flex; align-items: center; justify-content: center;
|
| 405 |
+
}
|
| 406 |
.result-pair { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
|
| 407 |
.result-pair img { height: 44px; width: 66px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); }
|
| 408 |
.live-hint {
|
|
|
|
| 607 |
|
| 608 |
<div>
|
| 609 |
<div class="demo-step" style="margin-bottom:10px"><b>2</b> Choose an input photo</div>
|
| 610 |
+
<div class="input-grid" id="inputList"></div>
|
| 611 |
</div>
|
| 612 |
|
| 613 |
<div>
|
|
|
|
| 1429 |
url: 'https://www.pandacamera.com/products/escura-showa-400-iso-30exp-135-35mm-color-negative-film' },
|
| 1430 |
];
|
| 1431 |
const MOVIES = [
|
| 1432 |
+
{ id: 'hap', file: 'static/demo/ref.jpg', title: 'Happy Together', meta: '1997 · Wong Kar-wai' },
|
| 1433 |
+
{ id: 'm1', file: 'static/movies/mov_01.jpg', title: 'In the Mood for Love', meta: '2000 · Wong Kar-wai' },
|
| 1434 |
+
{ id: 'm2', file: 'static/movies/mov_02.jpg', title: 'Days of Being Wild', meta: '1990 · Wong Kar-wai' },
|
| 1435 |
+
{ id: 'm3', file: 'static/movies/mov_03.jpg', title: 'Close-Up', meta: '1990 · Abbas Kiarostami' },
|
| 1436 |
+
{ id: 'm4', file: 'static/movies/mov_04.jpg', title: 'The Grand Budapest Hotel', meta: '2014 · Wes Anderson' },
|
| 1437 |
+
{ id: 'm5', file: 'static/movies/mov_05.jpg', title: 'Barry Lyndon', meta: '1975 · Stanley Kubrick' },
|
| 1438 |
+
{ id: 'm6', file: 'static/movies/mov_06.jpg', title: 'The Good, the Bad and the Ugly', meta: '1966 · Sergio Leone' },
|
| 1439 |
+
{ id: 'm7', file: 'static/movies/mov_07.jpg', title: 'A Touch of Zen', meta: '1971 · King Hu' },
|
| 1440 |
+
{ id: 'm8', file: 'static/movies/mov_08.jpg', title: 'Kagemusha', meta: '1980 · Akira Kurosawa' },
|
| 1441 |
];
|
| 1442 |
const INPUTS = [
|
| 1443 |
['01', 'Tokyo alley', true], ['02', 'Bicycle corridor', true],
|
|
|
|
| 1471 |
function refSrc() { return refType === 'movie' ? movie.file : 'static/lab/ref_' + film.id + '.jpg'; }
|
| 1472 |
function refName() { return refType === 'movie' ? movie.title : film.name; }
|
| 1473 |
|
| 1474 |
+
function refId() { return refType === 'movie' ? movie.id : film.id; }
|
| 1475 |
+
|
| 1476 |
function refresh() {
|
| 1477 |
+
document.querySelectorAll('#movieList .look-card').forEach((el, i) =>
|
| 1478 |
el.classList.toggle('sel', refType === 'movie' && MOVIES[i] === movie));
|
| 1479 |
+
document.querySelectorAll('#filmList .look-card').forEach((el, i) =>
|
| 1480 |
el.classList.toggle('sel', refType === 'film' && FILMS[i] === film));
|
| 1481 |
+
document.querySelectorAll('#inputList .in-card').forEach((el, i) =>
|
| 1482 |
el.classList.toggle('sel', INPUTS[i] === input));
|
| 1483 |
|
| 1484 |
$('pairRef').src = refSrc();
|
| 1485 |
$('pairInput').src = input.src;
|
| 1486 |
$('pairInfo').innerHTML = '<b>' + refName() + '</b> → <b>' + input.name + '</b>';
|
| 1487 |
|
| 1488 |
+
// every pair has a pre-render; onerror falls back to the live hint
|
| 1489 |
+
$('instantWrap').style.display = 'block';
|
| 1490 |
+
$('liveHint').style.display = 'none';
|
| 1491 |
+
const cmp = $('labCompare');
|
| 1492 |
+
cmp.querySelector('.base-img').src =
|
| 1493 |
+
'static/lab/' + input.id + '_' + refId() + '.jpg';
|
| 1494 |
+
cmp.querySelector('.top-img').src = input.src;
|
|
|
|
| 1495 |
}
|
| 1496 |
|
| 1497 |
+
function lookCard(imgSrc, name, meta) {
|
| 1498 |
+
const card = document.createElement('div');
|
| 1499 |
+
card.className = 'look-card';
|
| 1500 |
+
card.innerHTML =
|
| 1501 |
+
'<img class="bg" loading="lazy" alt="">' +
|
| 1502 |
+
'<div class="ov"><div class="pname"></div><div class="pmeta"></div></div>';
|
| 1503 |
+
card.querySelector('.bg').src = imgSrc;
|
| 1504 |
+
card.querySelector('.bg').alt = name;
|
| 1505 |
+
card.querySelector('.pname').textContent = name;
|
| 1506 |
+
card.querySelector('.pmeta').textContent = meta;
|
| 1507 |
+
return card;
|
| 1508 |
}
|
| 1509 |
|
| 1510 |
MOVIES.forEach(m => {
|
| 1511 |
+
const card = lookCard(m.file, m.title, m.meta);
|
| 1512 |
+
card.addEventListener('click', () => { refType = 'movie'; movie = m; refresh(); });
|
| 1513 |
+
$('movieList').appendChild(card);
|
| 1514 |
});
|
| 1515 |
|
| 1516 |
FILMS.forEach(f => {
|
| 1517 |
+
const card = lookCard('static/lab/ref_' + f.id + '.jpg', f.name, '35mm · C-41');
|
| 1518 |
+
card.classList.add('film');
|
|
|
|
|
|
|
| 1519 |
const a = document.createElement('a');
|
| 1520 |
+
a.className = 'can-btn';
|
|
|
|
| 1521 |
a.href = f.url;
|
| 1522 |
a.target = '_blank'; a.rel = 'noopener';
|
| 1523 |
+
a.title = 'About ' + f.name + ' ↗';
|
| 1524 |
+
a.innerHTML = canisterSvg(f);
|
| 1525 |
+
a.querySelector('.canister').setAttribute('width', '26');
|
| 1526 |
+
a.querySelector('.canister').setAttribute('height', '35');
|
| 1527 |
a.addEventListener('click', e => e.stopPropagation());
|
| 1528 |
+
card.appendChild(a);
|
| 1529 |
+
card.addEventListener('click', () => { refType = 'film'; film = f; refresh(); });
|
| 1530 |
+
$('filmList').appendChild(card);
|
| 1531 |
});
|
| 1532 |
|
| 1533 |
INPUTS.forEach(inp => {
|
| 1534 |
+
const card = document.createElement('div');
|
| 1535 |
+
card.className = 'in-card';
|
| 1536 |
+
card.innerHTML = '<img loading="lazy" alt="">';
|
| 1537 |
+
card.querySelector('img').src = inp.src;
|
| 1538 |
+
card.querySelector('img').alt = inp.name;
|
| 1539 |
+
card.title = inp.name;
|
| 1540 |
+
card.addEventListener('click', () => { input = inp; refresh(); });
|
| 1541 |
+
$('inputList').appendChild(card);
|
| 1542 |
+
});
|
| 1543 |
+
|
| 1544 |
+
// if a pre-render is ever missing, degrade gracefully to the live hint
|
| 1545 |
+
$('labCompare').querySelector('.base-img').addEventListener('error', () => {
|
| 1546 |
+
$('instantWrap').style.display = 'none';
|
| 1547 |
+
$('liveHint').style.display = 'block';
|
| 1548 |
});
|
| 1549 |
|
| 1550 |
initCompare($('labCompare'));
|
static_assets.tar
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d02a18a96d7015feb41ebda93fcbb5a9a745bea9beec39bdcb5c343c2f8cef16
|
| 3 |
+
size 69908480
|