Results 1 to 6 of 6

Thread: nice effect for your background

  1. #1
    Join Date
    Aug 2005
    Posts
    7

    Default nice effect for your background

    Nice Background Effect

    preview: http://planet.nana.co.il/thbanda/lala2.htm

    *requirements: basic knowlagde on html so u can change the stats i set to your will

    this goes on head
    Code:
    <script>
    function initArray() {
    
      this.length = initArray.arguments.length
    
      for (var i = 0; i < this.length; i++)
    
        this[i+1] = initArray.arguments[i]
    
    }
    
    
    
    var hexChars = "0123456789ABCDEF";
    
    
    
    function Dec2Hex (Dec) {
    
      var a = Dec % 16;
    
      var b = (Dec - a)/16;
    
      hex = "" + hexChars.charAt(b) + hexChars.charAt(a);
    
      return hex;
    
    }
    
    
    
    function bgChanger (begin, end, steps) {
    
      steps = steps -1 ;
    
    
    
      redA     = begin.charAt(0) + begin.charAt(1);
    
      red_valA = parseInt(redA,'16');
    
      redB     = end.charAt(0) + end.charAt(1);
    
      red_valB = parseInt(redB,'16');
    
      red_int  = ((red_valB - red_valA) / steps) * -1;
    
      grnA     = begin.charAt(2) + begin.charAt(3);
    
      grn_valA = parseInt(grnA,'16');
    
      grnB     = end.charAt(2) + end.charAt(3);
    
      grn_valB = parseInt(grnB,'16');
    
      grn_int  = ((grn_valB - grn_valA) / steps) * -1;
    
      bluA     = begin.charAt(4) + begin.charAt(5);
    
      blu_valA = parseInt(bluA,'16');
    
      bluB     = end.charAt(4) + end.charAt(5);
    
      blu_valB = parseInt(bluB,'16');
    
      blu_int  = ((blu_valB - blu_valA) / steps) * -1;
    
    
    
      step = 2;
    
      red = red_valA;
    
      grn = grn_valA;
    
      blu = blu_valA;
    
    
    
      document.bgColor = begin;
    
    
    
      while ( steps >= step ) {
    
        red -= red_int;
    
        red_round = Math.round(red);
    
        red_hex = Dec2Hex(red);
    
    
    
        grn -= grn_int;
    
        grn_round = Math.round(grn);
    
        grn_hex = Dec2Hex(grn);
    
    
    
        blu -= blu_int;
    
        blu_round = Math.round(blu);
    
        blu_hex = Dec2Hex(blu);
    
    
    
        document.bgColor = red_hex + grn_hex + blu_hex;
    
    //    document.write("bgcolor = " + red_hex + grn_hex + blu_hex);
    
    
    
        step++;
    
      }
    
      document.bgColor = end;
    
    }
    
    </script>
    and this on body
    Code:
    <script>
    
    <!--
    
    // black to black (pause)
    
      bgChanger("000000","000000",25);
    
    // black to red
    
      bgChanger("000000","FF0000",25);
    
    // red to black
    
      bgChanger("FF0000","000000",25);
    
    // black to purple
    
      bgChanger("000000","AA00EE",25);
    
    // purple to black
    
      bgChanger("AA00EE","000000",25);
    
    // black to blue
    
      bgChanger("000000","0000FF",25);
    
    // blue to black
    
      bgChanger("0000FF","000000",25);
    
    // black to black (pause)
    
      bgChanger("000000","336699",25);
    
    // -->
    
    </script>

  2. #2
    Join Date
    Aug 2004
    Location
    USA
    Posts
    996

    Default

    Really there is no need for that,but I guess people can play with what fasinates them.

  3. #3
    Join Date
    May 2005
    Posts
    211

    Default

    all I get is a blue screen in URL u mentioned. What are you talking about?

  4. #4
    Join Date
    Sep 2005
    Posts
    2

    Default

    What it does is at the first before you get to the blue page that you see is that it flashes different colors. I would repeat how they go but i get all lost in the colors i think it should have a warning if you do repeded time can cause seizure but that is what it does

    Summer

  5. #5
    Join Date
    May 2005
    Posts
    211

    Default

    OK, but i don't see it useful. A good effort though. The effects are not visible in my computer. I am on a Mac machine on a safari browser. I believe in the fact that, the stuff you have on your web page should be "universally" accessable.

  6. #6
    Join Date
    Sep 2005
    Location
    Not in TURKEY, in RIYADH
    Posts
    115

    Default

    nice effect it glow like a sign or something .. but change the color it hurts the eyes !!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •