Jump to content

Template:TextAnimations/styles.css: Difference between revisions

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


Line 10: Line 10:
}
}


/* Standard Styles */
/* 2. Standard Styles */
/* Note: We removed 'animation-delay: inherit' so the inline JS style wins */
.wavy span {  
.wavy span {  
  display: inline-block !important;
   animation: wave 1s ease-in-out infinite;  
   animation: wave 1s ease-in-out infinite;  
  animation-delay: inherit;
}
}
.rainbow span {  
.rainbow span {  
  display: inline-block !important;
   animation: hue-cycle 3s linear infinite;  
   animation: hue-cycle 3s linear infinite;  
  animation-delay: inherit;
}
}
.wavy.rainbow span {
.wavy.rainbow span {
   /* Wave MUST be first to match JS order */
   display: inline-block !important;
   animation: wave 1s ease-in-out infinite, hue-cycle 3s linear infinite;
   animation: wave 1s ease-in-out infinite, hue-cycle 3s linear infinite;
  animation-delay: inherit;
}
}


/* Override Styles (Reduced Motion) */
/* 3. Override Styles (Reduced Motion) */
@media (prefers-reduced-motion: reduce) {
@media (prefers-reduced-motion: reduce) {
   html body .wavy span {  
   html body .wavy span,
     animation: wave 1s ease-in-out infinite !important;  
  html body .rainbow span,
     animation-delay: inherit !important;  
  html body .wavy.rainbow span {  
     animation-iteration-count: infinite !important;
     animation-play-state: running !important;
    display: inline-block !important;
   }
   }
   html body .rainbow span {  
 
    animation: hue-cycle 3s linear infinite !important;  
  html body .wavy span { animation-name: wave !important; animation-duration: 1s !important; }
    animation-delay: inherit !important;  
   html body .rainbow span { animation-name: hue-cycle !important; animation-duration: 3s !important; }
  }
   html body .wavy.rainbow span {  
   html body .wavy.rainbow span {
     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-delay: inherit !important;
   }
   }
}
}

Revision as of 07:13, 14 March 2026

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

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

/* 2. Standard Styles */
/* Note: We removed 'animation-delay: inherit' so the inline JS style wins */
.wavy span { 
  display: inline-block !important;
  animation: wave 1s ease-in-out infinite; 
}
.rainbow span { 
  display: inline-block !important;
  animation: hue-cycle 3s linear infinite; 
}
.wavy.rainbow span {
  display: inline-block !important;
  animation: wave 1s ease-in-out infinite, hue-cycle 3s linear infinite;
}

/* 3. Override Styles (Reduced Motion) */
@media (prefers-reduced-motion: reduce) {
  html body .wavy span,
  html body .rainbow span,
  html body .wavy.rainbow span { 
    animation-iteration-count: infinite !important;
    animation-play-state: running !important;
    display: inline-block !important;
  }
  
  html body .wavy span { animation-name: wave !important; animation-duration: 1s !important; }
  html body .rainbow span { animation-name: hue-cycle !important; animation-duration: 3s !important; }
  html body .wavy.rainbow span { 
    animation-name: wave, hue-cycle !important; 
    animation-duration: 1s, 3s !important;
  }
}