347 lines
14 KiB
HTML
347 lines
14 KiB
HTML
<!doctype html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="referrer" content="no-referrer">
|
|
<title>福云地址导航</title>
|
|
<link id="brand-icon" rel="icon" href="./native/images/brand/fuc-mark.svg?v=2" type="image/svg+xml" sizes="any">
|
|
<style>
|
|
:root {
|
|
color-scheme: dark;
|
|
--page: #171426;
|
|
--page-wash: #241b3a;
|
|
--panel: #201c34;
|
|
--ink: #f6f1ff;
|
|
--muted: #bbb2d0;
|
|
--line: #38304d;
|
|
--accent: #c6b7ff;
|
|
--fastest: #b6ff40;
|
|
--notice-warm-tone: #f4d36c;
|
|
--action: #7256df;
|
|
--tint: #332851;
|
|
--shadow: rgb(0 0 0 / 20%);
|
|
font: 16px/1.55 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
|
|
}
|
|
|
|
*, *::before, *::after { box-sizing: border-box; }
|
|
|
|
body {
|
|
min-height: 100vh;
|
|
margin: 0;
|
|
color: var(--ink);
|
|
background: linear-gradient(180deg, var(--page-wash), var(--page) 360px);
|
|
}
|
|
|
|
a { color: inherit; text-decoration: none; }
|
|
button { color: inherit; font: inherit; cursor: pointer; }
|
|
:is(a, button):focus-visible,
|
|
.entry:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 4px; }
|
|
|
|
.wrap { width: min(740px, calc(100% - 48px)); margin-inline: auto; }
|
|
|
|
main { padding-block: clamp(32px, 6vw, 64px) 40px; }
|
|
h1 { margin: 0 0 24px; font-size: clamp(32px, 5vw, 48px); line-height: 1.18; letter-spacing: -.04em; }
|
|
.email-notice {
|
|
display: grid;
|
|
grid-template-columns: auto minmax(0, 1fr);
|
|
align-items: start;
|
|
gap: 12px;
|
|
margin-bottom: 16px;
|
|
padding: 12px 16px;
|
|
border: 1px solid var(--line);
|
|
border-radius: 12px;
|
|
background: color-mix(in srgb, var(--notice-warm-tone) 5%, var(--page));
|
|
font-size: 15px;
|
|
}
|
|
.email-notice-icon {
|
|
width: 19px;
|
|
height: 19px;
|
|
margin-top: 2px;
|
|
color: var(--accent);
|
|
}
|
|
.email-notice p { margin: 0; }
|
|
.email-notice .email-detail { margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 1.65; text-wrap: pretty; }
|
|
.copy-control { position: relative; display: inline-block; }
|
|
.copy-email {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 5px;
|
|
padding: 0;
|
|
border: 0;
|
|
background: none;
|
|
color: var(--accent);
|
|
font-weight: 700;
|
|
text-underline-offset: 4px;
|
|
}
|
|
.copy-email:hover { text-decoration: underline; }
|
|
.copy-feedback {
|
|
position: absolute;
|
|
inset-inline-end: 0;
|
|
inset-block-end: calc(100% + 6px);
|
|
z-index: 1;
|
|
width: max-content;
|
|
max-width: 100%;
|
|
padding: 3px 8px;
|
|
border: 1px solid var(--line);
|
|
border-radius: 6px;
|
|
background: var(--panel);
|
|
box-shadow: 0 4px 12px var(--shadow);
|
|
font-size: 12px;
|
|
pointer-events: none;
|
|
}
|
|
.copy-feedback:empty { opacity: 0; }
|
|
|
|
.entries {
|
|
padding: clamp(16px, 4vw, 28px);
|
|
border: 1px solid var(--line);
|
|
border-radius: 18px;
|
|
background: var(--panel);
|
|
box-shadow: 0 18px 48px var(--shadow);
|
|
}
|
|
|
|
.entries h2 { margin: 0 0 16px; font-size: 18px; }
|
|
.routes { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
|
|
|
|
.entry {
|
|
display: grid;
|
|
grid-template-columns: minmax(0, 1fr) auto auto;
|
|
align-items: center;
|
|
gap: 14px;
|
|
min-height: 60px;
|
|
padding: 12px 16px;
|
|
border: 1px solid var(--line);
|
|
border-radius: 10px;
|
|
cursor: pointer;
|
|
transition: border-color .16s ease, background-color .16s ease;
|
|
}
|
|
|
|
.entry:hover { background: color-mix(in srgb, var(--tint) 50%, var(--panel)); }
|
|
.entry:has(input:checked) { background: var(--tint); border-color: var(--accent); }
|
|
.entry input { grid-area: 1 / 3; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
|
|
.entry-info { grid-area: 1 / 1; display: flex; align-items: baseline; gap: 12px; }
|
|
.entry .latency { grid-area: 1 / 2; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
.entry .latency[data-fastest] { color: var(--fastest); font-weight: 700; }
|
|
|
|
.entry strong { overflow-wrap: anywhere; font-size: 17px; }
|
|
.entry small { color: var(--muted); font-size: 13px; }
|
|
.entry:has(input:checked) small { color: var(--accent); }
|
|
|
|
.panel-footer {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 12px;
|
|
min-height: 36px;
|
|
margin-block: 12px;
|
|
color: var(--muted);
|
|
font-size: 13px;
|
|
}
|
|
.recheck { border: 0; background: none; padding: 6px 0; color: var(--accent); white-space: nowrap; }
|
|
.recheck:hover { text-decoration: underline; }
|
|
.recheck:disabled { opacity: .55; cursor: wait; }
|
|
.enter { display: grid; place-items: center; min-height: 46px; border-radius: 9px; font-size: 14px; }
|
|
.enter { padding-inline: 12px; color: #fff; background: var(--action); font-weight: 700; }
|
|
.enter:hover { filter: brightness(1.1); }
|
|
|
|
@media (max-width: 520px) {
|
|
.wrap { width: calc(100% - 32px); }
|
|
h1 { margin-bottom: 18px; }
|
|
.entry { gap: 10px; padding: 10px 12px; }
|
|
.entry-info { flex-direction: column; gap: 1px; }
|
|
}
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.entry { transition: none; }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<main class="wrap">
|
|
<h1>福云地址导航</h1>
|
|
<aside class="email-notice" aria-label="备用网址获取方式">
|
|
<svg class="email-notice-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
<rect x="2.5" y="5" width="19" height="14" rx="2"/>
|
|
<path d="m3.5 6.5 8.5 7 8.5-7"/>
|
|
</svg>
|
|
<div>
|
|
<p>务必,请收藏我们的邮箱
|
|
<span class="copy-control">
|
|
<button class="copy-email" type="button" aria-label="复制邮箱地址 [email protected]">
|
|
[email protected]
|
|
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" aria-hidden="true">
|
|
<path d="M8 8h9l3 3v10H8V8Z M15 8V3H3v13h5"/>
|
|
</svg>
|
|
</button>
|
|
<span class="copy-feedback" role="status"></span>
|
|
</span>。
|
|
</p>
|
|
<p class="email-detail">导航地址也被墙时,可发送任意邮件至该邮箱,会自动回复最新地址,这是最保险的防失联方式。</p>
|
|
</div>
|
|
</aside>
|
|
<section class="entries" aria-labelledby="entry-title">
|
|
<h2 id="entry-title">访问入口</h2>
|
|
<fieldset class="routes" aria-labelledby="entry-title">
|
|
<!-- project-domains:start -->
|
|
<label class="entry" data-role="primary">
|
|
<input type="radio" name="route" value="https://xn--9kqy16h.com/" data-domainhub-code="fuc.main-cn">
|
|
<span class="entry-info"><strong>福云.com</strong><small>永久主域名(需翻墙)</small></span>
|
|
<span class="latency">—</span>
|
|
</label>
|
|
<label class="entry" data-role="primary">
|
|
<input type="radio" name="route" value="https://fuuu.cloud/" data-domainhub-code="fuc.main-en">
|
|
<span class="entry-info"><strong>fuuu.cloud</strong><small>永久主域名(需翻墙)</small></span>
|
|
<span class="latency">—</span>
|
|
</label>
|
|
<label class="entry" data-role="direct">
|
|
<input type="radio" name="route" value="https://fu99.cloud/" data-domainhub-code="fuc.direct-current" checked>
|
|
<span class="entry-info"><strong>fu99.cloud</strong><small>免翻墙域名</small></span>
|
|
<span class="latency">—</span>
|
|
</label>
|
|
<label class="entry" data-role="direct">
|
|
<input type="radio" name="route" value="https://fuuu.online/" data-domainhub-code="fuc.fuuu-online">
|
|
<span class="entry-info"><strong>fuuu.online</strong><small>免翻墙域名</small></span>
|
|
<span class="latency">—</span>
|
|
</label>
|
|
<label class="entry" data-role="direct">
|
|
<input type="radio" name="route" value="https://xn--123-9i9dj97q.com/" data-domainhub-code="fuc.direct-cn-backup">
|
|
<span class="entry-info"><strong>福云123.com</strong><small>免翻墙域名(疑似被墙)</small></span>
|
|
<span class="latency">—</span>
|
|
</label>
|
|
<!-- project-domains:end -->
|
|
</fieldset>
|
|
<div class="panel-footer">
|
|
<span id="route-status" role="status">已选择 fu99.cloud</span>
|
|
<button class="recheck" type="button">重新检测</button>
|
|
</div>
|
|
<div class="actions">
|
|
<a id="enter" class="enter" href="/#/register">立即进入 →</a>
|
|
</div>
|
|
</section>
|
|
</main>
|
|
<script>
|
|
const panel = document.querySelector('.entries');
|
|
const routes = document.querySelector('.routes');
|
|
const status = document.querySelector('#route-status');
|
|
const enter = document.querySelector('#enter');
|
|
const recheck = document.querySelector('.recheck');
|
|
const invite = new URLSearchParams(location.search).get('code');
|
|
const entries = [...routes.querySelectorAll('input[name="route"]')].map(input => {
|
|
const row = input.closest('label');
|
|
return { input, row, result: row.querySelector('.latency') };
|
|
});
|
|
const isLocal = location.hostname === 'xb.loc';
|
|
const probePath = '/api/v1/guest/comm/config';
|
|
const probeTimeoutMs = 3000;
|
|
let manualSelection = false;
|
|
let testStatus = '';
|
|
|
|
function selectRoute() {
|
|
const selected = routes.querySelector('input:checked');
|
|
const origin = isLocal ? location.origin : new URL(selected.value).origin;
|
|
const code = invite && /^[A-Za-z0-9_-]{1,64}$/.test(invite) ? '?code=' + encodeURIComponent(invite) : '';
|
|
enter.href = origin + '/#/register' + code;
|
|
const name = selected.closest('label').querySelector('strong').textContent;
|
|
status.textContent = ['已选择 ' + name, testStatus].filter(Boolean).join(' · ');
|
|
}
|
|
|
|
async function measure(entry, sample) {
|
|
const url = new URL(probePath, isLocal ? location.origin : entry.input.value);
|
|
url.searchParams.set('nav_probe', sample);
|
|
const controller = new AbortController();
|
|
const started = performance.now();
|
|
const timeout = setTimeout(() => controller.abort(), probeTimeoutMs);
|
|
try {
|
|
const response = await fetch(url, {
|
|
mode: 'cors', cache: 'no-store', credentials: 'omit', redirect: 'error',
|
|
referrerPolicy: 'no-referrer', signal: controller.signal,
|
|
});
|
|
if (!response.ok) throw new Error('Probe failed');
|
|
const { data } = await response.json();
|
|
if (typeof data?.app_name !== 'string') throw new Error('Invalid XB response');
|
|
const elapsed = performance.now() - started;
|
|
entry.outcome = 'success';
|
|
entry.result.textContent = Math.max(1, Math.round(elapsed)) + ' ms';
|
|
return { entry, elapsed };
|
|
} catch {
|
|
entry.outcome = controller.signal.aborted ? 'timeout' : 'failure';
|
|
entry.result.textContent = entry.outcome === 'timeout' ? '超时' : '不可用';
|
|
return null;
|
|
} finally {
|
|
clearTimeout(timeout);
|
|
}
|
|
}
|
|
|
|
async function testRoutes() {
|
|
if (recheck.disabled) return;
|
|
recheck.disabled = true;
|
|
panel.setAttribute('aria-busy', 'true');
|
|
testStatus = isLocal ? '本地测速中…' : '正在测速…';
|
|
selectRoute();
|
|
for (const { result } of entries) {
|
|
result.removeAttribute('data-fastest');
|
|
result.textContent = '测速中…';
|
|
}
|
|
try {
|
|
const round = Date.now().toString(36);
|
|
const results = await Promise.all(entries.map((entry, index) => measure(entry, round + '-' + index)));
|
|
const ranked = results.filter(Boolean).sort((a, b) => a.elapsed - b.elapsed);
|
|
const measured = new Set(ranked.map(({ entry }) => entry));
|
|
const ordered = [...ranked.map(({ entry }) => entry), ...entries.filter(entry => !measured.has(entry))];
|
|
const focused = document.activeElement;
|
|
for (const { row } of ordered) {
|
|
if (row.dataset.role !== 'primary') routes.append(row);
|
|
}
|
|
if (routes.contains(focused) && document.activeElement !== focused) focused.focus({ preventScroll: true });
|
|
const fastest = ranked[0];
|
|
if (fastest) {
|
|
fastest.entry.result.setAttribute('data-fastest', '');
|
|
if (!manualSelection) fastest.entry.input.checked = true;
|
|
}
|
|
testStatus = fastest ? (isLocal ? '本地测速完成' : '测速完成') : '未测得可用入口';
|
|
if (!isLocal) {
|
|
const outcomes = Object.fromEntries(entries.map(({ input, outcome }) => [input.dataset.domainhubCode, outcome]));
|
|
fetch('/_nav-stats', {
|
|
method: 'POST', body: JSON.stringify(outcomes), credentials: 'omit',
|
|
keepalive: true, referrerPolicy: 'no-referrer', redirect: 'error',
|
|
}).catch(() => {});
|
|
}
|
|
} finally {
|
|
recheck.disabled = false;
|
|
panel.removeAttribute('aria-busy');
|
|
selectRoute();
|
|
}
|
|
}
|
|
|
|
routes.addEventListener('click', event => {
|
|
if (event.target.matches('input[name="route"]')) manualSelection = true;
|
|
});
|
|
routes.addEventListener('change', () => {
|
|
manualSelection = true;
|
|
selectRoute();
|
|
});
|
|
recheck.addEventListener('click', testRoutes);
|
|
selectRoute();
|
|
testRoutes();
|
|
</script>
|
|
<script type="module">
|
|
import { copyText } from './clipboard.mjs';
|
|
|
|
const email = document.querySelector('.copy-email');
|
|
const feedback = document.querySelector('.copy-feedback');
|
|
let feedbackTimer;
|
|
email.addEventListener('click', async () => {
|
|
clearTimeout(feedbackTimer);
|
|
feedback.textContent = '';
|
|
try {
|
|
await copyText(email.textContent.trim());
|
|
feedback.textContent = '已复制';
|
|
feedbackTimer = setTimeout(() => { feedback.textContent = ''; }, 1600);
|
|
} catch {
|
|
feedback.textContent = '复制失败,请选中邮箱地址手动复制。';
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|