forked from spacebar/SplatNet
PR #5: Add equipment screen functionality (merges main with dev)
This commit is contained in:
parent
ce38573ad7
commit
429a1eb6ff
411 changed files with 17956 additions and 779 deletions
|
|
@ -5,8 +5,7 @@
|
|||
<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>
|
||||
<script src="/assets/jquery-1.9.1.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
|
@ -26,83 +25,21 @@
|
|||
<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 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 class="stage-info-text">
|
||||
Use the stage information to guide your weapon strategy and battle strategy!
|
||||
</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>
|
||||
<div class="stages-container" id="stages-container"></div>
|
||||
</div>
|
||||
|
||||
<script src="/assets/general.js"></script>
|
||||
<script src="stages.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in a new issue