Jump to content

Template:TextAnimations/styles.css: Difference between revisions

From FC1
Created page with "Base Keyframes: @keyframes wave { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } } @keyframes hue-cycle { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(360deg); } } Class logic: .wavy span { display: inline-block; animation-name: wave; animation-duration: 1s; animation-iteration-count: infinite; animation-timing-function: ease-in-out; } .rainbow span { animation-name: hue-cycle; animation..."
 
No edit summary
Line 33: Line 33:
   animation-timing-function: ease-in-out, linear;
   animation-timing-function: ease-in-out, linear;
}
}
/* ... keep your existing keyframes and classes from before ... */


@media (prefers-reduced-motion: reduce) {
@media (prefers-reduced-motion: reduce) {
   .wavy span,
   /* 1. Reset Wavy animations */
  .rainbow span,
   html body .wavy span {
   .wavy.rainbow span {
     display: inline-block !important;
     /* Overriding the potential 'none' or '0s' from global styles */
    animation-name: wave !important;
    animation-duration: 1s !important;
     animation-iteration-count: infinite !important;
     animation-iteration-count: infinite !important;
     animation-play-state: running !important;
     animation-delay: inherit !important;
    animation-duration: inherit; /* Keeps the durations you set above */
  }
 
  .wavy span {
    animation-name: wave !important;
    display: inline-block !important;
   }
   }


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


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

Revision as of 06:52, 14 March 2026

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

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

/* Class logic */
.wavy span {
  display: inline-block;
  animation-name: wave;
  animation-duration: 1s;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}

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

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

@media (prefers-reduced-motion: reduce) {
  /* 1. Reset Wavy animations */
  html body .wavy span {
    display: inline-block !important;
    animation-name: wave !important;
    animation-duration: 1s !important;
    animation-iteration-count: infinite !important;
    animation-delay: inherit !important;
  }

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

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