User:Toad64/Homepage: Difference between revisions

Jump to navigation Jump to search
Toad64 (talk | contribs)
added css code to herocards :D
Toad64 (talk | contribs)
updated css code on page
Line 56: Line 56:


Using some css code, the background of the Hero Card can  its background change when hovered (if not blocked behind the hero image).<syntaxhighlight lang="css">
Using some css code, the background of the Hero Card can  its background change when hovered (if not blocked behind the hero image).<syntaxhighlight lang="css">
.mw-parser-output .HeroCard .CardBacker {
.HeroCard .CardBacker {
     position: absolute;
     position: absolute;
     inset: 0;
     top: 0;
    left: 0;
    right: 0;
    bottom: 0;
     pointer-events: none;
     pointer-events: none;
     mask-size: 100% 100%;
     z-index: 1;
     mask-image: url(/images/1/1c/Card_backer.png);
 
     -webkit-mask-image: url(/images/1/1c/Card_backer.png);
     background-image: url("/images/1/1c/Card_backer.png");
     background-color: transparent;
     background-size: 100% 100%;
     transition: background-color 0.2s ease;
     background-repeat: no-repeat;
 
    opacity: 0;
     transition: opacity 0.2s ease, filter 0.2s ease;
   
    filter: brightness(0) saturate(100%) invert(74%) sepia(35%) saturate(620%) hue-rotate(114deg) brightness(91%) contrast(89%);
}
 
.HeroCard:hover .CardBacker {
    opacity: 1;
}
}


/* Only triggers the color change when the card is hovered */
.HeroCard .HeroImage,
.mw-parser-output .HeroCard:hover .CardBacker {
.HeroCard .HeroName {
     background-color: #42CFB9;
     position: relative;
    z-index: 2;
}
}
</syntaxhighlight>
</syntaxhighlight>