FANDOM


SnowStorm adds animated, customizable, JavaScript snow on a wiki.

Installation

See also: Help:Including additional CSS and JS, Help:Advanced CSS and JS
  • For site-wide use, an administrator can add the line below to the wiki's MediaWiki:ImportJS page. Note that JavaScript must be enabled on the wiki.
dev:SnowStorm.js

Configuration

The script can be used as it is, but it does also support these customizable variables that can be added before the import on Common.js. Common.js will run before MediaWiki:ImportJS.

Using configuration options with Fandom Open Source Library scripts
The instructions on this page describe how to use configuration options with a script. Here on the Fandom Open Source Library, many scripts provide optional configuration settings as a mean to alter or enhance the default behavior of the script. When installing configuration options in your JavaScript file, please note that they need to go above the import statement in order to work — unless the directions say otherwise. In case MediaWiki:ImportJS is used to load the scripts, it will be executed last.
Configuration options load too late, don't work
Proper placement of configuration options
// 1. AjaxRC import statement
importScriptPage('AjaxRC/code.js','dev');
 
// 2. AjaxRC configuration option
var ajaxRefresh = 30000;
// 1. AjaxRC configuration option
var ajaxRefresh = 30000;
 
// 2. AjaxRC import statement
importScriptPage('AjaxRC/code.js','dev');


Variable Description Default value Type
autoStart Whether the snow should start automatically or not. true boolean
snowCfg_onlyOasis Whether should be run only in Oasis or not. true boolean
excludeMobile Snow is likely to be bad news for mobile phones' CPUs (and batteries.) Enable at your own risk. true boolean
flakesMax Limit total amount of snow made (falling + sticking). 128 number
flakesMaxActive Limit amount of snow falling at once (less = lower CPU use). 64 number
animationInterval Theoretical "milliseconds per frame" measurement. 20 = fast + smooth, but high CPU use. 50 = more conservative, but slower. 35 number
useGPU Enable transform-based hardware acceleration, reduce CPU load. true boolean
className CSS class name for further customization on snow elements. null string
flakeBottom Integer for Y axis snow limit, 0 or null for "full-screen" snow effect. null number
followMouse Snow movement can respond to the user's mouse. true boolean
snowColor Snow color. #fff string
snowCharacter Character to use as snowflake. • () string
snowStick Whether or not snow should "stick" at the bottom. When off, will never collect. true boolean
targetElement Element which snow will be appended to (null = document.body) - can be an element ID eg. 'myDiv', or a DOM node reference. null string
useMeltEffect When recycling fallen snow (or rarely, when falling), have it "melt" and fade out if browser supports it. true boolean
useTwinkleEffect Allow snow to randomly "flicker" in and out of view while falling. false boolean
usePositionFixed true = snow does not shift vertically when scrolling. May increase CPU load, if enabled, used only where supported. false boolean
usePixelPosition Whether to use pixel values for snow top/left vs. percentages. Auto-enabled if body is position:relative or targetElement is specified. false boolean
Less used
freezeOnBlur Only snow when the window is in focus (foreground.) Saves CPU. Note: if the snow randomly speeds up after some time while changing tab focus (especially on Chrome), turning this off should solve the problem. true boolean
flakeLeftOffset Left margin/gutter space on edge of container (eg. browser window.) Bump up these values if seeing horizontal scrollbars. 0 number
flakeWidth Max pixel width reserved for snow element. 8 number
flakeHeight Max pixel height reserved for snow element. 8 number
vMaxX Defines maximum X velocity for the storm; a random value in this range is selected for each snowflake. 5 number
vMaxY Defines maximum Y velocity for the storm; a random value in this range is selected for each snowflake. 4 number
zIndex CSS stacking order applied to each snowflake. 1 number
windOffset 1 number
windMultiplier 2 number
flakeTypes 6 number

Changelog

Date Notes Updated by
December 1st, 2012 First version XD1
May 13th, 2016 Added Rappy 4187
December 2nd, 2016 1) previously you could not set "false" or "null" custom values 2) added "onlyoasis" option 3) made available extra customizations leviathan 89

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.