Download node_modules/three/examples/jsm/offscreen/jank.js from SimWorld-AI/industrial-harbor-viewer: direct link, hf CLI and curl.
- Browser
- Download file 645 Bytes
-
https://huggingface.co/spaces/SimWorld-AI/industrial-harbor-viewer/resolve/main/node_modules/three/examples/jsm/offscreen/jank.js
- Command line
-
hf download hf://spaces/SimWorld-AI/industrial-harbor-viewer/node_modules/three/examples/jsm/offscreen/jank.js
-
curl -L -o jank.js https://huggingface.co/spaces/SimWorld-AI/industrial-harbor-viewer/resolve/main/node_modules/three/examples/jsm/offscreen/jank.js
645 Bytes
| let interval = null; | |
| let result = null; | |
| function initJank() { | |
| const button = document.getElementById( 'button' ); | |
| button.addEventListener( 'click', function () { | |
| if ( interval === null ) { | |
| interval = setInterval( jank, 1000 / 60 ); | |
| button.textContent = 'STOP JANK'; | |
| } else { | |
| clearInterval( interval ); | |
| interval = null; | |
| button.textContent = 'START JANK'; | |
| result.textContent = ''; | |
| } | |
| } ); | |
| result = document.getElementById( 'result' ); | |
| } | |
| function jank() { | |
| let number = 0; | |
| for ( let i = 0; i < 10000000; i ++ ) { | |
| number += Math.random(); | |
| } | |
| result.textContent = number; | |
| } | |
| export default initJank; | |