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 - Shallow 2px lift */
/* Keyframes */
@keyframes wave {
@keyframes wavy-move {
   0%, 100% { top: 0; }
   0%, 100% { transform: translateY(0); }
   50%      { top: -2px; }  
   50%      { transform: translateY(-2px); }  
}
}


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


/* 2. Formatting & Container Styles */
/* New Jolt/Wiggle Keyframes */
@keyframes jolt-shake {
  0%  { transform: translate(0, 0); }
  25%  { transform: translate(1px, -1px); }
  50%  { transform: translate(-1px, 1px); }
  75%  { transform: translate(1px, 1px); }
  100% { transform: translate(0, 0); }
}
 
/* Container & Spans */
.text-animation-container {
.text-animation-container {
   display: inline !important;
   display: inline-block;
   white-space: nowrap;
   white-space: pre-wrap; /* Maintains spacing */
  padding: 2px 4px;
  border-radius: 3px;
}
}


.text-animation-container span {
.text-animation-container span {
   display: inline-block !important;
   display: inline-block;
   position: relative !important;
   position: relative;
   background: transparent !important;
   transition: transform 0.2s;
}
 
.force-glow, .force-glow span {
  text-shadow: 0 0 5px currentColor, 0 0 10px currentColor !important;
}
 
.force-shadow, .force-shadow span {
  text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.5) !important;
}
 
.force-bold, .force-bold span {
  font-weight: bold !important;
}
 
.force-italic, .force-italic span {
  font-style: italic !important;
}
 
/* 3. Standard Animation Styles */
.wavy span {
  animation: wave 3s ease-in-out infinite !important;  
}
}


/* Effect Triggers */
.wavy span { animation: wavy-move 2.5s ease-in-out infinite; }
.rainbow span {  
.rainbow span {  
   animation: hue-cycle 3s linear infinite !important;  
   animation: rainbow-cycle 3s linear infinite;  
  color: #ff4d4d; /* Base red for hue-rotate to work */
}
}
 
.jolt span {
.wavy.rainbow span {
   animation: jolt-shake 0.15s linear infinite;
   animation: wave 2.5s ease-in-out infinite, hue-cycle 3s linear infinite !important;
  display: inline-block;
}
}


/* 4. Full Override Styles (MediaWiki Reset Fix) */
/* Utility Classes */
@media (prefers-reduced-motion: reduce) {
.force-glow { text-shadow: 0 0 8px currentColor; }
  html body .wavy span,
.force-shadow { text-shadow: 2px 2px 4px rgba(0,0,0,0.3); }
  html body .rainbow span,
.force-bold { font-weight: bold; }
  html body .wavy.rainbow span {  
.force-italic { font-style: italic; }
    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: 3s !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: 2.5s, 3s !important;
  }
}

Revision as of 19:08, 17 March 2026

/* Keyframes */
@keyframes wavy-move {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); } 
}

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

/* New Jolt/Wiggle Keyframes */
@keyframes jolt-shake {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(1px, -1px); }
  50%  { transform: translate(-1px, 1px); }
  75%  { transform: translate(1px, 1px); }
  100% { transform: translate(0, 0); }
}

/* Container & Spans */
.text-animation-container {
  display: inline-block;
  white-space: pre-wrap; /* Maintains spacing */
}

.text-animation-container span {
  display: inline-block;
  position: relative;
  transition: transform 0.2s;
}

/* Effect Triggers */
.wavy span { animation: wavy-move 2.5s ease-in-out infinite; }
.rainbow span { 
  animation: rainbow-cycle 3s linear infinite; 
  color: #ff4d4d; /* Base red for hue-rotate to work */
}
.jolt span {
  animation: jolt-shake 0.15s linear infinite;
  display: inline-block;
}

/* Utility Classes */
.force-glow { text-shadow: 0 0 8px currentColor; }
.force-shadow { text-shadow: 2px 2px 4px rgba(0,0,0,0.3); }
.force-bold { font-weight: bold; }
.force-italic { font-style: italic; }