Some 'formalities'...

main
BurnyLlama 2021-11-13 20:58:00 +01:00
parent ea7a02fc86
commit 6eb4cef1bb
9 changed files with 119 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "ddstats-server",
"version": "0.0.1",
"version": "0.1.0",
"description": "A DDNet Status and Statistics API.",
"main": "index.js",
"type": "module",

View File

@ -83,4 +83,25 @@ routes.get(
}
)
routes.get(
'/credits',
(req, res) => {
tx(req, res)('pages/credits.njk', {}, true, { currentSection: null })
}
)
routes.get(
'/api-reference',
(req, res) => {
tx(req, res)('pages/reference.njk', {}, true, { currentSection: null })
}
)
routes.get(
'/changelog',
(req, res) => {
tx(req, res)('pages/changelogs.njk', {}, true, { currentSection: null })
}
)
export default routes

View File

@ -93,6 +93,7 @@ header {
@mixin heading($level) {
font-size: 1.65rem - ($level * 0.15);
font-weight: normal;
margin-top: 1em;
}
@for $i from 1 to 6 {
@ -105,6 +106,20 @@ a {
color: palette.$blue5;
}
.long-text {
width: min(60ch, 80vw);
text-align: justify;
}
ul, ol {
margin: 1rem 0 1rem 2rem;
ul, ol {
margin: .25rem 0 .25rem 1rem;
}
}
//
// FORMS, INPUT

View File

@ -1 +1 @@
*,*::before,*::after{margin:0;padding:0;border:0 none transparent;box-sizing:border-box;scroll-behavior:smooth;font-family:"Manrope Regular",sans-serif;font-size:1rem;line-height:1.5}html,body{color:#e0e0ff;background-color:#10102f;height:100%}nav{display:flex;align-items:center;background-color:#20203f;border-radius:0 0 2rem 2rem;box-shadow:.5rem 0 4rem #00001f;margin:0 0 2rem 0;padding:1rem 2rem}nav .logo{width:3rem;height:3rem;margin-right:2rem;border-radius:100%;background-color:#ee588f}nav a{color:#fba7c6;border-bottom:.1rem solid transparent;margin:.25rem 1rem .5rem 1rem;padding:.15rem .5rem .25rem .5rem;font-size:1.25rem;text-decoration:none transparent;transition:border .3s}nav a:hover{border-bottom:.1rem solid #fba7c6}nav a.current{color:#ee588f}nav a.current:hover{border-bottom:.1rem solid #ee588f}.flex-container{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-around;margin:0 10vw}header,h1,h2,h3,h4,h5,h6{color:#fba7c6}header{font-size:4rem}h1{font-size:1.5rem;font-weight:normal}h2{font-size:1.35rem;font-weight:normal}h3{font-size:1.2rem;font-weight:normal}h4{font-size:1.05rem;font-weight:normal}h5{font-size:.9rem;font-weight:normal}a{color:#a3cefa}form{display:flex;flex-direction:column;justify-content:center;align-items:center}input{color:#e0e0ff;background-color:#20203f;margin:1em 0;padding:.75em 1.25em;outline:0 none transparent;border:.2rem solid transparent;border-radius:.5rem;box-shadow:.25rem 0 2rem #00001f;transition:border .3s,background-color .5s,border-radius .5s}input:hover{background-color:#30304f;border-radius:1rem}input:active,input:focus{border:.2rem solid #ee588f}button[type=submit]{margin:.75rem auto 1.25rem auto;padding:.15rem .5rem;border:.1rem solid #fba7c6;border-radius:.5rem;color:#fba7c6;background-color:transparent;cursor:pointer;text-decoration:none transparent;transition:color .3s,background-color .3s}button[type=submit]:hover{color:#10102f;background-color:#fba7c6}label{cursor:pointer;margin:.25rem 0}label>input[type=radio]{-webkit-appearance:none;appearance:none;cursor:pointer;margin:0 .5rem -0.25rem 1rem;padding:0;width:1.25rem;height:1.25rem;background-color:#e0e0ff;border:.25rem solid #e0e0ff;border-radius:100%}label>input[type=radio]:checked{border-color:#ee588f}label:hover>input[type=radio]{background-color:#fba7c6}#search{display:grid;grid-template-columns:2fr 1fr;grid-template-columns:repeat(auto, 4);grid-template-areas:"header header" "map map" "category category" "stars sort" "submit submit";width:min(90ch,80vw);margin:2rem 10vw}#search>*{width:100%}#search h1{grid-area:header}#search #map{grid-area:map}#search #categories{grid-area:category}#search #stars{grid-area:stars}#search .sorting{grid-area:sort;display:flex;flex-direction:column}#search button[type=submit]{grid-area:submit;width:max-content;margin:auto}.pages{width:100%;justify-content:center}.page{margin:.5rem;padding:.15rem .5rem;border:.1rem solid #fba7c6;border-radius:.5rem;color:#fba7c6;background-color:transparent;cursor:pointer;text-decoration:none transparent;transition:color .3s,background-color .3s}.page:hover{color:#10102f;background-color:#fba7c6}.page.current-page{color:#ee588f;border-color:#ee588f}.page.current-page:hover{color:#10102f;background-color:#ee588f}tr{width:max-content}tr td{padding:.25rem 0;vertical-align:middle;width:max-content}tr td:first-child{padding:.25rem 1.5rem .25rem 0}footer{display:flex;flex-direction:column;align-items:center;margin:5vh 2rem}footer a{color:#74b6fb;font-size:.8rem}
*,*::before,*::after{margin:0;padding:0;border:0 none transparent;box-sizing:border-box;scroll-behavior:smooth;font-family:"Manrope Regular",sans-serif;font-size:1rem;line-height:1.5}html,body{color:#e0e0ff;background-color:#10102f;height:100%}nav{display:flex;align-items:center;background-color:#20203f;border-radius:0 0 2rem 2rem;box-shadow:.5rem 0 4rem #00001f;margin:0 0 2rem 0;padding:1rem 2rem}nav .logo{width:3rem;height:3rem;margin-right:2rem;border-radius:100%;background-color:#ee588f}nav a{color:#fba7c6;border-bottom:.1rem solid transparent;margin:.25rem 1rem .5rem 1rem;padding:.15rem .5rem .25rem .5rem;font-size:1.25rem;text-decoration:none transparent;transition:border .3s}nav a:hover{border-bottom:.1rem solid #fba7c6}nav a.current{color:#ee588f}nav a.current:hover{border-bottom:.1rem solid #ee588f}.flex-container{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-around;margin:0 10vw}header,h1,h2,h3,h4,h5,h6{color:#fba7c6}header{font-size:4rem}h1{font-size:1.5rem;font-weight:normal;margin-top:1em}h2{font-size:1.35rem;font-weight:normal;margin-top:1em}h3{font-size:1.2rem;font-weight:normal;margin-top:1em}h4{font-size:1.05rem;font-weight:normal;margin-top:1em}h5{font-size:.9rem;font-weight:normal;margin-top:1em}a{color:#a3cefa}.long-text{width:min(60ch,80vw);text-align:justify}ul,ol{margin:1rem 0 1rem 2rem}ul ul,ul ol,ol ul,ol ol{margin:.25rem 0 .25rem 1rem}form{display:flex;flex-direction:column;justify-content:center;align-items:center}input{color:#e0e0ff;background-color:#20203f;margin:1em 0;padding:.75em 1.25em;outline:0 none transparent;border:.2rem solid transparent;border-radius:.5rem;box-shadow:.25rem 0 2rem #00001f;transition:border .3s,background-color .5s,border-radius .5s}input:hover{background-color:#30304f;border-radius:1rem}input:active,input:focus{border:.2rem solid #ee588f}button[type=submit]{margin:.75rem auto 1.25rem auto;padding:.15rem .5rem;border:.1rem solid #fba7c6;border-radius:.5rem;color:#fba7c6;background-color:transparent;cursor:pointer;text-decoration:none transparent;transition:color .3s,background-color .3s}button[type=submit]:hover{color:#10102f;background-color:#fba7c6}label{cursor:pointer;margin:.25rem 0}label>input[type=radio]{-webkit-appearance:none;appearance:none;cursor:pointer;margin:0 .5rem -0.25rem 1rem;padding:0;width:1.25rem;height:1.25rem;background-color:#e0e0ff;border:.25rem solid #e0e0ff;border-radius:100%}label>input[type=radio]:checked{border-color:#ee588f}label:hover>input[type=radio]{background-color:#fba7c6}#search{display:grid;grid-template-columns:2fr 1fr;grid-template-columns:repeat(auto, 4);grid-template-areas:"header header" "map map" "category category" "stars sort" "submit submit";width:min(90ch,80vw);margin:2rem 10vw}#search>*{width:100%}#search h1{grid-area:header}#search #map{grid-area:map}#search #categories{grid-area:category}#search #stars{grid-area:stars}#search .sorting{grid-area:sort;display:flex;flex-direction:column}#search button[type=submit]{grid-area:submit;width:max-content;margin:auto}.pages{width:100%;justify-content:center}.page{margin:.5rem;padding:.15rem .5rem;border:.1rem solid #fba7c6;border-radius:.5rem;color:#fba7c6;background-color:transparent;cursor:pointer;text-decoration:none transparent;transition:color .3s,background-color .3s}.page:hover{color:#10102f;background-color:#fba7c6}.page.current-page{color:#ee588f;border-color:#ee588f}.page.current-page:hover{color:#10102f;background-color:#ee588f}tr{width:max-content}tr td{padding:.25rem 0;vertical-align:middle;width:max-content}tr td:first-child{padding:.25rem 1.5rem .25rem 0}footer{display:flex;flex-direction:column;align-items:center;margin:5vh 2rem}footer a{color:#74b6fb;font-size:.8rem}

View File

@ -3,6 +3,10 @@
Made with <3 by team qwik
</p>
<p>
<a href="https://git.qwik.space/BurnyLlama/ddstats-server">Source Code</a> • <a href="/api/reference">API Reference</a> • <a href="/status">Server Status</a>
<a href="https://git.qwik.space/BurnyLlama/ddstats-server">Source Code</a> •
<a href="/api-reference">API Reference</a> •
<a href="/credits">Credits</a> •
<a href="/changelog">Changelogs</a> •
<a href="/status">Server Status</a>
</p>
</footer>

View File

@ -1,5 +1,5 @@
<nav>
<div class="logo"></div>
<a href="/" class="logo"></a>
<a href="/maps" class="{{ "current" if options.currentSection == "maps" }}">Maps</a>
<a href="/leaderboards" class="{{ "current" if options.currentSection == "leaderboards" }}">Leaderboards</a>

View File

@ -0,0 +1,25 @@
{% extends "../templates/basic.njk" %}
{% block head %}
<title>DDStats - Changelogs</title>
{% endblock %}
{% block body %}
<main class="flex-container">
<div class="long-text">
<h1>Changelogs!</h1>
<h2>v0.1.0 - Late November 2021</h2>
<p>
Initial release! Includes functionality such as:
<ul>
<li>Searching for maps and players.</li>
<li>Server status page.</li>
<li>Lazy-loading images.</li>
<li>Leaderboards.</li>
<li>Public API (No reference yet!)</li>
</ul>
</p>
</div>
</main>
{% endblock %}

37
views/pages/credits.njk Normal file
View File

@ -0,0 +1,37 @@
{% extends "../templates/basic.njk" %}
{% block head %}
<title>DDStats - Credits</title>
{% endblock %}
{% block body %}
<main class="flex-container">
<div class="long-text">
<h1>Credits!</h1>
<h2>Team qwik</h2>
<p>
The developers of <a href="https://qwik.space">qwik</a> are the main working force behind DDStats.
BurnyLlama is the main designer and developer of the UI and API, while furo (Yumiko) is the
"database engineer". (That means he does a lot of scuffed things so that the stats can be presented.)<br>
This DDStats instance is also hosted by BurnyLlama.
</p>
<h2>deen & DDNet</h2>
<p>
Deen has both provided us with help and guidence, as well as with data. Also, since this project
shows stats for DDNet, DDNet is also important!
</p>
<h2>Node packages used</h2>
<p>
We also have some dependencies: <br>
<a href="https://www.npmjs.com/package/@msgpack/msgpack">@msgpack/msgpack</a>,
<a href="https://www.npmjs.com/package/better-sqlite3">better-sqlite3</a>,
<a href="https://www.npmjs.com/package/dotenv">dotenv</a>,
<a href="https://www.npmjs.com/package/express">express</a>,
<a href="https://www.npmjs.com/package/nunjucks">nunjucks</a>
</p>
</div>
</main>
{% endblock %}

13
views/pages/reference.njk Normal file
View File

@ -0,0 +1,13 @@
{% extends "../templates/basic.njk" %}
{% block head %}
<title>DDStats - API Reference</title>
{% endblock %}
{% block body %}
<main class="flex-container">
<div class="long-text">
<h1 style="text-align: center">Coming Soon™!</h1>
</div>
</main>
{% endblock %}