css-viewport

0.2.0 • Public • Published

cssViewport

Computes the perspective for a containefied field of view

Example

// Create a viewport with fovy PI/2
// and update body on window resize
 
var Viewport = require('css-viewport'),
    v = new Viewport(Math.PI/2);
window.onresize = updatePerspective;
updatePerspective();
 
function updatePerspective() {
    v.update(document.body);
};

Installation

npm install css-viewport

Contributors

  • Matt-Esch

MIT Licenced

Dependents (0)

Package Sidebar

Install

npm i css-viewport

Weekly Downloads

2

Version

0.2.0

License

none

Last publish

Collaborators

  • mattesch