Jump to content

Template:TextAnimations/styles.css: Difference between revisions

From FC1
No edit summary
No edit summary
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* 1. Base Keyframes - Shallow 2px lift */
/* 1. Keyframes */
@keyframes wave {
@keyframes wave {
   0%, 100% { top: 0; }
   0%, 100% { top: 0; }
Line 10: Line 10:
}
}


/* 2. Formatting & Container Styles */
/* Linear Pulse - Ramps up and down evenly */
.text-animation-container {
@keyframes linear-pulse {
   display: inline !important;
   0%, 100% {
  white-space: nowrap;
    opacity: 0.3;  
   padding: 2px 4px;
    filter: brightness(0.8);  
  border-radius: 3px;
   }
  50% {
    opacity: 1;  
    filter: brightness(1.2);  
  }
}
}


.text-animation-container span {
/* Three distinct "shiver" paths to ensure variety */
   display: inline-block !important;
@keyframes jolt-a {
   position: relative !important;
  0%, 100% { transform: translate(0, 0); }
   background: transparent !important;
  25%      { transform: translate(-0.3px, -0.5px); }
  75%      { transform: translate(0.2px, 0.4px); }
}
@keyframes jolt-b {
   0%, 100% { transform: translate(0, 0); }
   25%      { transform: translate(0.3px, 0.5px); }
   75%      { transform: translate(-0.2px, -0.4px); }
}
}
 
@keyframes jolt-c {
.force-glow, .force-glow span {
  0%, 100% { transform: translate(0, 0); }
   text-shadow: 0 0 5px currentColor, 0 0 10px currentColor !important;
   25%      { transform: translate(-0.2px, 0.5px); }
  75%      { transform: translate(0.3px, -0.5px); }
}
}


.force-shadow, .force-shadow span {
/* Helper classes assigned by JS */
  text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.5) !important;
.jolt-v1 { animation: jolt-a 0.35s linear infinite !important; }
}
.jolt-v2 { animation: jolt-b 0.35s linear infinite !important; }
.jolt-v3 { animation: jolt-c 0.35s linear infinite !important; }


.force-bold, .force-bold span {
/* 2. Container & Spans - Vital for MediaWiki */
   font-weight: bold !important;
.text-animation-container {
   display: inline-block !important;
  white-space: pre !important;  
}
}


.force-italic, .force-italic span {
.text-animation-container span {
   font-style: italic !important;
   display: inline-block !important;
  position: relative !important;
  background: transparent !important;
}
}


/* 3. Standard Animation Styles */
/* 3. The Effects */
.wavy span {  
.wavy span   { animation: wave 2.5s ease-in-out infinite !important; }
  animation: wave 3s ease-in-out infinite !important;  
.rainbow span { animation: hue-cycle 3s linear infinite !important; color: #ff0000 !important; }
.text-animation-container.pulse {
  animation: linear-pulse 3s linear infinite !important;
  display: inline-block !important;
}
}
 
.jolt span {
.rainbow span {  
   display: inline-block !important;
   animation: hue-cycle 3s linear infinite !important;  
  margin: 0 0.1px !important;
}
}


.wavy.rainbow span {
/* Combined Effects */
  animation: wave 2.5s ease-in-out infinite, hue-cycle 3s linear infinite !important;
.wavy.rainbow span { animation: wave 2.5s ease-in-out infinite, hue-cycle 3s linear infinite !important; }
}


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

Latest revision as of 22:31, 17 March 2026

/* 1. Keyframes */
@keyframes wave {
  0%, 100% { top: 0; }
  50%      { top: -2px; } 
}

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

/* Linear Pulse - Ramps up and down evenly */
@keyframes linear-pulse {
  0%, 100% { 
    opacity: 0.3; 
    filter: brightness(0.8); 
  }
  50% { 
    opacity: 1;   
    filter: brightness(1.2); 
  }
}

/* Three distinct "shiver" paths to ensure variety */
@keyframes jolt-a {
  0%, 100% { transform: translate(0, 0); }
  25%      { transform: translate(-0.3px, -0.5px); }
  75%      { transform: translate(0.2px, 0.4px); }
}
@keyframes jolt-b {
  0%, 100% { transform: translate(0, 0); }
  25%      { transform: translate(0.3px, 0.5px); }
  75%      { transform: translate(-0.2px, -0.4px); }
}
@keyframes jolt-c {
  0%, 100% { transform: translate(0, 0); }
  25%      { transform: translate(-0.2px, 0.5px); }
  75%      { transform: translate(0.3px, -0.5px); }
}

/* Helper classes assigned by JS */
.jolt-v1 { animation: jolt-a 0.35s linear infinite !important; }
.jolt-v2 { animation: jolt-b 0.35s linear infinite !important; }
.jolt-v3 { animation: jolt-c 0.35s linear infinite !important; }

/* 2. Container & Spans - Vital for MediaWiki */
.text-animation-container {
  display: inline-block !important;
  white-space: pre !important; 
}

.text-animation-container span {
  display: inline-block !important;
  position: relative !important;
  background: transparent !important;
}

/* 3. The Effects */
.wavy span    { animation: wave 2.5s ease-in-out infinite !important; }
.rainbow span { animation: hue-cycle 3s linear infinite !important; color: #ff0000 !important; }
.text-animation-container.pulse {
  animation: linear-pulse 3s linear infinite !important;
  display: inline-block !important;
}
.jolt span {
  display: inline-block !important;
  margin: 0 0.1px !important;
}

/* Combined Effects */
.wavy.rainbow span { animation: wave 2.5s ease-in-out infinite, hue-cycle 3s linear infinite !important; }

/* 4. Formatting Utilities */
.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; }