MediaWiki:Common.css: Difference between revisions

From ChimniWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 11: Line 11:
   height: auto;
   height: auto;
   display: block;
   display: block;
  transition: opacity 0.3s ease-in-out;
}
}


Line 18: Line 17:
   top: 0;
   top: 0;
   left: 0;
   left: 0;
  width: 100%;
   opacity: 0;
   opacity: 0;
   pointer-events: none;
   pointer-events: none;
   animation: altCycle 4s infinite;
   z-index: 2;
}
}


/* Only cycle alternate images while hovering */
.hover-gallery:hover .alt-image {
.hover-gallery:hover .alt-image {
   opacity: 1;
   animation: cycleImages 6s infinite;
  pointer-events: auto;
}
}


@keyframes altCycle {
.hover-gallery .main-image {
   0%, 33% {
  position: relative;
  z-index: 1;
}
 
/* Keyframes to cycle through 3 alt images */
@keyframes cycleImages {
   0%, 10% {
    opacity: 1;
  }
  33.33%, 43.33% {
    opacity: 0;
  }
 
  33.34%, 43.34% {
     opacity: 1;
     opacity: 1;
    z-index: 2;
   }
   }
   34%, 66% {
   66.66%, 76.66% {
     opacity: 0;
     opacity: 0;
    z-index: 1;
   }
   }
   67%, 100% {
 
   66.67%, 76.67% {
    opacity: 1;
  }
  100% {
     opacity: 0;
     opacity: 0;
    z-index: 1;
   }
   }
}
}


/* Assign delays to each alt image */
.hover-gallery .alt-image:nth-of-type(2) {
  animation-delay: 0s;
}
.hover-gallery .alt-image:nth-of-type(3) {
.hover-gallery .alt-image:nth-of-type(3) {
   animation-delay: 0s;
   animation-delay: 2s;
}
}
.hover-gallery .alt-image:nth-of-type(4) {
.hover-gallery .alt-image:nth-of-type(4) {
   animation-delay: 1.3s;
   animation-delay: 4s;
}
.hover-gallery .alt-image:nth-of-type(5) {
  animation-delay: 2.6s;
}
}

Revision as of 11:54, 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;
}

.hover-gallery .alt-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

/* Only cycle alternate images while hovering */
.hover-gallery:hover .alt-image {
  animation: cycleImages 6s infinite;
}

.hover-gallery .main-image {
  position: relative;
  z-index: 1;
}

/* Keyframes to cycle through 3 alt images */
@keyframes cycleImages {
  0%, 10% {
    opacity: 1;
  }
  33.33%, 43.33% {
    opacity: 0;
  }

  33.34%, 43.34% {
    opacity: 1;
  }
  66.66%, 76.66% {
    opacity: 0;
  }

  66.67%, 76.67% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* Assign delays to each alt image */
.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;
}