Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • SnowFlake

Index

Constructors

Properties

Methods

Constructors

constructor

  • Parameters

    • options: SnowFlakeConfig = ...

      pass configuration param to tweek each flake individually

      const red_flake = new SnowFlake({color: 'red'})
      const yellow_flake = new SnowFlake({color:'yellow'})
      
      red_flake.animate()
      yellow_flake.animate()
      

      will make two flakes one red and one yellow

    Returns SnowFlake

Properties

config

configuration object for configuring the diffrect aspects of each snowflake

Methods

animate

  • animate(): void

restart

  • restart(): void
  • resets the flake to the inital position and restart the animation

    Returns void

setColor

  • setColor(color?: string): void
  • Parameters

    • Optional color: string

      set the color for each inidividual spec

      setColor('red')
      setColor('#ff0000')
      setColor('rgb(255,0,0)')
      

    Returns void

Static cloneElement

  • cloneElement(): Document
  • Creates new clone of the snowflake svg element

    Returns Document

Static config

  • call this and set configurations you need to apply to all snowflakes eg:-

    SnowFlake.config({color: white})
    

    will set all snowflakes to white

    you can pass any params thats defined in the SnowFlakeConfig

    Parameters

    Returns void

Generated using TypeDoc