Code Monkey home page Code Monkey logo

dfkhero's Introduction

Hero svg component for react to show your DFK NFTs

working on the readme will update soon Going to rollup this as an npm package soon

entry.js is where you should export the component from there are 4 functions in there

getApiHero(heroId)

  • this takes any hero id and returns a promise that will resolve into an object containing all your heros information with his genes decoded. This is the hero data you will need to generate the svg

buildApiHero(rawHero)

  • this takes raw hero info and decodes his genes and give you back the hero object you need to generate the svg. Use this instead of getApiHero if you are already querying the blockchain for raw heroData.

-DfkHeroCard

  • this is the react component to display the card, Takes 3 properties hero, isAnimated, isFlipped. Hero is the only required property just make sure its an ApiHero from one of the other functions. if isFlipped is toggled it will be animated flip

-DfkHeroSprite

  • this a react component to display a hero sprite without its card. Currently only takes on property which is the heroApi object

app.js is currently an ugly example of using this

Made with the help of Kalash#2298 in gathering all the svgs needed for this

dfkhero's People

Contributors

daltoncoder avatar kalashspooner 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.