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 table cells don't clip the zoom */
/* 1. Force the container to stay the right size */
.wikitable td {
    overflow: visible !important;
}
 
.coverThumb {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}
 
/* 1. This keeps the boxes uniform and prevents overlapping */
.coverSmall {
.coverSmall {
     display: block;
     display: block;
     width: 60px;
     width: 60px !important;
     height: 80px;
     height: 80px !important;
     overflow: hidden; /* Clips the 300px image down to 60x80 */
     overflow: hidden; /* This acts as the "crop" */
    position: relative;
     border: 1px solid #ddd;
     border: 1px solid #ddd;
    background: #eee;
}
}


/* 2. Forces the image to fill the 60x80 box without distorting */
/* 2. Force the 300px image to "shrink" into the 60x80 box */
.mw-parser-output .coverSmall img.zoom-img {
.mw-parser-output .coverSmall img.zoom-img {
     width: 60px !important;
     width: 60px !important;
     height: 80px !important;
     height: 80px !important;
     object-fit: cover; /* This is the secret to uniform thumbnails */
     object-fit: cover; /* Keeps aspect ratio neat without stretching */
     transition: transform 0.2s ease-in-out, box-shadow 0.2s ease !important;
    display: block;
    transform-origin: center center;
     transition: transform 0.2s ease-in-out !important;
    position: relative;
    z-index: 1;
}
 
/* 3. The Hover State */
.coverThumb:hover {
    z-index: 9999 !important;
}
}


/* 3. The Hover State - Magnification */
.coverThumb:hover .coverSmall {
.coverThumb:hover .coverSmall {
     overflow: visible; /* Let the image "break out" of the box */
     overflow: visible; /* Let the image break out of the 60x80 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 */
    position: absolute;
     width: 240px !important;  
    top: 0;
    left: 0;
   
     /* This defines the size of the "magnified" preview */
     width: 250px !important;  
     height: auto !important;
     height: auto !important;
      
      
     /* Center it over the original thumb */
     /* Move it to the right so it doesn't cover the name column */
    position: absolute;
     transform: translate(70px, -20px) !important;  
    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;
     z-index: 10000 !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    border: 1px solid #888;
    background: #fff;
    max-width: none !important;
}
}

Revision as of 09:45, 29 January 2026

/* 1. Force the container to stay the right size */
.coverSmall {
    display: block;
    width: 60px !important;
    height: 80px !important;
    overflow: hidden; /* This acts as the "crop" */
    position: relative;
    border: 1px solid #ddd;
}

/* 2. Force the 300px image to "shrink" into the 60x80 box */
.mw-parser-output .coverSmall img.zoom-img {
    width: 60px !important;
    height: 80px !important;
    object-fit: cover; /* Keeps aspect ratio neat without stretching */
    display: block;
    transition: transform 0.2s ease-in-out !important;
}

/* 3. The Hover State - Magnification */
.coverThumb:hover .coverSmall {
    overflow: visible; /* Let the image break out of the 60x80 box */
}

.coverThumb:hover .coverSmall img.zoom-img {
    position: absolute;
    top: 0;
    left: 0;
    
    /* This defines the size of the "magnified" preview */
    width: 250px !important; 
    height: auto !important;
    
    /* Move it to the right so it doesn't cover the name column */
    transform: translate(70px, -20px) !important; 
    
    z-index: 10000 !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    border: 1px solid #888;
    background: #fff;
    max-width: none !important;
}