2.5.0 • Published 4 years ago

metamask-logo v2.5.0

Weekly downloads
353
License
ISC
Repository
github
Last release
4 years ago

Metamask Logo

A browserifyable 3d metamask logo. Live demo.

This repo can both be included as a browserifiable module, and includes a sample app.

The sample app address is index.html. The sample app javascript is bundle.js, which is built from sample.js using the build task (see the package.json).

API

var ModelViewer = require('metamask-logo')

// To render with fixed dimensions:
var viewer = ModelViewer({

  // Dictates whether width & height are px or multiplied
  pxNotRatio: true,
  width: 500,
  height: 400,
  // pxNotRatio: false,
  // width: 0.9,
  // height: 0.9,

  // To make the face follow the mouse.
  followMouse: false,

  // head should slowly drift (overrides lookAt)
  slowDrift: false,

})

// add viewer to DOM
var container = document.getElementById('logo-container')
container.appendChild(viewer.container)

// look at something on the page
viewer.lookAt({
  x: 100,
  y: 100,
})

// enable mouse follow
viewer.setFollowMouse(true)

// deallocate nicely
viewer.stopAnimation()

Running Example

First, rebuild browserify example/example.js -o bundle.js. Then, run a local server in this folder and visit it. For example, http-server.

2.5.0

4 years ago

2.4.1

4 years ago

2.4.0

4 years ago

2.3.1

4 years ago

2.3.0

4 years ago

2.2.1

5 years ago

2.2.0

6 years ago

2.1.4

6 years ago

2.1.3

8 years ago

2.1.2

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.0

8 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.5

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago