Вход Регистрация
Файл: public/js/ips.misc.js
Строк: 128
<?php
/************************************************/
/* IPB3 Javascript                                */
/* -------------------------------------------- */
/* easeter.js - Easter Eggs Shhhh                */
/* (c) IPS, Inc 2008                            */
/* -------------------------------------------- */
/* Author: Brandon Farber                        */
/************************************************/

var _easter window.IPBoard;
var 
timer;
var 
comet;

_easter.prototype.easter = {
    
snowFlakesCount:    35,
    
    
snowFlakesColors:    new Array("#AAAACC","#DDDDFF","#CCCCDD","#F3F3F3","#F0FFFF"),
    
    
snowFlakesTypes:    new Array("Arial Black","Arial Narrow","Times","Comic Sans MS"),
    
    
snowFlakesMaxSize:    22,
    
snowFlakesMinSize:    8,
    
    
cometColors:        new Array('#ff0000','#00ff00','#ffffff','#ff00ff','#ffa500','#ffff00','#00ff00','#ffffff','ff00ff'),
    
    
/**    No more config **/
    
    
snow:                new Array(),
    
coordinates:        new Array(),
    
positions:            new Array(),
    
movements:            new Array(),
    
browserWidth:        document.viewport.getWidth(),
    
browserHeight:        document.viewport.getHeight(),
    
mouseX:                0,
    
mouseY:                0,
    
    
/** Random number generator **/
    
getRandomNumber:    function(range)
    {
        return 
Math.floorrange Math.random() );
    },
    
    
/** Initialization **/
    
init:                function()
    {
        
document.observe("dom:loaded", function(){
            
/** Snowflakes **/
            
var snowsizerange ipb.easter.snowFlakesMaxSize ipb.easter.snowFlakesMinSize;

            for ( 
i=0i<=ipb.easter.snowFlakesCounti++ ) 
            {
                var 
blah = new Element'span', { id"s" } ).update'*' );
                
blah.absolutize();
                $$(
'body')[0].insert( { topblah } );
                
                
ipb.easter.coordinates[i]        = 0;                      
                
ipb.easter.positions[i]            = Math.random()*15;
                
ipb.easter.movements[i]            = 0.03 Math.random()/10;
    
                $( 
"s" ).setStyle( { fontFamilyipb.easter.snowFlakesTypesipb.easter.getRandomNumber(ipb.easter.snowFlakesTypes.length) ] } );
                $( 
"s" ).size                ipb.easter.getRandomNumber(snowsizerange) + ipb.easter.snowFlakesMinSize;
                $( 
"s" ).setStyle( { fontSize: $( "s" ).size } );
                $( 
"s" ).setStyle( { coloripb.easter.snowFlakesColorsipb.easter.getRandomNumber(ipb.easter.snowFlakesColors.length) ] } );
                $( 
"s" ).sink                .6 * $( "s" ).size/5;
                $( 
"s" ).posx                ipb.easter.getRandomNumberipb.easter.browserWidth - $( "s" ).size );
                $( 
"s" ).posy                ipb.easter.getRandomNumberipb.easter.browserHeight ipb.easter.browserHeight * $( "s" ).size );
                $( 
"s" ).setStyle( { left: $( "s" ).posx 'px' } );
                $( 
"s" ).setStyle( { top: $( "s" ).posy 'px' } );
            }
            
            
ipb.easter.moveSnow();
            
            
/** Comet Trail **/
            
for (010i++ )
            {
                var 
blah = new Element'div', { id"dots" } );
                
blah.absolutize();
                
blah.setStyle(
                    {
                        
position'absolute',
                        
top'0px',
                        
left'0px',
                        
widthi/'px',
                        
heighti/'px',
                        
background'#ff0000',
                        
fontSizei/2
                    
}
                );

                $$(
'body')[0].insert( { bottomblah } );
            }
            
            
Event.observedocument"mousemove"ipb.easter.captureMouse );
            
ipb.easter.mouseTrail();
            
            $(
'branding').update"<img src='admin/skin_cp/images/const.gif'> <marquee width='70%'><blink><FONT size=9>В разработке</FONT></blink></marquee>" );
        });
    },

    
/** Move snow **/
    
moveSnow:            function()
    {
        for ( 
i=0<= ipb.easter.snowFlakesCounti++ )
        {
            
ipb.easter.coordinates[i]        += ipb.easter.movements[i];
            $( 
"s" ).posy        += $( "s" ).sink;

            $( 
"s" ).setStyle( { leftMath.floor($( "s" ).posx ipb.easter.positions[i] * Math.sinipb.easter.coordinates[i] )) + 'px' } );
            $( 
"s" ).setStyle( { top:  Math.floor($( "s" ).posy) + 'px' } );

            if ( $( 
"s" ).posy >= ipb.easter.browserHeight * $( "s" ).size || 
                    
parseInt($( "s" ).style.left) > ( ipb.easter.browserHeight ipb.easter.positions[i] ) )
            {
                $( 
"s" ).posx    ipb.easter.getRandomNumberipb.easter.browserWidth - $( "s" ).size );
                $( 
"s" ).posy    0;
            }
        }

        
timer setTimeout"ipb.easter.moveSnow()"50 );
    },

    
captureMouse:        function(e)
    {
        
ipb.easter.mouseX    Event.pointerX(e);
        
ipb.easter.mouseY    Event.pointerY(e);
    },

    
mouseTrail:            function()
    {
        for ( 
010i++ )
        {
            var 
randcolours    ipb.easter.cometColorsipb.easter.getRandomNumberipb.easter.cometColors.length ) ];
            $( 
"dots" ).setStyle( { backgroundrandcolours } );

            if (
9)
            {
                $( 
"dots" ).setStyle( { topparseInt($( "dots" + (i+1) ).getStyle('top') ) + 'px' } );
                $( 
"dots" ).setStyle( { leftparseInt($( "dots" + (i+1) ).getStyle('left') ) + 'px' } );
            } 
            else
            {
                $( 
"dots" ).setStyle( { topipb.easter.mouseY 'px' } );
                $( 
"dots" ).setStyle( { leftipb.easter.mouseX 'px' } );
            }
        }
        
        
comet setTimeout"ipb.easter.mouseTrail()"10 );
    }
};

ipb.easter.init();
?>
Онлайн: 1
Реклама