MediaWiki:Common.css: Difference between revisions

From 3DO World
Jump to navigation Jump to search
No edit summary
Tag: Reverted
No edit summary
 
(38 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* =========================
/* ================================================================
   Pamphlet table + cover hover preview
  COVER PREVIEW SYSTEM - COMPLETE VERSION (July 2025 style)
   (scoped so it ONLY affects tables with class="pamphletTable")
   For both pamphlets table and games table
   ========================= */
   Uses {{CoverThumb}} with frameless
   ================================================================ */


/* Table layout */
/* 1. Container - exactly fits the small 80px thumb */
.mw-parser-output table.pamphletTable {
.mw-parser-output .cover-preview {
  width: 100%;
    position: relative;
  table-layout: auto;
    display: inline-block;
  border-collapse: collapse;
    width: 80px;
    height: auto;
    line-height: 0;
    margin: 0 auto;
    text-align: center;
}
}


/* Cell padding / spacing */
/* 2. Kill all default MW/Vector margins/padding on wrappers & images */
.mw-parser-output table.pamphletTable th,
.mw-parser-output .cover-preview a.image,
.mw-parser-output table.pamphletTable td {
.mw-parser-output .cover-preview .image,
  padding: 10px 14px;     /* increase/decrease to taste */
.mw-parser-output .cover-preview img,
  vertical-align: middle;
.mw-parser-output .cover-preview .cover-small,
  text-align: left;
.mw-parser-output .cover-preview .cover-large-img {
    margin: 0 !important;
    margin-left: 0 !important;
    padding: 0 !important;
    border: none !important;
    vertical-align: middle !important;
    display: block !important;
}
}


/* Header styling (optional but nice) */
/* 3. Small thumbnail - forced center */
.mw-parser-output table.pamphletTable th {
.mw-parser-output .cover-preview .cover-small {
  font-weight: 600;
    display: block;
    margin: 0 auto;
}
}


/* Cover column locked + centered */
/* 4. Large preview - starts hidden, no left gap */
.mw-parser-output table.pamphletTable th:first-child,
.mw-parser-output .cover-preview .cover-large {
.mw-parser-output table.pamphletTable td:first-child {
    position: absolute;
  width: 80px;
    top: -25px;                    /* nudge up a bit */
  min-width: 80px;
    left: 75px;                    /* start close to cell edge – try 70px or 80px if needed */
  text-align: center;
    z-index: 100;
  padding: 6px;           /* tighter padding for the image cell */
    opacity: 0;
  overflow: visible;       /* important so hover-zoom can escape */
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease;
    background: #ffffff;
    border: 1px solid #cccccc;
    box-shadow: 0 8px 25px rgba(0,0,0,0.45);
    padding: 4px;
    overflow: hidden;
}
}


/* Keep the cover cell from wrapping oddly */
/* 5. Force large image to ignore any leftover left margin */
.mw-parser-output table.pamphletTable td:first-child {
.mw-parser-output .cover-preview .cover-large a.image,
  white-space: nowrap;
.mw-parser-output .cover-preview .cover-large img.cover-large-img {
    margin-left: 0 !important;
    padding-left: 0 !important;
    margin: 0 !important;
}
}


/* =========================
/* 6. Hover behavior */
  CoverThumb thumbnail box (uniform)
.mw-parser-output .cover-preview:hover .cover-large {
  ========================= */
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


.mw-parser-output table.pamphletTable .coverThumb {
.mw-parser-output .cover-preview:hover .cover-small {
  position: relative;
    opacity: 0;
  display: inline-block;
    visibility: hidden;
  z-index: 1;
}
}


.mw-parser-output table.pamphletTable .coverSmall {
/* 7. Table cell must not clip the popup */
  width: 60px;
.mw-parser-output .wikitable td:first-child,
  height: 80px;
.mw-parser-output .wikitable th:first-child {
  overflow: hidden;
    overflow: visible !important;
  display: flex;
    position: relative !important;
  align-items: center;
    text-align: center !important;
  justify-content: center;
    padding: 4px 6px !important;
    vertical-align: middle !important;
}
}


/* Smooth hover */
/* 8. Slightly tighter rows so table doesn't feel too tall */
.mw-parser-output table.pamphletTable .coverSmall img,
.mw-parser-output .wikitable tr {
.mw-parser-output table.pamphletTable img.zoom-img {
    line-height: 1.18;
  transition: transform 120ms ease;
  transform-origin: top left;
}
}


/* =========================
/* 9. Respect reduced motion preference */
  Hover zoom (pop-out preview)
@media (prefers-reduced-motion: reduce) {
  - This assumes your template adds class=zoom-img to the <img>
    .mw-parser-output .cover-preview * {
  ========================= */
        transition-duration: 0.01ms !important;
 
    }
.mw-parser-output table.pamphletTable .coverThumb:hover img.zoom-img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
 
  /* final preview size is controlled by scale + translate */
  transform: translate(100px, -20px) scale(3);
 
  z-index: 10000 !important;
  pointer-events: none !important;
 
  background: #fff;
  border: 1px solid #888;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
}


/* If anything clips the preview, this usually fixes it */
/* ────────────────────────────────────────────────
.mw-parser-output table.pamphletTable td {
  Optional debug helpers – remove after testing
  overflow: visible;
  ──────────────────────────────────────────────── */
}
/*
.mw-parser-output .cover-preview { outline: 1px dashed lime !important; }          /* small container */
.mw-parser-output .cover-preview .cover-large { outline: 2px solid blue !important; } /* preview area */
*/

Latest revision as of 12:48, 29 January 2026

/* ================================================================
   COVER PREVIEW SYSTEM - COMPLETE VERSION (July 2025 style)
   For both pamphlets table and games table
   Uses {{CoverThumb}} with frameless
   ================================================================ */

/* 1. Container - exactly fits the small 80px thumb */
.mw-parser-output .cover-preview {
    position: relative;
    display: inline-block;
    width: 80px;
    height: auto;
    line-height: 0;
    margin: 0 auto;
    text-align: center;
}

/* 2. Kill all default MW/Vector margins/padding on wrappers & images */
.mw-parser-output .cover-preview a.image,
.mw-parser-output .cover-preview .image,
.mw-parser-output .cover-preview img,
.mw-parser-output .cover-preview .cover-small,
.mw-parser-output .cover-preview .cover-large-img {
    margin: 0 !important;
    margin-left: 0 !important;
    padding: 0 !important;
    border: none !important;
    vertical-align: middle !important;
    display: block !important;
}

/* 3. Small thumbnail - forced center */
.mw-parser-output .cover-preview .cover-small {
    display: block;
    margin: 0 auto;
}

/* 4. Large preview - starts hidden, no left gap */
.mw-parser-output .cover-preview .cover-large {
    position: absolute;
    top: -25px;                    /* nudge up a bit */
    left: 75px;                    /* start close to cell edge – try 70px or 80px if needed */
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease;
    background: #ffffff;
    border: 1px solid #cccccc;
    box-shadow: 0 8px 25px rgba(0,0,0,0.45);
    padding: 4px;
    overflow: hidden;
}

/* 5. Force large image to ignore any leftover left margin */
.mw-parser-output .cover-preview .cover-large a.image,
.mw-parser-output .cover-preview .cover-large img.cover-large-img {
    margin-left: 0 !important;
    padding-left: 0 !important;
    margin: 0 !important;
}

/* 6. Hover behavior */
.mw-parser-output .cover-preview:hover .cover-large {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mw-parser-output .cover-preview:hover .cover-small {
    opacity: 0;
    visibility: hidden;
}

/* 7. Table cell must not clip the popup */
.mw-parser-output .wikitable td:first-child,
.mw-parser-output .wikitable th:first-child {
    overflow: visible !important;
    position: relative !important;
    text-align: center !important;
    padding: 4px 6px !important;
    vertical-align: middle !important;
}

/* 8. Slightly tighter rows so table doesn't feel too tall */
.mw-parser-output .wikitable tr {
    line-height: 1.18;
}

/* 9. Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .mw-parser-output .cover-preview * {
        transition-duration: 0.01ms !important;
    }
}

/* ────────────────────────────────────────────────
   Optional debug helpers – remove after testing
   ──────────────────────────────────────────────── */
/*
.mw-parser-output .cover-preview { outline: 1px dashed lime !important; }          /* small container */
.mw-parser-output .cover-preview .cover-large { outline: 2px solid blue !important; } /* preview area */
*/