mirror of
https://github.com/InstanceBrick/nightcap.git
synced 2026-10-18 02:00:48 +02:00
57 lines
2.1 KiB
HTML
57 lines
2.1 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="color-scheme" content="dark light">
|
|
<meta name="referrer" content="no-referrer">
|
|
<meta http-equiv="Content-Security-Policy"
|
|
content="default-src 'none'; style-src 'unsafe-inline'; script-src 'unsafe-inline'">
|
|
<title>Join a Roblox server with Mocktail</title>
|
|
<style>
|
|
:root { font: 17px/1.55 system-ui, sans-serif; color-scheme: dark; }
|
|
body { margin: 0; background: #0d1117; color: #e6edf3; }
|
|
main { max-width: 560px; margin: 15vh auto; padding: 32px; }
|
|
h1 { font-size: 2rem; }
|
|
p { color: #9da7b3; }
|
|
a { display: inline-block; padding: 12px 18px; border-radius: 9px;
|
|
background: #238636; color: white; text-decoration: none;
|
|
font-weight: 700; }
|
|
[hidden] { display: none; }
|
|
</style>
|
|
</head>
|
|
<body><main>
|
|
<h1>Join Server</h1>
|
|
<p id="status">Checking the Discord invitation…</p>
|
|
<a id="launch" hidden>Open Mocktail</a>
|
|
<noscript>This invitation requires JavaScript to open Mocktail.</noscript>
|
|
</main>
|
|
<script>
|
|
'use strict';
|
|
const status = document.querySelector('#status');
|
|
const launch = document.querySelector('#launch');
|
|
const query = new URLSearchParams(location.hash.slice(1));
|
|
const placeId = query.get('placeId') || '';
|
|
const gameInstanceId = query.get('gameInstanceId') || '';
|
|
const validPlace = /^[1-9][0-9]{0,18}$/.test(placeId);
|
|
const validInstance = gameInstanceId.length === 0 ||
|
|
(gameInstanceId.length <= 128 &&
|
|
!/[\u0000-\u001f\u007f]/.test(gameInstanceId));
|
|
if (!validPlace || !validInstance) {
|
|
status.textContent = 'This server invitation is invalid or incomplete.';
|
|
} else {
|
|
let target = 'roblox://experiences/start?placeId=' + placeId;
|
|
if (gameInstanceId.length > 0) {
|
|
target += '&gameInstanceId=' + encodeURIComponent(gameInstanceId);
|
|
}
|
|
launch.href = target;
|
|
launch.hidden = false;
|
|
status.textContent = gameInstanceId.length > 0
|
|
? 'Opening this public Roblox server in Mocktail…'
|
|
: 'Opening this Roblox experience in Mocktail…';
|
|
location.replace(target);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|