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

svg-loader-es6

v1.1.1

Published

SVG Loader Vanilla ES6

Downloads

5

Readme

SVG Loader ES6

A class to create customizable SVG loader with Vanilla ES6.

| NPM GitHub package version npm Npm downloads | Maintenance GitHub last commit Open issues | Build Status Sonar quality gate Code Climate | Greenkeeper badge Dependencies Status DevDependencies Status | | --- | :--- | :---- | :----

| Complexity Cognitive Complexity | Open issues Code smells | Bugs Vulnerabilities | | :--- | :--- | :---- |


Installation

# Yarn
yarn add --exact svg-loader-es6

# NPM
npm install --save --save-exact svg-loader-es6

Usage

Somewhere in your document:

<div id="your-container-id" />

Then in your javascript :

  • Import:
import { SVGLoader } from 'svg-loader-es6';
  • Instantiate:
new SVGLoader( {
  containerId: 'your-container-id'
} )

Settings

The constructor can accept more keys in the object as parameters.

Option | Type | Default | Description ------ | ---- | ------- | ----------- containerId | String | "loader-container" | Required - The id of the element that will contain the SVG element svgId | String | "loader" | The id given to the created SVG element nbRects | int | 3 | Number of rectangle shapes in the SVG margin | int | 2 | Margin between the shapes (in px) fill | String (Hex, RGB, RGBA) | "#000000" | Color of the shapes in the SVG size | int | 15 | Height and width of each shape (rectangle) of the SVG (in px) radius | int | 2 | Value of the border radius of each rectangle shape of the SVG (in px) minOpacity | Number | 0.25 | Opacity to give to each shapes at the begin of the animation maxOpacity | Number | 0.75 | Opacity to give to each shapes at the end of the animation duration | int | 1000 | Duration of the animation of each shape from minOpacity to maxOpacity (in ms)

Properties of an instance

Property | Type | Description -------- | ---- | ----------- settings | Object | The current options of the SVGLoader instance (read-only) defaultOptions | Object | The default options for settings if there's no settings given to the constructor. This is a static method, so call it as follows: SVGLoader.defaultProperties

Methods

Property | Parameters | Default | Description -------- | ---------- | ------- | ----------- toggle | - | - | Hide or show the SVG Element show | - | - | Show the SVG Element hide | - | - | Hide the SVG Element destroy | - | - | Remove the SVG element from DOM and delete all properties or listeners

Demo

A complete demo is available here

The source code of the demo is here

Use the settings generator here

Contributing

The dashboard with CI and code quality indicators