1
0
mirror of https://dev.s-ul.net/Galexion/MaiMaiDXNet.git synced 2024-11-28 00:40:48 +01:00
MaiMaiDXNet/views/user.ejs

117 lines
4.0 KiB
Plaintext

<% var rootPath='../' ; %>
<%- include(rootPath + 'templates/header.ejs' ); %>
<% function normalizeText(text) { return text .normalize('NFD') .replace(/[\u0300-\u036f]/g, ''
).replace(/[\uFF01-\uFF5E]/g, function(ch) { return String.fromCharCode(ch.charCodeAt(0) - 0xFEE0); }); } %>
<link href="/stylesheets/user.css" rel="stylesheet" type="text/css">
<%
// set parameters correctly for either aqua format or Artemis format
var user = {};
if(userdata.user_name !== undefined) {
user = {
user_name: userdata.user_name,
music_rating: userdata.music_rating,
total_awake: userdata.total_awake
}
} else {
user = {
user_name: userdata.userName,
music_rating: userdata.musicRating,
total_awake: userdata.totalAwake
}
}
%>
<% if (params.serverType===0) { %>
<script>
window.serverType = 0;
</script>
<% } else { %>
<script>
window.serverType = 1;
</script>
<% } %>
<div id="User">
<h1>Yo! Welcome Back <%= normalizeText(user.user_name) %>!</h1>
<div id="wrapper">
<!-- Calm before the storm -->
<div class="buttons">
<button class="btn1" onclick="showContent(1)">Home</button>
<button class="btn2" onclick="showContent(2)">Play Data</button>
<button class="btn3" onclick="showContent(3)">Friends</button>
<button class="btn4" onclick="showContent(4)">Photos</button>
<button class="btn5" onclick="showContent(5)">Records</button>
<button class="btn6" onclick="showContent(6)">Area</button>
<button class="btn7" onclick="showContent(7)">Collection</button>
<button class="btn8" onclick="showContent(8)">Ranking</button>
</div>
</div>
<div id="wrapper">
<div data-content="content-1" id="user-profile-wrapper">
<div class="profile-image"><img id="user-image" src="" alt="User Image" onerror="this.src='assets/icon/UI_Icon_000000.png'"></div>
<div class="user-title">
<h4 id="user-title-text"></h4>
</div>
<div class="user-name">
<h4><%= normalizeText(user.user_name) %></h4>
</div>
<div class="dx-rating">
<h4><%= user.music_rating%></h4>
</div>
<div class="user-class"></div>
<div class="awakens">
<h4>★ ☓<%= user.total_awake%></h4>
</div>
</div><!-- This is just one nested div, Trmazi it's going to get a lot worse from here on. -->
<div data-content="content-2" id="user-play-data" class="hidden">
<!-- User Play-Log is generated at run time when the user clicks the button, so they get up to date data. -->
<div id="score-info-header-div">
<h4 id="score-info-header">Please Wait, Obtaining Scores...</h4>
</div>
</div>
<div data-content="content-4" id="user-memorial-images" class="hidden">
<div id="image-info-header-div">
<h4 id="image-info-header">Please Wait, Obtaining Images...</h4>
</div>
</div>
<div data-content="content-6" id="user-area" class="hidden">
<div id="area-loader-header-div">
<h4 id="area-header">Please Wait, Obtaining Area Data...</h4>
</div>
</div>
</div>
<details>
<summary>Developer Only Information</summary>
For Development purposes only, send statistics found in this menu when encontering UI
Errors.
<details>
<summary>Ban User</summary>
<div id="BanUserArea"></div>
</details>
<details>
<summary>Raw User Details</summary>
<pre><code><%=JSON.stringify(userdata, null, 2)%></code></pre>
</details>
<details>
<summary>Raw User Playlog</summary>
<pre><code id="RawUserPlayLog">{"No Data": "Load the `Play Log` Tab First to See the Raw Playlog Data"}</code></pre>
</details>
<details>
<summary>Raw User Area</summary>
<pre><code id="RawUserArea">{"No Data": "Load the `Area` Tab First to See the Raw User Area Data"}</code></pre>
</details>
</details>
<button id="clear-storage-btn">Sign Out</button>
</div>
<script type="text/javascript" src="/javascript/user.js" data-userdata="<%=JSON.stringify(userdata)%>"></script>
</body>
</html>