• Resolved lockoloop

    (@lockoloop)


    Hi, I’d like to know if it’s possible to have other colors than white and black? (since I have a green background)
    Something that can manage transparency like rgba or 8-char hex: 003366FF?
    Thank you!

Viewing 1 replies (of 1 total)
  • Thread Starter lockoloop

    (@lockoloop)

    So in case anyone is interested I ended up changing the code so that it changes the opacity instead of the color (that way, the color can be changed in the CSS), replace the FadeIn_Ontimer function in the wp-fade-in-text-news.js file:

    function FadeIn_Ontimer() {
      if (FadeIn_bFadeOutt) {//triggers if text is visible (FadeIn_Fade = 0)
        FadeIn_Fade-=FadeIn_FadeStep; // FadeIn_Fade+=FadeIn_FadeStep; 0 => 255, black to white; 1 => 0, visible to invisible
        if (FadeIn_FadeOut>=FadeIn_Fade) { //if already at 255, then it returns that it's already invisible (because it's white)
          FadeIn_Cursor++;
          if (FadeIn_Cursor>FadeIn_Max)
            FadeIn_Cursor=0;
          FadeIn_SetFadeLink();
          FadeIn_bFadeOutt = false;
        }
      } else {
        FadeIn_Fade+=FadeIn_FadeStep; // FadeIn_Fade-=FadeIn_FadeStep; 255 => 0, white to black
        if (FadeIn_FadeIn<=FadeIn_Fade) { //if already at 0 (and it does start at 0), then it returns that it's already visible (because it's black)
          clearInterval(FadeIn_FadeInterval);
          setTimeout(Faderesume, FadeIn_FadeWait);
          FadeIn_bFadeOutt=true;
        }
      }
      var ilink = document.getElementById("FadeIn_Link");
      if ((FadeIn_Fade>=FadeIn_FadeOut)&&(FadeIn_Fade<=FadeIn_FadeIn))
        ilink.style.opacity = FadeIn_Fade;
    }

    (Then you can also remove the ToHex function, which becomes superfluous)
    While you’re in there, you can also tweak the speed of the fading effect by changing the FadeIn_FadeInterval number to 30 or 50 (the bigger number, the slower the effect).

    Then change the settings in the WordPress interface to:
    FadeOut 0 (minimum value of the range, the opacity is set to 0)
    FadeIn 1 (maximum value of the range, the opacity is set to 1)
    Fade 1 (the text starts completely visible)
    FadeStep: something between 0.01 and 0.1, 0.05 works nicely for me

    Cheers!

Viewing 1 replies (of 1 total)
  • The topic ‘Only from black to white?’ is closed to new replies.