MediaWiki:Common.css: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
/* Ensure | /* Ensure table cells don't clip the zoom */ | ||
.wikitable td { | .wikitable td { | ||
overflow: visible !important; | overflow: visible !important; | ||
} | } | ||
.coverThumb { | .coverThumb { | ||
position: relative; | position: relative; | ||
| Line 11: | Line 10: | ||
} | } | ||
/* | /* 1. This keeps the boxes uniform and prevents overlapping */ | ||
.coverSmall { | .coverSmall { | ||
display: block; | display: block; | ||
width: 60px; | width: 60px; | ||
height: 80px; | height: 80px; | ||
overflow: | overflow: hidden; /* Clips the 300px image down to 60x80 */ | ||
border: 1px solid #ddd; | |||
background: #eee; | |||
} | } | ||
/* | /* 2. Forces the image to fill the 60x80 box without distorting */ | ||
.mw-parser-output .coverSmall img.zoom-img { | .mw-parser-output .coverSmall img.zoom-img { | ||
transition: transform 0.2s ease-in-out !important; | width: 60px !important; | ||
height: 80px !important; | |||
object-fit: cover; /* This is the secret to uniform thumbnails */ | |||
transition: transform 0.2s ease-in-out, box-shadow 0.2s ease !important; | |||
transform-origin: center center; | transform-origin: center center; | ||
position: relative; | position: relative; | ||
z-index: 1; | z-index: 1; | ||
} | } | ||
/* The Hover | /* 3. The Hover State */ | ||
.coverThumb:hover { | .coverThumb:hover { | ||
z-index: 9999 !important; | z-index: 9999 !important; | ||
} | |||
.coverThumb:hover .coverSmall { | |||
overflow: visible; /* Let the image "break out" of the box */ | |||
} | } | ||
.coverThumb:hover .coverSmall img.zoom-img { | .coverThumb:hover .coverSmall img.zoom-img { | ||
/* Set width/height back to auto or a fixed larger size to restore quality */ | |||
width: 240px !important; | |||
height: auto !important; | |||
/* | /* Center it over the original thumb */ | ||
position: absolute; | |||
top: 50%; | |||
left: 50%; | |||
transform: translate(-50%, -50%) scale(1) !important; | |||
/* | /* Aesthetics */ | ||
. | border: 1px solid #888 !important; | ||
box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important; | |||
background-color: #fff !important; | |||
z-index: 10000 !important; | |||
} | } | ||
Revision as of 09:44, 29 January 2026
/* Ensure table cells don't clip the zoom */
.wikitable td {
overflow: visible !important;
}
.coverThumb {
position: relative;
display: inline-block;
vertical-align: middle;
}
/* 1. This keeps the boxes uniform and prevents overlapping */
.coverSmall {
display: block;
width: 60px;
height: 80px;
overflow: hidden; /* Clips the 300px image down to 60x80 */
border: 1px solid #ddd;
background: #eee;
}
/* 2. Forces the image to fill the 60x80 box without distorting */
.mw-parser-output .coverSmall img.zoom-img {
width: 60px !important;
height: 80px !important;
object-fit: cover; /* This is the secret to uniform thumbnails */
transition: transform 0.2s ease-in-out, box-shadow 0.2s ease !important;
transform-origin: center center;
position: relative;
z-index: 1;
}
/* 3. The Hover State */
.coverThumb:hover {
z-index: 9999 !important;
}
.coverThumb:hover .coverSmall {
overflow: visible; /* Let the image "break out" of the box */
}
.coverThumb:hover .coverSmall img.zoom-img {
/* Set width/height back to auto or a fixed larger size to restore quality */
width: 240px !important;
height: auto !important;
/* Center it over the original thumb */
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) scale(1) !important;
/* Aesthetics */
border: 1px solid #888 !important;
box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
background-color: #fff !important;
z-index: 10000 !important;
}