Giter Club home page Giter Club logo

avatar-generator's Introduction

Personas by Draftbit

A delightful avatar generator by the folks at Draftbit. Try it online at https://personas.draftbit.com

Personas

Contributing

Personas is built using Gatsby and Rescript. Setup instructions are straight forward:

  • yarn
  • yarn develop starts the Gatsby server
  • yarn re:watch starts the Rescript compiler

Note that the first time you get set up you'll need to run npx patch-package to fix an error with one of avatar-generator's dependencies.

Why

  • We were exploring Reason/Rescript
  • We wanted to put together an inclusive avatar generator for placeholders and profile photos

avatar-generator's People

Contributors

ayshiff avatar davesnx avatar dependabot[bot] avatar dhruska avatar diogomqbm avatar dylanirlbeck avatar mglagola avatar peterpme avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

avatar-generator's Issues

Consolidate re / src folders

Before I knew what I was doing, I had the re / src folders consolidated, lets throw all the reason stuff inside src

Convert onSelectColor and onSelectStyle to use variants

https://github.com/draftbit/avatar-generator/blob/master/re/AvatarGenerator.re#L92

this is what they currently are:

           onSelectColor={color => {
             let key =
               switch (o.id) {
               | "Skin" => "skinColor"
               | "Hair" => "hairColor"
               | "FacialHair" => "facialHairColor"
               | "Body" => "bodyColor"
               | "Background" => "bgColor"
               | _ => ""
               };

             onChange(key, color);
           }}
           onSelectStyle={style => {
             let key =
               switch (o.id) {
               | "Hair" => "hair"
               | "Skin" => "skin"
               | "FacialHair" => "facialHair"
               | "Body" => "body"
               | "Eyes" => "eyes"
               | "Mouth" => "mouth"
               | "Nose" => "nose"
               | _ => ""
               };

this is what we want:

type BodyColor = Skin | Hair | FacialHair | Body | Background
type BodyPart = Skin | Hair | FacialHair | Body | Eyes | Mouth | Nose

and then you can create the serializers for those:

bodyColorToStr = BodyColor => string
bodyPartToStr = BodyPart => string

you can then easily replace this getZIndex https://github.com/draftbit/avatar-generator/blob/master/re/AvatarGenerator.re#L12

Could this be used in a custom react UI?

The instructions in the README assume that I'd need to run this as a standalone application, but is there any interest in exposing this as, say, a react component? If so, I'd be happy to help out. All of the other avatar libraries aren't as polished as this one imo.

Make the Avatar preview sticky

Hi guys!
I love your product.
Do you think you guys could make the Avatar previewer sticky? It'd make the generator a more comfortable mobile experience since users wouldn't have to scroll up all the time too see how the different choices look on their character.

Convert exportImage.js to Reason

This file is still in JS because it (a) uses async/await syntax and (b) uses a lot of DOM-related methods. We'll need to create bindings for the html2canvas package as well, but that shouldn't be too difficult.

Once the rewrite in Reason is done, we can remove the file and keep all the functionality for export inside src/pages/Index.re.

This problem is encountered when executing the yarn develop command. It is the same in both Mac and window environments. Has anyone ever encountered this problem?

Your site's "gatsby-node.js" created a page with a component that doesn't exist.

The path to the missing component is "C:\Users\lishuaibing\Desktop\avatar-generator\src\pages\page_404.bs.js"

The page object passed to createPage:
{
"path": "404",
"component": "C:\Users\lishuaibing\Desktop\avatar-generator\src\pages\page_404.bs.js"
}

See the documentation for the "createPage" action โ€” https://www.gatsbyjs.org/docs/actions/#createPage

not finished createPages - 0.043s

error Command failed with exit code 1.

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.