export default function (scrawl, el) {
const report = function () {
let testTicker = Date.now(),
testTime, testNow;
const testMessage = document.querySelector(`#${el.id}`);
return function () {
testNow = Date.now();
testTime = testNow - testTicker;
testTicker = testNow;
testMessage.textContent = `Screen refresh: ${Math.ceil(testTime)}ms; fps: ${Math.floor(1000 / testTime)}`;
console.log('report animation is running')
};
}();
const snippet = scrawl.makeSnippet({
domElement: el,
animationHooks: {
afterShow: report,
},
includeCanvas: false,
})
return (snippet) ? true : false;
}