css-viewport

Computes the perspective for a containefied field of view

cssViewport

Computes the perspective for a containefied field of view

// 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);
};

npm install css-viewport

  • Matt-Esch