模板:跳脸/style.css:修订间差异

来自BinWiki
>OctoberSama
无编辑摘要
>OctoberSama
无编辑摘要
第1行: 第1行:
/* 动画定义保持不变 */
@keyframes zoomThenHide {
@keyframes zoomThenHide {
   0% {
   0% {
     opacity: 0;
     opacity: 0;
     transform: translate(-50%, -50%) scale(0.1);
     transform: scale(0.1);
   }
   }
   20% {
   20% {
     opacity: 1;
     opacity: 1;
     transform: translate(-50%, -50%) scale(3);
     transform: scale(1);
   }
   }
   86.7% {
   86.7% {
     opacity: 1;
     opacity: 1;
     transform: translate(-50%, -50%) scale(3);
     transform: scale(1);
   }
   }
   100% {
   100% {
     opacity: 0;
     opacity: 0;
     transform: translate(-50%, -50%) scale(0);
     transform: scale(0);
   }
   }
}
}


/* 容器样式:负责定位、尺寸、动画和裁剪 */
.zoom-fullscreen {
.zoom-fullscreen {
   position: fixed !important;
   position: fixed !important;
   top: 50% !important;
   top: 0;
   left: 50% !important;
   left: 0;
   width: auto !important;
   width: 100vw;
   height: auto !important;
   height: 100vh;
   max-width: 100vw !important;
   z-index: 99999 !important;
   max-height: 100vh !important;
   overflow: hidden !important; /* 关键!裁剪掉图片溢出的部分 */
   object-fit: contain !important;
    
   transform: translate(-50%, -50%) scale(0.1);
  /* 将动画应用到容器上 */
   transform-origin: center;
   animation: zoomThenHide 1.5s ease-out forwards;
   animation: zoomThenHide 1.5s ease-out forwards;
   z-index: 99999 !important;
}
   display: block !important;
 
/* 内部图片样式:负责填充容器 */
.zoom-fullscreen img {
   position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
 
  /* --- 模拟 background-size: cover 的核心技巧 --- */
  width: auto;
  height: auto;
  min-width: 100%;
  min-height: 100%;
   max-width: none; /* 覆盖掉系统可能存在的对图片宽度的限制 */
}
}




/* 折叠部分样式保持不变 */
.mw-collapsible.mw-collapsed .zoom-fullscreen {
.mw-collapsible.mw-collapsed .zoom-fullscreen {
   visibility: hidden;
   visibility: hidden;
   opacity: 0;
   opacity: 0;
}
}
.mw-collapsible:not(.mw-collapsed) .zoom-fullscreen {
.mw-collapsible:not(.mw-collapsed) .zoom-fullscreen {
   visibility: visible;
   visibility: visible;
   opacity: 1;
   opacity: 1;
}
}

2025年7月19日 (六) 17:17的版本

/* 动画定义保持不变 */
@keyframes zoomThenHide {
  0% {
    opacity: 0;
    transform: scale(0.1);
  }
  20% {
    opacity: 1;
    transform: scale(1);
  }
  86.7% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0);
  }
}

/* 容器样式:负责定位、尺寸、动画和裁剪 */
.zoom-fullscreen {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999 !important;
  overflow: hidden !important; /* 关键!裁剪掉图片溢出的部分 */
  
  /* 将动画应用到容器上 */
  transform-origin: center;
  animation: zoomThenHide 1.5s ease-out forwards;
}

/* 内部图片样式:负责填充容器 */
.zoom-fullscreen img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  
  /* --- 模拟 background-size: cover 的核心技巧 --- */
  width: auto;
  height: auto;
  min-width: 100%;
  min-height: 100%;
  max-width: none; /* 覆盖掉系统可能存在的对图片宽度的限制 */
}


/* 折叠部分样式保持不变 */
.mw-collapsible.mw-collapsed .zoom-fullscreen {
  visibility: hidden;
  opacity: 0;
}
.mw-collapsible:not(.mw-collapsed) .zoom-fullscreen {
  visibility: visible;
  opacity: 1;
}