dongsik22 commited on
Commit
8c40a8a
ยท
1 Parent(s): eb31ead

ux: revert 100-unit episode grouping (was confusing, varying sizes)

Browse files
Files changed (2) hide show
  1. index.html +3 -52
  2. 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
- // F-7: ํšŒ์ฐจ 50๊ฐœ ์ด์ƒ์ด๋ฉด ๊ทธ๋ฆฌ๋“œ์— 100๋‹จ์œ„ ๊ทธ๋ฃนํ™”
1463
- const useGroups = ordered.length >= 50;
1464
- // ๊ทธ๋ฆฌ๋“œ ์ปจํ…Œ์ด๋„ˆ ๋ชจ๋“œ ํ† ๊ธ€ (๊ทธ๋ฃนํ™” ์‹œ block, ์•„๋‹ˆ๋ฉด grid)
1465
  const epGridEl = document.getElementById('epGrid');
1466
- if (epGridEl) epGridEl.classList.toggle('grouped', useGroups);
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-v4';
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 ๋Œ€๊ธฐ ์•ˆ ํ•จ)