Difference between revisions of "Widget:Logo"

From Hackerspace ACKspace
Jump to: navigation, search
(yes yes!)
(preparation of automated winter/holiday theme)
Line 236: Line 236:
 
         // All test cases valid, return the resulting flake
 
         // All test cases valid, return the resulting flake
 
         return newFlake;
 
         return newFlake;
 +
    }
 +
 +
    function is_winter()
 +
    {
 +
        return (new Date( "1 april " + (new Date() ).getFullYear() )).valueOf() > Date.now() || (new Date( "1 december " + (new Date() ).getFullYear() )).valueOf() < Date.now();
 +
    }
 +
 +
    function is_winter_holiday()
 +
    {
 +
        return (new Date( "7 january " + (new Date() ).getFullYear() )).valueOf() > Date.now() || (new Date( "7 december " + (new Date() ).getFullYear() )).valueOf() < Date.now();
 
     }
 
     }
  
 
     function window_load()
 
     function window_load()
 
     {
 
     {
 +
        console && console.log( "winter:", is_winter() );
 +
        console && console.log( "winter holiday:", is_winter_holiday() );
 +
 
         var logo = document.getElementById( "logo" );
 
         var logo = document.getElementById( "logo" );
 
         ctx = logo.getContext("2d");
 
         ctx = logo.getContext("2d");

Revision as of 18:49, 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.