Jump to content

Template:TextAnimations/styles.css

From FC1
Revision as of 06:02, 14 March 2026 by DB (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
/* 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;
}

/* ... keep your existing keyframes and classes from before ... */

@media (prefers-reduced-motion: reduce) {
  .wavy span, 
  .rainbow span, 
  .wavy.rainbow span {
    /* Overriding the potential 'none' or '0s' from global styles */
    animation-iteration-count: infinite !important;
    animation-play-state: running !important;
    animation-duration: inherit; /* Keeps the durations you set above */
  }

  .wavy span {
    animation-name: wave !important;
    display: inline-block !important;
  }

  .rainbow span {
    animation-name: hue-cycle !important;
  }

  .wavy.rainbow span {
    animation-name: wave, hue-cycle !important;
    display: inline-block !important;
  }
}