Skip to content

Configuration

Maingron edited this page Oct 25, 2020 · 1 revision

Snow.js Configuration

snow.js has a configurable configuration. It can be configured within snow.config.

  • snowChars: Defines the characters used as snow. Supports UTF-8 - That means you can paste Emojis into the configuration
  • tickTime: Defines the minimum time between frames in milliseconds. If the user's computer is too slow, each frame will take longer. Values below ~50 also depend on the browser
  • maxSnow: Defines the amount of snowflakes spawned
  • jitterAmount: Defines how jittery the snowflakes are (x-coordinate)
  • gravityAmount: Defines how fast the snowflakes fall down (y-coordinate) initialYSpacing: Defines how far apart the snowflakes are spawned initially. Negative values will spawn into the active viewport, positive values will spawn above the screen
  • topBorder: Defines the top border for snowflakes. They won't go higher than that. Also used to respawn snowflakes when they go below the bottom border
  • bottomBorder: Defines the bottom border for snowflakes. They won't go lower than that. Also used to respawn snowflakes to the top border when they hit the bottom border
  • snowSizes: Defines the possible font size for each individual snowflake
  • snowColors: Defines the possible font color for each individual snowflake
  • snowFont: Defines the font used for all snowflakes. Works like in font-family in CSS - If the first font is not available, the second one will be used

Advanced Settings

  • snowContainer: Container in which snowflakes will be spawned - Recommended value: document.body
  • cssTransition: Applies a CSS transition to snowflakes - Recommended value: 0
  • autoFixScriptTag: Makes sure that snow.js is included correctly on the website. If true, make sure that the snow.js file is called snow.js or snow.min.js. Might not have a big effect - Recommended value: true
  • maxDecimalLength: Defines how precise calculations are. Best to use a low value - Recommended value: 1
  • snowflakeTagName: Defines the html-tag used for each snowflake - Recommended value: i
  • snowflakeClassName: Defines the html-class used for each snowflake - Recommended value: s
Clone this wiki locally