vB3 Fireworks Display

  • Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Radio

    ven0m

    Administrator
    Staff member
    Administrator
    Moderator
    Platinum
    xenForo 2.x.x
    xenForo 1.x.x
    Contributor
    vBulletin All Access Pass
    The Chest
    Verified
    Ultra Platinum VIP
    Platinum VIP
    Gold VIP
    Silver VIP
    Premium
    Member
    Jul 17, 2005
    20,503
    7,742
    321
    localhost
    Heisenberg submitted a new resource:

    - Fireworks Display

    vB Version: 3.8.x

    Want to put on a show for your members on the 4th of July or any other holiday? Then this modification is for you! It will display a fireworks show on the FORUMHOME.

    This is a port of my 3.7 modification.

     
    Last edited:

    ven0m

    Administrator
    Staff member
    Administrator
    Moderator
    Platinum
    xenForo 2.x.x
    xenForo 1.x.x
    Contributor
    vBulletin All Access Pass
    The Chest
    Verified
    Ultra Platinum VIP
    Platinum VIP
    Gold VIP
    Silver VIP
    Premium
    Member
    Jul 17, 2005
    20,503
    7,742
    321
    localhost
    You can change the size, just open vbulletin_fireworks.js and replace the red number (pretty much all of the number 1s) in the following code with how big you would like it. Keep in mind that the bigger it is, the more they become squares. They are pixels after all and pixels are squares.

    Code:
    if  ((document.getElementById) && 
    window.addEventListener || window.attachEvent){
    
    (function(){
    
    var showerCol = new Array('#000000','#ff0000','#000000','#00ff00','#ff00ff','#ffffff','#ffa500','#000000','#fff000');
    var launchCol = new Array('#ffa500','#00ff00','#ffaaff','#fff000','#ffffff');
    var launchColour = "#00ff00";
    var rs = 30; 
    var y = 200;
    var x = 200;
    var h;
    var w;
    var xs = 190;
    var t = null;
    var ss = [COLOR=Red]1[/COLOR];
    var e = 360/14;
    var f = new Array();
    var c1 = -1;
    var c2 = 5;
    var r;
    
    var pix = "px";
    
    var strictmod = ((document.compatMode) && 
    document.compatMode.indexOf("CSS") != -1);
    
    var o;
    var domWw = (typeof window.innerWidth == "number");
    var domSy = (typeof window.pageYOffset == "number");
    var n = 14;
    var idx = [COLOR=Red]1[/COLOR];
    
    
    for (i = 0; i < n; i++){
     if ( document.getElementById(idx+i) ){ 
     idx = (idx+=(n));
     }
    }
    
    
    for (i = 0; i < n; i++){
    document.write('<div id='+(idx+i)+' style="position:absolute;top:0px;left:0px;'
    +'height:[COLOR=Red]1[/COLOR]px;width:[COLOR=Red]1[/COLOR]px;font-size:[COLOR=Red]1[/COLOR]px;background-color:'+launchColour+'"><\/div>');
    }
    
    
    if (domWw) r = window;
    else{ 
      if (document.documentElement && 
      typeof document.documentElement.clientWidth == "number" && 
      document.documentElement.clientWidth != 0)
      r = document.documentElement;
     else{ 
      if (document.body && 
      typeof document.body.clientWidth == "number")
      r = document.body;
     }
    }
    
    
    function scrl(yx){
    var y,x;
    if (domSy){
     y = r.pageYOffset;
     x = r.pageXOffset;
     }
    else{
     y = r.scrollTop;
     x = r.scrollLeft;
     }
    return (yx == 0)?y:x;
    }
    
    
    function wndwsz(){
    if (domWw){
      h = r.innerHeight; 
      w = r.innerWidth;
     }
     else{
      h = r.clientHeight; 
      w = r.clientWidth;
     }
    o = (w >= h)?h:w;
    }
    
    
    function rst(){
    c1 = 0;
    launchColour = launchCol[Math.floor(Math.random() * launchCol.length)];
    xs = Math.round(100+Math.random() * (o/4));
    y = xs + Math.round(Math.random() * (h-(xs*2.2))) + scrl(0);
    x = xs + Math.round(Math.random() * (w-(xs*2.2))) + scrl(1);
    ss = [COLOR=Red]1[/COLOR];
    for (i=0; i < n; i++){
     f[i].backgroundColor = launchColour;
     f[i].width = ss + pix;
     f[i].height = ss + pix;
     f[i].fontSize = ss + pix;
    }
    dsply();
    }
    
    
    function dsply(){
    c1 += c2;
    t = setTimeout(dsply,rs);
    for (i  =0; i < n; i++){
    f[i].top = y + xs * Math.sin(i*e*Math.PI/180) * Math.sin(c1/100) + pix;
    f[i].left= x + xs * Math.cos(i*e*Math.PI/180) * Math.sin(c1/100) + pix;
     if (c1 > 100){
     ss = (xs < 150)?[COLOR=Red]1[/COLOR]:Math.round([COLOR=Red]1[/COLOR]+Math.random()*2);
     f[i].backgroundColor = showerCol[Math.floor(Math.random()*showerCol.length)];
     f[i].width = ss + pix;
     f[i].height = ss + pix;
     f[i].fontSize = ss + pix;
     }
    }
    if (c1 > 160){
     clearTimeout(t);
     rst();
    }
    }
    
    
    function init(){
    wndwsz();
    for (i = 0; i < n; i++){
    f[i] = document.getElementById(idx+i).style;
    }
    var strt = Math.floor(500+Math.random()*2000);
    setTimeout(dsply,strt);
    }
    
    
    if (window.addEventListener){
     window.addEventListener("resize",wndwsz,false);
     window.addEventListener("load",init,false);
    }  
    else if (window.attachEvent){
     window.attachEvent("onresize",wndwsz);
     window.attachEvent("onload",init);
    } 
    
    })();
    }
     
    Thread starter Similar threads Forum Replies Date
    ven0m vB3 Display Post Count as Roman Numerals [3.8.x] Addons 0
    ven0m vB3 Display VBAdvanced pages in Who's Online [3.8.x] Addons 0
    ven0m vB3 best forum display avatar [3.8.x] Addons 0
    ven0m vB3 Agth ~ vBullletin Postbit Browser Display [3.8.x] Addons 0
    ven0m vB3 Display Online Users Count Everywhere [3.8.x] Addons 0
    ven0m vB3 Display Random Posts [3.8.x] Addons 0
    ven0m vB3 Media Block for DnP Instant! Musicbox - Display the fun media list anywhere ! [3.8.x] Addons 0
    ven0m vB3 Forum Display - Last Post By [Private to Guests] [3.8.x] Addons 0
    ven0m vB3 Affiliation Display [3.8.x] Addons 0
    ven0m vB3 Display Reputation Comments on Members Profile Page [3.8.x] Addons 0
    ven0m vB3 Display Reputation Comments Given [3.8.x] Addons 0
    ven0m vB3 STEAM Profile/Status Display [3.8.x] Addons 0
    ven0m vB3 Display OS and Browser Information on Postbit [3.8.x] Addons 0
    ven0m vB3 Alternate Last Post Display [3.8.x] Addons 0
    ven0m vB3 Display Unread Posts and New Reputation Comments [3.8.x] Addons 1
    ven0m vB3 Extended Reputation Display [3.8.x] Addons 0
    ven0m vB3 Social Connect - 35 Social Network Icons to Display [3.8.x] Addons 0
    ven0m vB3 [i4D] Changing Forums Display in Forumhome ! [3.8.x] Addons 0
    ven0m vB3 Language Specific Forum Display [3.8.x] Addons 0
    ven0m vB3 Better ACP Tag Manager (search for tags, display x tags in x cols) [3.8.x] Addons 0