npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

snow-fall-effect

v1.3.8

Published

snowfall effect script for website

Downloads

421

Readme

Snow Fall Effect

It provides a realistic snowfall effect to your site to make your websites look more aesthetic during the winter months.

Demo: https://www.iksirsi.com/

Installation

Vue
import SnowFall from "snow-fall-effect"
export default {
  data() {
    return {
      msg: 'foo'
    }
  }
  mounted() {
    const snowFall = new SnowFall();
    snowFall.init();
  }
}
Nuxt

snow-fall.plugin.js

import SnowFall from "snow-fall-effect";

export default ({ app }, inject) => {
  inject(
    "snowFall",
    (() => {
      const snowFall = new SnowFall({
        color: "#82deed",
        density: 1,
        sizeRange: [5, 25],
      });
      return snowFall;
    })()
  );
};

nuxt.config.js

  // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  plugins: [{ src: '~/plugins/snow-fall.plugin.js', mode: 'client' }],

layout.vue

export default {
  name: "layout.vue",
  data() {
    return {
    }
  }
  mounted() {
    this.$snowFall.init();
  },
  destroyed() {
    // For performance
    this.$snowFall.stopTheSnowing()
  },
}
React
import { useEffect } from "react";
import SnowFall from "snow-fall-effect";
function App() {
  useEffect(() => {
    const snowFall = new SnowFall();
    snowFall.init();
    return () => {
      snowFall.stopTheSnowing()
    };
  }, []);
  return <div className="App"></div>;
}

export default App;
HTML File

Imports into html are not supported. :(

Configuration

Types
{
  sizeRange: [number, number],
  color: string,
  speed: number,
  density: number;
}
new SnowFall({
  sizeRange: [10, 20], // default (min 0)
  color: "#fff", // default
  speed: 10, // default (second)
  density: 0.5; // default (recomended)
});
Declare
SnowFall {
    config: ConfigType;
    interval: ReturnType<typeof setInterval>;
    constructor(_config: ConfigType);
    get cordinate(): {
        left: number;
        top: number;
    };
    get width(): number;
    get icon(): string;
    get globalStyle(): string;
    injectGlobalCSS: () => void;
    get styles(): {
        svg: string;
        subContainer: string;
    };
    createContainer: () => void;
    get container(): HTMLDivElement;
    remove: (id: string) => void;
    createSubContainer: () => HTMLElement;
    createSnow: () => void;
    snowingInterval: () => void;
    makeItSnow: () => void;
    init: () => void;
    clear: () => void;
    stopTheSnowing: () => void;
}

Coded by ahmetilhan