2024-08-20 19:46:48 +02:00

93 lines
3.5 KiB
Plaintext

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>simrail.alekswilc.dev</title>
<meta name="description"
content="<%- record.stationName %> | <%- record.userUsername %> | <%- dayjs(record.leftDate).format('hh:mm DD/MM/YYYY') %>">
<meta property="og:title" content="Simrail Log">
<meta property="og:url" content="https://simrail.alekswilc.dev/details/<%- record.id %>/">
<meta property="og:description"
content="<%- record.stationName %> | <%- record.userUsername %> | <%- dayjs(record.leftDate).format('hh:mm DD/MM/YYYY') %>"">
<meta property=" og:type" content="website">
<meta property="og:image" content="<%- record.userAvatar %>" />
<meta name="twitter:card" content="summary_large_image">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/open-fonts@1.1.1/fonts/inter.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@exampledev/new.css@1.1.2/new.min.css">
<style>
p {
margin: 0;
}
.details {
display: flex;
flex-direction: column;
}
.clickable {
cursor: pointer;
}
</style>
</head>
<script>
function copydata() {
navigator.clipboard.writeText(document.getElementById('data').textContent.replace(/ /g, '').split('\n').filter(x => x).join(''))
}
function copylink() {
navigator.clipboard.writeText("https://simrail.alekswilc.dev/trains/details/<%- record.id %>/")
}
</script>
<body>
<%- include('../_modules/header.ejs', { section: 'trains' }) %>
<div class="details">
<p>Użytkownik: <a href="/profiles/<%- record.userSteamId %>">
<%- record.userUsername %>
</a></p>
<p>Pociąg: <%- record.trainName %> <%- record.trainNumber %>
</p>
<p>Data wejścia: <%- record.joinedDate ? dayjs(record.joinedDate).format('HH:mm DD/MM/YYYY') : '--:-- --/--/--'
%> (<%- record.joinedDate ? dayjs(record.joinedDate).fromNow() : '--' %>)</p>
<p>Data wyjścia: <%- dayjs(record.leftDate).format('HH:mm DD/MM/YYYY') %> (<%- dayjs(record.leftDate).fromNow()
%>)</p>
<p>Spędzony czas: <%- record.joinedDate ? msToTime(record.leftDate - record.joinedDate) : '--' %>
</p>
<% if (record.distance) { %>
<p>Przejechane kilometry: <%- record.distance / 1000 %></p>
<p>Zdobyte punkty: <%- record.points %></p>
<p>Średnia prędkość: <%- ((record.distance / ((record.leftDate - record.joinedDate) / 1000)) * 3.6).toFixed(2) %> km/h</p>
<% } %>
</p>
<br />
<code class="clickable" style="white-space: pre-line" onclick="copydata()" id="data">;train: <%- record.trainNumber %>
;steam: <%- record.userSteamId %>
;server: <%- record.server %>
;name: <%- record.userUsername %>
;joined: <%-record.joinedDate ? dayjs(record.joinedDate).format() : 'no-data'%>
;left: <%-dayjs(record.leftDate).format()%><%if (record.distance) {%>
;distance: <%- record.distance / 1000 %>
;points: <%- record.points %><%}%>
;url: https://simrail.alekswilc.dev/trains/details/<%- record.id %>/
</code>
<br />
<p><button onclick="copylink()">Kopiuj link</button></p>
</div>
<hr>
<%- include('../_modules/footer.ejs', { thanks: false }) %>
</body>
</html>