Jump to content

Template:TextAnimations/styles.css: Difference between revisions

From FC1
No edit summary
No edit summary
Line 1: Line 1:
/* Base Keyframes */
/* 1. Base Keyframes (Available to everyone) */
@keyframes wave {
@keyframes wave {
   0%, 100% { transform: translateY(0); }
   0%, 100% { transform: translateY(0); }
Line 10: Line 10:
}
}


/* Class logic */
/* 2. Standard Styles (For users with animations ENABLED) */
.wavy span {
.wavy span {
   display: inline-block;
   display: inline-block;
   animation-name: wave;
   animation: wave 1s ease-in-out infinite;
  animation-duration: 1s;
   animation-delay: inherit;
  animation-iteration-count: infinite;
   animation-timing-function: ease-in-out;
}
}


.rainbow span {
.rainbow span {
   animation-name: hue-cycle;
   animation: hue-cycle 3s linear infinite;
  animation-duration: 3s;
   animation-delay: inherit;
  animation-iteration-count: infinite;
   animation-timing-function: linear;
}
}


.wavy.rainbow span {
.wavy.rainbow span {
   display: inline-block;
   display: inline-block;
   animation-name: wave, hue-cycle;
   animation: wave 1s ease-in-out infinite, hue-cycle 3s linear infinite;
  animation-duration: 1s, 3s;
   animation-delay: inherit;
  animation-iteration-count: infinite, infinite;
   animation-timing-function: ease-in-out, linear;
}
}


/* 3. Override Styles (For users with animations DISABLED) */
@media (prefers-reduced-motion: reduce) {
@media (prefers-reduced-motion: reduce) {
  /* 1. Reset Wavy animations */
   html body .wavy span {
   html body .wavy span {
     display: inline-block !important;
     display: inline-block !important;
     animation-name: wave !important;
     animation: wave 1s ease-in-out infinite !important;
    animation-duration: 1s !important;
    animation-iteration-count: infinite !important;
     animation-delay: inherit !important;
     animation-delay: inherit !important;
   }
   }


  /* 2. Reset Rainbow animations */
   html body .rainbow span {
   html body .rainbow span {
     animation-name: hue-cycle !important;
     animation: hue-cycle 3s linear infinite !important;
    animation-duration: 3s !important;
    animation-iteration-count: infinite !important;
     animation-delay: inherit !important;
     animation-delay: inherit !important;
   }
   }


  /* 3. Reset Combined animations */
   html body .wavy.rainbow span {
   html body .wavy.rainbow span {
     display: inline-block !important;
     display: inline-block !important;
     animation-name: wave, hue-cycle !important;
     animation: wave 1s ease-in-out infinite, hue-cycle 3s linear infinite !important;
    animation-duration: 1s, 3s !important;
    animation-iteration-count: infinite, infinite !important;
     animation-delay: inherit !important;
     animation-delay: inherit !important;
   }
   }
}
}

Revision as of 06:59, 14 March 2026

/* 1. Base Keyframes (Available to everyone) */
@keyframes wave {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

@keyframes hue-cycle {
  from { filter: hue-rotate(0deg); }
  to   { filter: hue-rotate(360deg); }
}

/* 2. Standard Styles (For users with animations ENABLED) */
.wavy span {
  display: inline-block;
  animation: wave 1s ease-in-out infinite;
  animation-delay: inherit;
}

.rainbow span {
  animation: hue-cycle 3s linear infinite;
  animation-delay: inherit;
}

.wavy.rainbow span {
  display: inline-block;
  animation: wave 1s ease-in-out infinite, hue-cycle 3s linear infinite;
  animation-delay: inherit;
}

/* 3. Override Styles (For users with animations DISABLED) */
@media (prefers-reduced-motion: reduce) {
  html body .wavy span {
    display: inline-block !important;
    animation: wave 1s ease-in-out infinite !important;
    animation-delay: inherit !important;
  }

  html body .rainbow span {
    animation: hue-cycle 3s linear infinite !important;
    animation-delay: inherit !important;
  }

  html body .wavy.rainbow span {
    display: inline-block !important;
    animation: wave 1s ease-in-out infinite, hue-cycle 3s linear infinite !important;
    animation-delay: inherit !important;
  }
}