108 lines
No EOL
4.3 KiB
HTML
108 lines
No EOL
4.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<title>SplatNet - Splatoon's multiplayer service hub</title>
|
|
<link rel="icon" href="../favicon.ico" type="image/x-icon" />
|
|
<link rel="stylesheet" href="styles.css" />
|
|
<script src="/assets/general.js"></script>
|
|
<script src="/config.js"></script>
|
|
</head>
|
|
<body>
|
|
|
|
<div id="squid-container">
|
|
<canvas id="squid-canvas" width="1920" height="1080"></canvas>
|
|
</div>
|
|
|
|
<div id="loading-overlay" class="loading-overlay">
|
|
<canvas id="loading-canvas" width="100" height="100"></canvas>
|
|
<div id="loading-text">
|
|
<img src="/assets/en/svg/text/wait/tx_loading-dccf3fb801ca859f2d17992f5cd7da62995c1fe81a306dd103398ef7c0e25b70.svg" alt="Loading">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="main-wrapper">
|
|
|
|
<div id="header-container"></div>
|
|
|
|
<div class="content">
|
|
<div class="logo-left-align">
|
|
<div id="stage-header-logo">
|
|
<img class="bg-layer" src="../assets/en/svg/ui/bg_h1-62e768f2a1ca52f993b5953c78d46bc53b35b70df7f8e13619a982f8f10ab750.svg">
|
|
<img class="icon-layer" src="../assets/en/svg/ui/ico_stage-8dbc9e30d2dd9f99f4d1678fe53c4aaada7f7ff43929880a0c9f4e49f148f540.svg">
|
|
<img class="label-layer" src="../assets/en/svg/text/menu/tx_stageinfo_wht-5fa41cd0a2c7e72f93cb7ec6821d01af7f5d05e91b9dc16b002197e69fdf9440.svg">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="stage-info-text">
|
|
Use the stage information to guide your weapon strategy and battle strategy!
|
|
</div>
|
|
<div class="stages-container" id="stages-container"></div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<script>
|
|
fetch("../header.html")
|
|
.then(res => res.text())
|
|
.then(html => {
|
|
const headerContainer = document.getElementById("header-container");
|
|
if (headerContainer) {
|
|
headerContainer.innerHTML = html;
|
|
const friendButton = headerContainer.querySelector('.menu-item.stage');
|
|
if (friendButton) friendButton.classList.add('active');
|
|
}
|
|
|
|
if (typeof CONFIG !== 'undefined') {
|
|
const apiBase = CONFIG.API_BASE_URL.replace(/\/$/, "");
|
|
const logoutForm = document.getElementById("logout-form");
|
|
if (logoutForm) {
|
|
logoutForm.action = apiBase + "/api/v1/spfn/logout";
|
|
const originInput = document.getElementById("logout_frontend_origin");
|
|
if (originInput) originInput.value = window.location.origin;
|
|
logoutForm.addEventListener('submit', () => sessionStorage.removeItem('user_cache'));
|
|
}
|
|
|
|
const renderData = (data) => {
|
|
if (typeof data === 'string') {
|
|
try { data = JSON.parse(data); } catch (e) { console.error(e); }
|
|
}
|
|
const nameEl = document.getElementById('mii-name');
|
|
const imgEl = document.getElementById('mii-img');
|
|
if (nameEl) {
|
|
nameEl.textContent = (data.mii && data.mii.name) || data.nickname || data.user_id || data.username || "User";
|
|
}
|
|
if (imgEl) {
|
|
const miiBlob = (data.mii && data.mii.data) || data.mii_data;
|
|
if (miiBlob) {
|
|
imgEl.src = `https://mii-unsecure.ariankordi.net/miis/image.png?erri=s6u7r-rsp&data=${encodeURIComponent(miiBlob)}&type=face&width=270`;
|
|
imgEl.style.display = 'block';
|
|
}
|
|
}
|
|
};
|
|
|
|
const cached = sessionStorage.getItem('user_cache');
|
|
if (cached) renderData(JSON.parse(cached));
|
|
|
|
fetch(apiBase + "/api/v1/me", { credentials: 'include' })
|
|
.then(res => res.ok ? res.json() : Promise.reject(res))
|
|
.then(data => {
|
|
sessionStorage.setItem('user_cache', JSON.stringify(data));
|
|
renderData(data);
|
|
})
|
|
.catch(err => {
|
|
if (!cached) {
|
|
const nameEl = document.getElementById('mii-name');
|
|
if (nameEl) nameEl.textContent = "Guest";
|
|
}
|
|
console.error(err);
|
|
});
|
|
}
|
|
|
|
})
|
|
.catch(err => console.error("Failed to load header:", err));
|
|
</script>
|
|
|
|
<script src="stages.js"></script>
|
|
</body>
|
|
</html> |