Static site
Browse files- index.html +2 -2
- static/main.js +5 -2
index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
<meta name="theme-color" content="#10131b">
|
| 9 |
<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 10 |
<link href="https://fonts.googleapis.com/css2?family=Unbounded:wght@500;800;900&family=Inter:wght@400;500;600;700&family=Noto+Kufi+Arabic:wght@700&display=swap" rel="stylesheet">
|
| 11 |
-
<link rel="stylesheet" href="/static/style.css?v=
|
| 12 |
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%2714%27 fill=%27%23050506%27/%3E%3Ccircle cx=%2732%27 cy=%2732%27 r=%2716%27 fill=%27none%27 stroke=%27%23fff%27 stroke-width=%275%27/%3E%3C/svg%3E">
|
| 13 |
<script type="importmap">
|
| 14 |
{ "imports": {
|
|
@@ -202,6 +202,6 @@
|
|
| 202 |
<div id="toast" role="status"></div>
|
| 203 |
<noscript><p style="position:fixed;inset:auto 0 0;padding:16px;background:#111;color:#fff;text-align:center">VOID needs JavaScript for the 3D car.</p></noscript>
|
| 204 |
<script src="/static/hub.js" data-app="void" defer></script>
|
| 205 |
-
<script type="module" src="/static/main.js?v=
|
| 206 |
</body>
|
| 207 |
</html>
|
|
|
|
| 8 |
<meta name="theme-color" content="#10131b">
|
| 9 |
<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 10 |
<link href="https://fonts.googleapis.com/css2?family=Unbounded:wght@500;800;900&family=Inter:wght@400;500;600;700&family=Noto+Kufi+Arabic:wght@700&display=swap" rel="stylesheet">
|
| 11 |
+
<link rel="stylesheet" href="/static/style.css?v=1792907717">
|
| 12 |
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%2714%27 fill=%27%23050506%27/%3E%3Ccircle cx=%2732%27 cy=%2732%27 r=%2716%27 fill=%27none%27 stroke=%27%23fff%27 stroke-width=%275%27/%3E%3C/svg%3E">
|
| 13 |
<script type="importmap">
|
| 14 |
{ "imports": {
|
|
|
|
| 202 |
<div id="toast" role="status"></div>
|
| 203 |
<noscript><p style="position:fixed;inset:auto 0 0;padding:16px;background:#111;color:#fff;text-align:center">VOID needs JavaScript for the 3D car.</p></noscript>
|
| 204 |
<script src="/static/hub.js" data-app="void" defer></script>
|
| 205 |
+
<script type="module" src="/static/main.js?v=1792907717"></script>
|
| 206 |
</body>
|
| 207 |
</html>
|
static/main.js
CHANGED
|
@@ -99,7 +99,9 @@ document.getElementById("gFuelNav").onclick = () => { const st = game.state; if
|
|
| 99 |
function applySettings(save = true) {
|
| 100 |
for (const seg of menuEl.querySelectorAll(".seg[data-set]")) for (const b of seg.children) b.classList.toggle("on", SET[seg.dataset.set] === b.dataset.v);
|
| 101 |
const weak = /Intel|UHD|Iris|Radeon\(TM\) Graphics|Vega|SwiftShader|llvmpipe|Basic Render/i.test(GPU);
|
| 102 |
-
|
|
|
|
|
|
|
| 103 |
document.getElementById("gSens").value = SET.sens; game.api.sens = +SET.sens;
|
| 104 |
document.body.classList.toggle("steer-buttons", SET.steer === "buttons");
|
| 105 |
const cap = W.setQuality(SET.q); perf.max = cap; perf.pr = Math.min(perf.pr, cap); if (renderer.getPixelRatio() > cap) { renderer.setPixelRatio(cap); composer.setPixelRatio(cap); } lastW = 0; resize();
|
|
@@ -325,6 +327,7 @@ function drawGauge(S) {
|
|
| 325 |
if (S.nitro > .1) { gx.font = `800 ${W2 * .05}px Inter, sans-serif`; gx.fillStyle = "#3df5ff"; gx.fillText("NITRO", c, c - W2 * .16); }
|
| 326 |
}
|
| 327 |
let wasWrecked = false, wreckPose = null; const wrecks = [];
|
|
|
|
| 328 |
const perf = { t: 0, n: 0, pr: renderer.getPixelRatio(), max: renderer.getPixelRatio(), down: 0 };
|
| 329 |
applySettings();
|
| 330 |
let lastHud = 0, prevGear = 1, feedFlip = 0;
|
|
@@ -334,7 +337,7 @@ function frameLoop(fixed) {
|
|
| 334 |
if (!fixed && raw < .5) {
|
| 335 |
perf.t += raw; perf.n++;
|
| 336 |
if (perf.t > 1.5) {
|
| 337 |
-
const avg = perf.t / perf.n, was = perf.pr;
|
| 338 |
if (avg > 1 / 45 && perf.pr > .6) perf.pr = Math.max(.6, perf.pr - (avg > 1 / 25 ? .25 : .12));
|
| 339 |
else if (avg > 1 / 40 && mode === "play" && ++perf.down >= 3 && SET.q !== "low") { // still slow at the lowest resolution: drop a quality level
|
| 340 |
perf.down = 0; SET.q = { ultra: "high", high: "medium", medium: "low" }[SET.q]; perf.pr = W.QUALITY[SET.q].pr; applySettings(false); toast(`Graphics set to ${SET.q} to keep it smooth`);
|
|
|
|
| 99 |
function applySettings(save = true) {
|
| 100 |
for (const seg of menuEl.querySelectorAll(".seg[data-set]")) for (const b of seg.children) b.classList.toggle("on", SET[seg.dataset.set] === b.dataset.v);
|
| 101 |
const weak = /Intel|UHD|Iris|Radeon\(TM\) Graphics|Vega|SwiftShader|llvmpipe|Basic Render/i.test(GPU);
|
| 102 |
+
const masked = !/ANGLE|NVIDIA|Intel|AMD|Radeon|Apple|Mali|Adreno/i.test(GPU); // Brave and some others hide the chip name for privacy
|
| 103 |
+
const name = (GPU || "unknown").replace(/^ANGLE \([^,]+, /, "").replace(/ \(0x[0-9A-Fa-f]+\).*$/, "").replace(/ Direct3D.*$/, "").replace(/, D3D.*$/, "");
|
| 104 |
+
document.getElementById("gGpu").innerHTML = `${masked ? "Your browser hides which graphics chip it uses" : `Running on: <b>${name}</b>`} · <b id="gFps">${fpsNow ? fpsNow + " fps" : "measuring…"}</b>${weak ? '<br><span class="warn">This is the built-in laptop graphics. For full speed, make your browser use the RTX: Windows Settings → System → Display → Graphics → your browser → High performance, then restart the browser.</span>' : masked ? '<br><span class="small">Smooth is 60 fps or more. Under 40, check the browser is set to your RTX in Windows graphics settings.</span>' : ""}`;
|
| 105 |
document.getElementById("gSens").value = SET.sens; game.api.sens = +SET.sens;
|
| 106 |
document.body.classList.toggle("steer-buttons", SET.steer === "buttons");
|
| 107 |
const cap = W.setQuality(SET.q); perf.max = cap; perf.pr = Math.min(perf.pr, cap); if (renderer.getPixelRatio() > cap) { renderer.setPixelRatio(cap); composer.setPixelRatio(cap); } lastW = 0; resize();
|
|
|
|
| 327 |
if (S.nitro > .1) { gx.font = `800 ${W2 * .05}px Inter, sans-serif`; gx.fillStyle = "#3df5ff"; gx.fillText("NITRO", c, c - W2 * .16); }
|
| 328 |
}
|
| 329 |
let wasWrecked = false, wreckPose = null; const wrecks = [];
|
| 330 |
+
let fpsNow = 0;
|
| 331 |
const perf = { t: 0, n: 0, pr: renderer.getPixelRatio(), max: renderer.getPixelRatio(), down: 0 };
|
| 332 |
applySettings();
|
| 333 |
let lastHud = 0, prevGear = 1, feedFlip = 0;
|
|
|
|
| 337 |
if (!fixed && raw < .5) {
|
| 338 |
perf.t += raw; perf.n++;
|
| 339 |
if (perf.t > 1.5) {
|
| 340 |
+
const avg = perf.t / perf.n, was = perf.pr; fpsNow = Math.round(1 / avg); const fe = document.getElementById("gFps"); if (fe) fe.textContent = fpsNow + " fps";
|
| 341 |
if (avg > 1 / 45 && perf.pr > .6) perf.pr = Math.max(.6, perf.pr - (avg > 1 / 25 ? .25 : .12));
|
| 342 |
else if (avg > 1 / 40 && mode === "play" && ++perf.down >= 3 && SET.q !== "low") { // still slow at the lowest resolution: drop a quality level
|
| 343 |
perf.down = 0; SET.q = { ultra: "high", high: "medium", medium: "low" }[SET.q]; perf.pr = W.QUALITY[SET.q].pr; applySettings(false); toast(`Graphics set to ${SET.q} to keep it smooth`);
|