Spaces:
Paused
Paused
ux: revert 100-unit episode grouping (was confusing, varying sizes)
Browse files- index.html +3 -52
- sw.js +1 -1
index.html
CHANGED
|
@@ -485,22 +485,6 @@
|
|
| 485 |
width: 5px; height: 5px; border-radius: 50%; background: var(--muted); opacity: 0.55; }
|
| 486 |
.ep-chip.unwatched.active::after { display: none; }
|
| 487 |
|
| 488 |
-
/* F-7: ํ์ฐจ ๊ทธ๋ฃน (100๋จ์ ์์ฝ๋์ธ) */
|
| 489 |
-
.ep-group { margin-bottom: 8px; display: block; }
|
| 490 |
-
.ep-group > summary { cursor: pointer; font-size: 12px; color: var(--muted);
|
| 491 |
-
padding: 6px 4px; user-select: none; list-style: none; outline: none;
|
| 492 |
-
border-bottom: 1px solid var(--border); margin-bottom: 6px;
|
| 493 |
-
white-space: nowrap; }
|
| 494 |
-
.ep-group > summary::-webkit-details-marker { display: none; }
|
| 495 |
-
.ep-group > summary::before { content: 'โถ '; font-size: 9px; }
|
| 496 |
-
.ep-group[open] > summary::before { content: 'โผ '; }
|
| 497 |
-
/* ๊ทธ๋ฃนํ ๋ชจ๋์ผ ๋ ๋ถ๋ชจ ep-grid๋ฅผ block์ผ๋ก ์ ํํด์ details๋ค์ ์ธ๋ก๋ก ์๊ณ ,
|
| 498 |
-
๊ฐ ๊ทธ๋ฃน body ์์์ grid๋ก ์นฉ ์ ๋ ฌ */
|
| 499 |
-
.ep-grid.grouped { display: block; }
|
| 500 |
-
.ep-group-body { display: grid !important;
|
| 501 |
-
grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
|
| 502 |
-
gap: 6px; padding: 0 0 4px; }
|
| 503 |
-
.ep-group-body .ep-chip { width: auto; }
|
| 504 |
|
| 505 |
|
| 506 |
/* H-11/H-5: ์์ ์ฐ์๋จ ์
๋ ํธ ๋ฐ์ค๋ค (ํ์ง/์ค๋์ค/์๋ง) */
|
|
@@ -1459,20 +1443,9 @@ function renderEpisodes() {
|
|
| 1459 |
// ์ฌ์ดํธ๊ฐ ๋ณด๋ด๋ ์์ ๊ทธ๋๋ก (nid=1์ด ์ด๋ฏธ ์ต์ ). ๊ทธ๋๋ ์์ ํ๊ฒ nid ์ค๋ฆ์ฐจ์ ๋ณด์ฅ.
|
| 1460 |
const ordered = [...currentEpList].sort((a, b) => a.sid - b.sid || a.nid - b.nid);
|
| 1461 |
|
| 1462 |
-
//
|
| 1463 |
-
const useGroups = ordered.length >= 50;
|
| 1464 |
-
// ๊ทธ๋ฆฌ๋ ์ปจํ
์ด๋ ๋ชจ๋ ํ ๊ธ (๊ทธ๋ฃนํ ์ block, ์๋๋ฉด grid)
|
| 1465 |
const epGridEl = document.getElementById('epGrid');
|
| 1466 |
-
if (epGridEl) epGridEl.classList.
|
| 1467 |
-
let currentGroupKey = null;
|
| 1468 |
-
let curGroupEl = null;
|
| 1469 |
-
const getEpNum = (ep) => {
|
| 1470 |
-
const m = (ep.label || '').match(/(\d+)/);
|
| 1471 |
-
return m ? parseInt(m[1], 10) : null;
|
| 1472 |
-
};
|
| 1473 |
-
const curEp = currentEpList[currentEpIdx];
|
| 1474 |
-
const curEpNum = curEp ? getEpNum(curEp) : null;
|
| 1475 |
-
const curGroupKeyForCur = curEpNum != null ? Math.floor((curEpNum - 1) / 100) : null;
|
| 1476 |
|
| 1477 |
for (const ep of ordered) {
|
| 1478 |
const isCur = currentEpIdx >= 0
|
|
@@ -1503,29 +1476,7 @@ function renderEpisodes() {
|
|
| 1503 |
return b;
|
| 1504 |
};
|
| 1505 |
strip.appendChild(make(false));
|
| 1506 |
-
if (gridList)
|
| 1507 |
-
if (useGroups) {
|
| 1508 |
-
const epNum = getEpNum(ep);
|
| 1509 |
-
const groupKey = epNum != null ? Math.floor((epNum - 1) / 100) : -1;
|
| 1510 |
-
if (groupKey !== currentGroupKey) {
|
| 1511 |
-
currentGroupKey = groupKey;
|
| 1512 |
-
const groupWrap = document.createElement('details');
|
| 1513 |
-
groupWrap.className = 'ep-group';
|
| 1514 |
-
groupWrap.open = (groupKey === curGroupKeyForCur) || ordered.length < 200; // ํ์ฌ ํ ๊ทธ๋ฃน๋ง ํผ์นจ
|
| 1515 |
-
const start = groupKey * 100 + 1, end = start + 99;
|
| 1516 |
-
const summary = document.createElement('summary');
|
| 1517 |
-
summary.textContent = `${start}~${end}ํ`;
|
| 1518 |
-
groupWrap.appendChild(summary);
|
| 1519 |
-
curGroupEl = document.createElement('div');
|
| 1520 |
-
curGroupEl.className = 'ep-group-body';
|
| 1521 |
-
groupWrap.appendChild(curGroupEl);
|
| 1522 |
-
gridList.appendChild(groupWrap);
|
| 1523 |
-
}
|
| 1524 |
-
curGroupEl.appendChild(make(true));
|
| 1525 |
-
} else {
|
| 1526 |
-
gridList.appendChild(make(true));
|
| 1527 |
-
}
|
| 1528 |
-
}
|
| 1529 |
}
|
| 1530 |
requestAnimationFrame(() => {
|
| 1531 |
const active = strip.querySelector('.ep-chip.active');
|
|
|
|
| 485 |
width: 5px; height: 5px; border-radius: 50%; background: var(--muted); opacity: 0.55; }
|
| 486 |
.ep-chip.unwatched.active::after { display: none; }
|
| 487 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 488 |
|
| 489 |
|
| 490 |
/* H-11/H-5: ์์ ์ฐ์๋จ ์
๋ ํธ ๋ฐ์ค๋ค (ํ์ง/์ค๋์ค/์๋ง) */
|
|
|
|
| 1443 |
// ์ฌ์ดํธ๊ฐ ๋ณด๋ด๋ ์์ ๊ทธ๋๋ก (nid=1์ด ์ด๋ฏธ ์ต์ ). ๊ทธ๋๋ ์์ ํ๊ฒ nid ์ค๋ฆ์ฐจ์ ๋ณด์ฅ.
|
| 1444 |
const ordered = [...currentEpList].sort((a, b) => a.sid - b.sid || a.nid - b.nid);
|
| 1445 |
|
| 1446 |
+
// ํ์ฐจ ๊ทธ๋ฃนํ ๋นํ์ฑ โ ๋ชจ๋ ์นฉ์ ๋จ์ grid์ ํํํ๊ฒ ํ์
|
|
|
|
|
|
|
| 1447 |
const epGridEl = document.getElementById('epGrid');
|
| 1448 |
+
if (epGridEl) epGridEl.classList.remove('grouped');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1449 |
|
| 1450 |
for (const ep of ordered) {
|
| 1451 |
const isCur = currentEpIdx >= 0
|
|
|
|
| 1476 |
return b;
|
| 1477 |
};
|
| 1478 |
strip.appendChild(make(false));
|
| 1479 |
+
if (gridList) gridList.appendChild(make(true));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1480 |
}
|
| 1481 |
requestAnimationFrame(() => {
|
| 1482 |
const active = strip.querySelector('.ep-chip.active');
|
sw.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
// ์ ์ ์์๋ง ์บ์. API/cdn์ ํญ์ ๋คํธ์ํฌ.
|
| 2 |
// index.html์ ํญ์ ๋คํธ์ํฌ ์ฐ์ (์ฝ๋ ์ฆ์ ๋ฐ์์ฉ). ์คํ๋ผ์ธ์ผ ๋๋ง ์บ์ fallback.
|
| 3 |
-
const CACHE = 'tvchak-
|
| 4 |
|
| 5 |
self.addEventListener('install', (e) => {
|
| 6 |
// ์ SW๋ ์ฆ์ ํ์ฑํ (์ SW ๋๊ธฐ ์ ํจ)
|
|
|
|
| 1 |
// ์ ์ ์์๋ง ์บ์. API/cdn์ ํญ์ ๋คํธ์ํฌ.
|
| 2 |
// index.html์ ํญ์ ๋คํธ์ํฌ ์ฐ์ (์ฝ๋ ์ฆ์ ๋ฐ์์ฉ). ์คํ๋ผ์ธ์ผ ๋๋ง ์บ์ fallback.
|
| 3 |
+
const CACHE = 'tvchak-v5';
|
| 4 |
|
| 5 |
self.addEventListener('install', (e) => {
|
| 6 |
// ์ SW๋ ์ฆ์ ํ์ฑํ (์ SW ๋๊ธฐ ์ ํจ)
|