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

polkadot-web-identicon

v1.0.5-rc2

Published

A generic identity icon that can render Substrate based chains icons for html/javascript frontend applications

Downloads

7

Readme

Polkadot Web Identicon

A generic identity icon that renders Substrate based chains identicons for html/javascript frontend applications.

This project is based on the polkadod-angular-identicon

Usage

The simplest way to use the component is to download it from npm

We assume you have npm and node.js installed in your environment.

  1. create a folder with a name of your choice for example : pwi (like polkadot-web-identicon 😎)

cd into the pwi (or the one you created) folder.

Type npm init to create the package.json file that will allow us to download packages from npm.

For simplicity sake, type enter for each question and at the end the package.json file should be created.

Create an index.html file that will contain the html and javascript code and past the following html snippet.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Testing polkadot-web-identicon</title>
</head>
<body>

</body>
</html>

Now we can install the polkadot-web-identicon package from npm with :

npm i polkadot-web-identicon After the installation completed we are ready to use the package we just need to do two things:

  • import the component library code files
  • call the component and use it with our parameters

These are the attributes that we can pass to the polkadot-web-identicon tag

address : the Substrate blockhain based address to pass as parameter

theme : the theme we want to display ( polkadot, beachball, jdenticon)

size : the size we want our identicon to be.

Our final structure in the index.html file will look like this:


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Testing polkadot-web-identicon</title>
</head>
<body>


    <h3>Polkadot icon theme  with default size</h3>
    <polkadot-web-identicon address="5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty" theme="polkadot"></polkadot-web-identicon>
    <br>
    <h3>beachball icon theme  with size of 80 </h3>
    <polkadot-web-identicon address="5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty" theme="beachball" size="80"></polkadot-web-identicon>
    <br>
    <h3>jdenticon icon theme  with size of 120</h3>
    <polkadot-web-identicon address="5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty" theme="jdenticon" size="120"></polkadot-web-identicon>

<script type="text/javascript" src="node_modules/polkadot-web-identicon/main.js"></script>
<script type="text/javascript" src="node_modules/polkadot-web-identicon/polyfills.js"></script>
<script type="text/javascript" src="node_modules/polkadot-web-identicon/runtime.js"></script>

</body>
</html>

Run

you can run npx live-server under the pwi or your project to see the render icons or open the index.html file on browser

Usage of built example

See inside pwi folder to see a ready to use example. on the terminal type npm i and npx live-serverto run the example.

Hackers Guide

For those who wants to build or tweak the library see BUILD.md file under documentation.

Improvements are on the way !!! Happy coding 😎!!!