- starting pong game 3d
This commit is contained in:
Kum1ta
2024-07-30 01:08:32 +02:00
parent d27ab24c5e
commit 57c261c689
1284 changed files with 680273 additions and 0 deletions

45
site/node_modules/three/examples/jsm/offscreen/jank.js generated vendored Normal file
View File

@ -0,0 +1,45 @@
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;