Difference between revisions of "Widget:Logo"

From Hackerspace ACKspace
Jump to: navigation, search
(preparation of automated winter/holiday theme)
(added auto-season functionality)
Line 125: Line 125:
 
             }
 
             }
  
             // Draw all tree lights
+
             // Draw all tree lights (only during holiday season
             for ( var t = 0; t < treeLights.length; t++ )
+
            if ( is_winter_holiday() )
                drawTreeLight( treeLights[t], false );
+
             {
 +
                for ( var t = 0; t < treeLights.length; t++ )
 +
                    drawTreeLight( treeLights[t], false );
 +
            }
  
 
             // Draw the glowing ACK bit
 
             // Draw the glowing ACK bit
Line 143: Line 146:
 
             // Draw all tree lights overlay: either on or off
 
             // Draw all tree lights overlay: either on or off
 
             ctx.shadowBlur = 0;
 
             ctx.shadowBlur = 0;
             for ( var t = 0; t < treeLights.length; t++ )
+
             // Draw all tree lights (only during holiday season
                drawTreeLight( treeLights[t], true );
+
            if ( is_winter_holiday() )
 +
            {
 +
                for ( var t = 0; t < treeLights.length; t++ )
 +
                    drawTreeLight( treeLights[t], true );
 +
            }
 
         }
 
         }
  
Line 260: Line 267:
 
         height = logo.height;
 
         height = logo.height;
 
         dynamicImage = ctx.getImageData( 0, 0, width, height );
 
         dynamicImage = ctx.getImageData( 0, 0, width, height );
         window.requestAnimationFrame( snowFall );
+
         if ( is_winter() )
        setInterval( blink, 1500 );
+
        {
 +
            window.requestAnimationFrame( snowFall );
 +
            setInterval( blink, 1500 );
 +
        }
 
     }
 
     }
  

Revision as of 17:58, 4 January 2016

This widget creates an animated themed ACKspace logo.

Created by xopr

Using this widget

To insert this widget, use the following code:

{{#widget:Logo
|image=https://ackspace.nl/w/images/e/e9/ACKsmass_logo.png
|width=600px
|height=200px
|padding=8px
|float=right
}}

This will give the following result:

Note that image is mandatory, the rest is optional. Also, you must provide a unit for the sizes (i.e. px, %, etc.)

Copy to your site

To use this widget on your site, just install MediaWiki Widgets extension and copy full source code of this page to your wiki as Widget:Logo article.