MediaWiki:Common.css: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 13: | Line 13: | ||
} | } | ||
/* Base alt-image setup */ | |||
.hover-gallery .alt-image { | .hover-gallery .alt-image { | ||
position: absolute; | position: absolute; | ||
| Line 19: | Line 20: | ||
width: 100%; | width: 100%; | ||
opacity: 0; | opacity: 0; | ||
z-index: 2; | |||
animation-duration: 6s; | |||
animation-iteration-count: infinite; | |||
animation-timing-function: ease-in-out; | |||
animation-fill-mode: both; | |||
pointer-events: none; | pointer-events: none; | ||
} | } | ||
/* | /* Activate animation only on hover */ | ||
.hover-gallery:hover .alt-image { | .hover-gallery:hover .alt-image { | ||
animation | animation-name: fadeCycle; | ||
} | } | ||
/* | /* Each alt image offset by delay */ | ||
.hover-gallery .alt-image:nth-of-type(2) { | .hover-gallery .alt-image:nth-of-type(2) { | ||
animation-delay: 0s; | animation-delay: 0s; | ||
| Line 66: | Line 42: | ||
.hover-gallery .alt-image:nth-of-type(4) { | .hover-gallery .alt-image:nth-of-type(4) { | ||
animation-delay: 4s; | animation-delay: 4s; | ||
} | |||
/* Smooth fade-in/fade-out animation */ | |||
@keyframes fadeCycle { | |||
0%, 20% { opacity: 1; } | |||
33.33%, 100% { opacity: 0; } | |||
} | } | ||
Revision as of 12:03, 31 July 2025
/* CSS placed here will be applied to all skins */
.hover-gallery {
position: relative;
overflow: hidden;
display: inline-block;
}
.hover-gallery img {
width: 100%;
height: auto;
display: block;
}
/* Base alt-image setup */
.hover-gallery .alt-image {
position: absolute;
top: 0;
left: 0;
width: 100%;
opacity: 0;
z-index: 2;
animation-duration: 6s;
animation-iteration-count: infinite;
animation-timing-function: ease-in-out;
animation-fill-mode: both;
pointer-events: none;
}
/* Activate animation only on hover */
.hover-gallery:hover .alt-image {
animation-name: fadeCycle;
}
/* Each alt image offset by delay */
.hover-gallery .alt-image:nth-of-type(2) {
animation-delay: 0s;
}
.hover-gallery .alt-image:nth-of-type(3) {
animation-delay: 2s;
}
.hover-gallery .alt-image:nth-of-type(4) {
animation-delay: 4s;
}
/* Smooth fade-in/fade-out animation */
@keyframes fadeCycle {
0%, 20% { opacity: 1; }
33.33%, 100% { opacity: 0; }
}