Dies ist das Repository meines kleinen Portfolios.
Im Hintergrund läuft eine Planetensimulation, geschrieben in JavaScript und Three.js.
Die zu sehenden Texturen stammen von:
https://www.solarsystemscope.com/textures/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
643 B
45 lines
643 B
var interval = null; |
|
var result = null; |
|
|
|
function initJank() { |
|
|
|
var 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() { |
|
|
|
var number = 0; |
|
|
|
for ( var i = 0; i < 10000000; i ++ ) { |
|
|
|
number += Math.random(); |
|
|
|
} |
|
|
|
result.textContent = number; |
|
|
|
} |
|
|
|
export default initJank;
|
|
|