MediaWiki:Common.css: Difference between revisions

From 3DO World
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
/* Ensure the table cell doesn't clip anything */
/* Ensure table cells don't clip the zoom */
.wikitable td {
.wikitable td {
     overflow: visible !important;
     overflow: visible !important;
}
}


/* The outer container */
.coverThumb {
.coverThumb {
     position: relative;
     position: relative;
Line 11: Line 10:
}
}


/* The wrapper that forces the 60x80 size */
/* 1. This keeps the boxes uniform and prevents overlapping */
.coverSmall {
.coverSmall {
     display: block;
     display: block;
     width: 60px;
     width: 60px;
     height: 80px;
     height: 80px;
     overflow: visible;  
     overflow: hidden; /* Clips the 300px image down to 60x80 */
    border: 1px solid #ddd;
    background: #eee;
}
}


/* Target the image directly using the class from the template */
/* 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;
    cursor: pointer;
     position: relative;
     position: relative;
     z-index: 1;
     z-index: 1;
}
}


/* The Hover Effect */
/* 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 {
     transform: scale(4) !important; /* Zooms from center */
     /* Set width/height back to auto or a fixed larger size to restore quality */
     z-index: 10000 !important;
     width: 240px !important;  
    border: 1px solid #aaa !important;
     height: auto !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4) !important;
     background-color: #fff !important;
      
      
     /* Override MediaWiki's hardcoded attributes */
     /* Center it over the original thumb */
     max-width: none !important;
     position: absolute;
     height: auto !important;
    top: 50%;
}
    left: 50%;
     transform: translate(-50%, -50%) scale(1) !important;  


/* Ensure the link doesn't interfere */
    /* Aesthetics */
.coverSmall a {
    border: 1px solid #888 !important;
     display: block;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
     overflow: visible;
     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;
}