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 */
/* 1. Base Keyframes - Using 'top' is safe and won't shake the page */
@keyframes wave {
@keyframes wave {
   0%, 100% { margin-top: 0; }
   0%, 100% { top: 0; }
   50%      { margin-top: -6px; }
   50%      { top: -6px; }
}
}


Line 13: Line 13:
.wavy span {  
.wavy span {  
   display: inline-block !important;
   display: inline-block !important;
   vertical-align: middle;
   position: relative !important; /* Required for 'top' to work */
   animation: wave 1s ease-in-out infinite;  
   animation: wave 1s ease-in-out infinite;  
}
}
.rainbow span {  
.rainbow span {  
   display: inline-block !important;
   display: inline-block !important;
   animation: hue-cycle 3s linear infinite;  
   animation: hue-cycle 3s linear infinite;  
}
}
.wavy.rainbow span {
.wavy.rainbow span {
   display: inline-block !important;
   display: inline-block !important;
   vertical-align: middle;
   position: relative !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;
}
}
Line 34: Line 36:
     animation-play-state: running !important;
     animation-play-state: running !important;
     display: inline-block !important;
     display: inline-block !important;
    position: relative !important;
   }
   }
    
    

Revision as of 07:22, 14 March 2026

/* 1. Base Keyframes - Using 'top' is safe and won't shake the page */
@keyframes wave {
  0%, 100% { top: 0; }
  50%      { top: -6px; }
}

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

/* 2. Standard Styles */
.wavy span { 
  display: inline-block !important;
  position: relative !important; /* Required for 'top' to work */
  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;
  position: relative !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;
    position: relative !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;
  }
}