Giter VIP home page Giter VIP logo

3d-profile-avatars's Introduction

3D Profile Avatars npm version

Add your website a 3D Profile Avatar using Ready Player Me with a single line of code!

Test it on CodeSandbox: https://codesandbox.io/s/avatar-view-wrn2u


Install

  • Run in cli npm i @sarge/avatar-view

Example

  • First visit https://vr.readyplayer.me and create a half-body avatar.

  • Copy the url of the .glb file of the avatar you created.

  • Import AvatarView to your file.

  • Add <AvatarView url={url}/> component yo your return content

// if you copy the code here dont forget to remove the three dots

import AvatarView from "@sarge/avatar-view";
...
const url = "https://d1a370nemizbjq.cloudfront.net/511ad04f-8b4e-4565-931d-94ecba87f3ac.glb";

export default function App() {
  return (
    <div>
        ...
        <AvatarView url={url}/>
        ...
    </div>
  );
}

Parameters of AvatarView

  • url (string):

    Url of the Ready Player Me avatar to load. Must be half-body avatar url. This parameter is mandatory.

  • style (React.CSSProperties | undefined):

    Style of the avatar view canvas. Here you can change the border style, background color or image, width, height and other style options. This parameter is optional.

  • rotateAvatar (boolean | undefined):

    Enables use of orbit controls for the 3D scene, which helps you rotate the avatar via mouse drag. This parameter is optional.

  • eyeBlink (boolean | undefined):

    Enables eye blinking in random intervals. This parameter is optional.

  • headMovement (boolean | undefined):

    Enables head and eye follow of the cursor when avatar is facing the screen and cursor is moving on the canvas. When cursor is out of the canvas, avatar goes back to initial stance. This parameter is optional.

3d-profile-avatars's People

Contributors

srcnalt 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.