nyg-static-jam3
Version:
Jam3 frontend static project scaffold generator based on nyg
17 lines (15 loc) • 459 B
JavaScript
const Stats = require('stats.js');
module.exports = function() {
try {
const stats = new Stats();
stats.domElement.style.cssText = 'position:fixed;right:0;bottom:100px;z-index:10000';
document.body.appendChild(stats.domElement);
const loop = function() {
stats.update();
window.requestAnimationFrame(loop);
};
window.requestAnimationFrame(loop);
} catch (e) {
console.warn('Stats.js could not be loaded.');
}
};