waveshaker commited on
Commit
4d6eb17
·
verified ·
1 Parent(s): 31b88e2

Update style.css

Browse files
Files changed (1) hide show
  1. style.css +16 -12
style.css CHANGED
@@ -420,14 +420,18 @@ body {
420
  /* 网格自身 */
421
  .viewer-grid {
422
  display: grid;
 
423
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
424
  gap: 0.8rem;
425
- flex: 1;
426
- min-height: 0;
427
- overflow-y: auto;
428
- align-content: start;
429
- padding: 2px;
 
 
430
  }
 
431
  #grid-pagination {
432
  flex-shrink: 0 !important;
433
  background: #151515 !important;
@@ -437,8 +441,11 @@ body {
437
  }
438
 
439
  .grid-thumb-container {
440
- width: 100%;
441
- aspect-ratio: 3 / 4;
 
 
 
442
  background: #1a1a1a;
443
  border-radius: 6px;
444
  overflow: hidden;
@@ -446,7 +453,7 @@ body {
446
  }
447
 
448
  .grid-thumb {
449
- position: absolute; /* 绝对定位,不参与行高计算 */
450
  top: 0;
451
  left: 0;
452
  width: 100%;
@@ -454,11 +461,8 @@ body {
454
  object-fit: cover;
455
  object-position: top center;
456
  display: block;
457
- cursor: pointer;
458
- border: none;
459
  opacity: 0;
460
- transition: filter 0.15s ease, opacity 0.3s ease-in-out;
461
- will-change: opacity;
462
  }
463
  .grid-thumb.loaded { opacity: 1; }
464
  .grid-thumb-container:hover .grid-thumb { filter: brightness(1.15); }
 
420
  /* 网格自身 */
421
  .viewer-grid {
422
  display: grid;
423
+ /* 这里的 120px 只是兜底,真正的宽度由 JS 算出的列数决定 */
424
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
425
  gap: 0.8rem;
426
+
427
+ /* 🌟 核心:强制 3 行等分剩余高度 */
428
+ grid-template-rows: repeat(3, 1fr) !important;
429
+ height: 100%;
430
+ overflow: hidden; /* 严禁滚动 */
431
+ align-items: center; /* 让图片在格子里居中 */
432
+ justify-items: center;
433
  }
434
+
435
  #grid-pagination {
436
  flex-shrink: 0 !important;
437
  background: #151515 !important;
 
441
  }
442
 
443
  .grid-thumb-container {
444
+ /* 放弃固定的 3/4 比例,改为按可用高度自适应,但限制最大宽度 */
445
+ width: auto;
446
+ height: 100%;
447
+ max-width: 100%;
448
+ aspect-ratio: 3 / 4; /* 🌟 依然保持 3:4 */
449
  background: #1a1a1a;
450
  border-radius: 6px;
451
  overflow: hidden;
 
453
  }
454
 
455
  .grid-thumb {
456
+ position: absolute;
457
  top: 0;
458
  left: 0;
459
  width: 100%;
 
461
  object-fit: cover;
462
  object-position: top center;
463
  display: block;
 
 
464
  opacity: 0;
465
+ transition: opacity 0.3s ease-in-out;
 
466
  }
467
  .grid-thumb.loaded { opacity: 1; }
468
  .grid-thumb-container:hover .grid-thumb { filter: brightness(1.15); }