PageSourceSearch

https://jayspacewebsite.web.app/sub-des/mars/code.js

js jayspacewebsite.web.app collected 2026-10-03 12:27:21 UTC 976 bytes, 33 lines download raw bytes

1var g = document.getElementById("canvas-gravity")
2var gtx = g.getContext("2d");
3
4var simGoing = 0;
5function gravitySimulation(grav) {
6    if (simGoing == 0) {
7        simGoing = 1
8        var x = g.width/2-  15;
9        var y = 10;
10        var gravity = grav/5;
11        var vol = 0;
12        const update = setInterval(updateGravity, 30);
13        
14        function updateGravity() {
15            gtx.fillStyle = "white"
16            gtx.fillRect(0, 0, g.width, g.height)
17            gtx.fillStyle = "red"
18            gtx.fillRect(x, y, 30, 20);
19
20            vol += gravity;
21            if (y+vol > g.height - 10) {
22                clearInterval(update)
23                gtx.fillStyle = "white"
24                gtx.fillRect(0, 0, g.width, g.height)
25                gtx.fillStyle = "red"
26                gtx.fillRect(x, g.height-20, 30, 20);
27                simGoing = 0;
28            } else {
29                y += vol;
30            }
31        }
32    }
33}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.