Giter VIP home page Giter VIP logo

jazzicon's Introduction

@metamask/jazzicon

⭐️ View demo

Say goodbye to boring, blocky identicons that look like they came out of the '70s and replace them with jazzy, colorful collages that more likely came out of the '80s!

Installation

npm install @metamask/jazzicon

Usage

This library exports a single function which:

  • takes two numbers, the diameter of the icon in pixels and a seed for randomly generating patterns
  • gives you back a DOM element representing the icon to use as you wish

For example:

const jazzicon = require('@metamask/jazzicon');

// Generate 60 icons
for (let i = 0; i < 60; i++) {
  // Use 100px as the diameter for each icon and a random number for the seed
  const icon = jazzicon(100, Math.round(Math.random() * 10000000));
  // Add the new icon to the page
  document.body.appendChild(icon);
}

Generating the demo

You can generate and run the demo locally by running npm run build-demo, then opening demo-build/index.html in your browser.

jazzicon's People

Contributors

danfinlay avatar mcmire avatar whymarrh avatar jmrossy avatar kumavis avatar dependabot[bot] avatar legobeat avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.