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

lit-particles

v0.0.3

Published

A webcomponent that creates a nice paritcle effect on a canvas

Downloads

1

Readme

npm version

<lit-particles>

This webcomponent follows the open-wc recommendation.

Installation

npm i lit-particles

Usage

in index.html

  <lit-particles options='{
    "maxParticles": 200,
    <desired options>
  }'></lit-particles>

  <script type="module">
    import 'lit-particles/lit-particles.js';
  </script>
NOTE: when using an attribute the value in options should be in proper json format

in lit-elements component

  import { html, LitElement } from 'lit-element';
  import 'lit-particles/lit-particles.js';

  const options = {
    maxParticles: 200,
    color: ["#FF0000", "#00FF00", "#0000FF"]
  }

  class ExampleComponent extends LitElement {
    render() {
      return html`
        <lit-particles .options="${options}"></lit-particles>
      `;
    }
  }
NOTE: when passing an object directly into the options property a '.' should be appendend to the attribute.

other frameworks

Importing the following should register the custom component.

import 'lit-particles/lit-particles.js;

Afterward, you should be able to use it by using the custom tags.

<lit-particles></lit-paritcles>

The options can either be handled with the data-binding method of the framework or by using attributes.
For more information about properties and attributes read this.

Configuration

const defaultOptions = {
  // The amount of particles {Number}
  maxParticles: 150,
  // The size of the particles {Number}
  size: 2,
  // Whether to draw the particles on the canvas {Boolean}
  showParticles: true,
  // The speed with which the particles move {Number}
  speed: 1,
  // The color(s) of the particles {Array.<String>, String}
  // This can either be a single color, or an array of colors
  color: '#000000',
  // The minimum distance particles should be from eachother before a line between them is created {Number}
  minDistance: 120,
  // Whether the particles will be connected with lines
  connectParticles: true,
};

Local Demo with es-dev-server

npm start

To run a local development server that serves the basic demo located in demo/index.html

Linting with ESLint, Prettier, and Types

To scan the project for linting errors, run

npm run lint

You can lint with ESLint and Prettier individually as well

npm run lint:eslint
npm run lint:prettier

To automatically fix many linting errors, run

npm run format

You can format using ESLint and Prettier individually as well

npm run format:eslint
npm run format:prettier