lots of changes
This commit is contained in:
parent
304d0ccb96
commit
f7fd3b99a4
60 changed files with 3029 additions and 878 deletions
121
Dashboard/assets/css/main.css
Normal file
121
Dashboard/assets/css/main.css
Normal file
|
@ -0,0 +1,121 @@
|
|||
@import url("https://fonts.googleapis.com/css?family=Montserrat&display=swap");
|
||||
.center {
|
||||
position: absolute;
|
||||
top: 40%;
|
||||
left: 50%;
|
||||
-webkit-transform: translate(-50%, -50%);
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Montserrat', sans-serif;
|
||||
background: #131313;
|
||||
color: white;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 6vh;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
font-size: 5vh;
|
||||
padding: 1vh;
|
||||
}
|
||||
|
||||
.Stats {
|
||||
font-size: 3vh;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.rainbow {
|
||||
text-align: center;
|
||||
text-decoration: underline;
|
||||
font-size: 32px;
|
||||
font-family: monospace;
|
||||
letter-spacing: 5px;
|
||||
}
|
||||
|
||||
.rainbow_text_animated {
|
||||
background: -webkit-gradient(linear, left top, right top, from(#6666ff), color-stop(#0099ff), color-stop(#00ff00), color-stop(#ff3399), to(#6666ff));
|
||||
background: linear-gradient(to right, #6666ff, #0099ff, #00ff00, #ff3399, #6666ff);
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
color: transparent;
|
||||
-webkit-animation: rainbow_animation 6s ease-in-out infinite;
|
||||
animation: rainbow_animation 6s ease-in-out infinite;
|
||||
background-size: 400% 100%;
|
||||
}
|
||||
|
||||
@-webkit-keyframes rainbow_animation {
|
||||
0%,
|
||||
100% {
|
||||
background-position: 0 0;
|
||||
}
|
||||
50% {
|
||||
background-position: 100% 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rainbow_animation {
|
||||
0%,
|
||||
100% {
|
||||
background-position: 0 0;
|
||||
}
|
||||
50% {
|
||||
background-position: 100% 0;
|
||||
}
|
||||
}
|
||||
|
||||
.source,
|
||||
.invite,
|
||||
.support {
|
||||
font-family: 'Montserrat', sans-serif;
|
||||
background-color: #ffffff;
|
||||
/* Green */
|
||||
border: none;
|
||||
/* border-radius: 1vh; */
|
||||
padding: 1vh;
|
||||
margin: 1vh;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
font-size: 2vh;
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.source a,
|
||||
.invite a,
|
||||
.support a {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.icon {
|
||||
display: inline-block;
|
||||
vertical-align: left;
|
||||
width: auto;
|
||||
height: 10vh;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
divide {
|
||||
display: block;
|
||||
height: 1px;
|
||||
border: 0;
|
||||
border-top: 0px solid rgba(204, 204, 204, 0);
|
||||
margin: 1em 0;
|
||||
padding: 1em;
|
||||
}
|
||||
/*# sourceMappingURL=main.css.map */
|
9
Dashboard/assets/css/main.css.map
Normal file
9
Dashboard/assets/css/main.css.map
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"version": 3,
|
||||
"mappings": "AAkCA,OAAO,CAAC,sEAAI;AACZ,AAAA,OAAO,CAAC;EAlCP,QAAQ,EAAE,QAAQ;EAGjB,GAAG,EAAE,GAAG;EACR,IAAI,EAAE,GAAG;EACT,SAAS,EAAE,qBAAqB;CA+BjC;;AACD,AAAA,IAAI,CAAC;EACJ,WAAW,EAAE,wBAAwB;EACrC,UAAU,EAAE,OAAO;EACnB,KAAK,EAAE,KAAK;CACZ;;AACD,AAAA,EAAE,CAAC;EACF,UAAU,EAAE,IAAI;CAChB;;AACD,AAAA,CAAC,CAAC;EACD,eA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KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,aAAa,EAAE,GAAG;CAClB;;AAED,AAAA,mBAAmB,CAAC;EACnB,OAAO,EAAE,IAAI;CACb;;AAED,AAAA,MAAM,CAAC;EACN,OAAO,EAAE,KAAK;EACd,MAAM,EAAE,GAAG;EACX,MAAM,EAAE,CAAC;EACT,UAAU,EAAE,GAAG,CAAC,KAAK,CAAC,sBAAsB;EAC5C,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,GAAG;CACZ",
|
||||
"sources": [
|
||||
"main.scss"
|
||||
],
|
||||
"names": [],
|
||||
"file": "main.css"
|
||||
}
|
116
Dashboard/assets/css/main.scss
Normal file
116
Dashboard/assets/css/main.scss
Normal file
|
@ -0,0 +1,116 @@
|
|||
@mixin centerer($horizontal: true, $vertical: true) {
|
||||
position: absolute;
|
||||
|
||||
@if ($horizontal and $vertical) {
|
||||
top: 40%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
} @else if ($horizontal) {
|
||||
left: 50%;
|
||||
transform: translate(-50%, 0);
|
||||
} @else if ($vertical) {
|
||||
top: 50%;
|
||||
transform: translate(0, -50%);
|
||||
}
|
||||
}
|
||||
|
||||
@mixin Buttons {
|
||||
font-family: 'Montserrat', sans-serif;
|
||||
background-color: #ffffff; /* Green */
|
||||
border: none;
|
||||
/* border-radius: 1vh; */
|
||||
padding: 1vh;
|
||||
margin: 1vh;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
font-size: 2vh;
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
a {
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@import url('https://fonts.googleapis.com/css?family=Montserrat&display=swap');
|
||||
.center {
|
||||
@include centerer;
|
||||
}
|
||||
body {
|
||||
font-family: 'Montserrat', sans-serif;
|
||||
background: #131313;
|
||||
color: white;
|
||||
}
|
||||
ul {
|
||||
list-style: none;
|
||||
}
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 6vh;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
font-size: 5vh;
|
||||
padding: 1vh;
|
||||
}
|
||||
|
||||
.Stats {
|
||||
font-size: 3vh;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.rainbow {
|
||||
text-align: center;
|
||||
text-decoration: underline;
|
||||
font-size: 32px;
|
||||
font-family: monospace;
|
||||
letter-spacing: 5px;
|
||||
}
|
||||
.rainbow_text_animated {
|
||||
background: linear-gradient(to right, #6666ff, #0099ff, #00ff00, #ff3399, #6666ff);
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
color: transparent;
|
||||
animation: rainbow_animation 6s ease-in-out infinite;
|
||||
background-size: 400% 100%;
|
||||
}
|
||||
|
||||
@keyframes rainbow_animation {
|
||||
0%,
|
||||
100% {
|
||||
background-position: 0 0;
|
||||
}
|
||||
|
||||
50% {
|
||||
background-position: 100% 0;
|
||||
}
|
||||
}
|
||||
|
||||
.source,
|
||||
.invite,
|
||||
.support {
|
||||
@include Buttons();
|
||||
}
|
||||
.icon {
|
||||
display: inline-block;
|
||||
vertical-align: left;
|
||||
width: auto;
|
||||
height: 10vh;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
divide {
|
||||
display: block;
|
||||
height: 1px;
|
||||
border: 0;
|
||||
border-top: 0px solid rgba(204, 204, 204, 0);
|
||||
margin: 1em 0;
|
||||
padding: 1em;
|
||||
}
|
BIN
Dashboard/assets/images/icon.png
Normal file
BIN
Dashboard/assets/images/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 979 KiB |
97
Dashboard/server.js
Executable file
97
Dashboard/server.js
Executable file
|
@ -0,0 +1,97 @@
|
|||
const express = require('express');
|
||||
const { hostname, port, authorization, source, invite, type } = require('../config');
|
||||
const db = require('quick.db');
|
||||
const Backend = new db.table('backend');
|
||||
const chalk = require('chalk');
|
||||
const helmet = require('helmet');
|
||||
const compression = require('compression');
|
||||
const cors = require('cors');
|
||||
const morgan = require('morgan');
|
||||
var hbs = require('express-handlebars');
|
||||
|
||||
const app = express();
|
||||
|
||||
app.set('view engine', 'hbs');
|
||||
app.engine(
|
||||
'hbs',
|
||||
hbs({
|
||||
extname: 'hbs',
|
||||
defaultView: 'default'
|
||||
})
|
||||
);
|
||||
app.set('json spaces', 4);
|
||||
app.use('/assets', express.static(__dirname + '/assets'));
|
||||
app.set('view options', {
|
||||
layout: false
|
||||
});
|
||||
|
||||
app.use(express.json());
|
||||
app.use(express.urlencoded({ extended: true }));
|
||||
app.use(helmet());
|
||||
app.use(compression());
|
||||
app.use(cors());
|
||||
// Logging
|
||||
app.use(
|
||||
morgan((tokens, req, res) => {
|
||||
return [
|
||||
chalk.hex('#34ace0').bold(tokens.method(req, res)),
|
||||
chalk.hex('#ffb142').bold(tokens.status(req, res)),
|
||||
chalk.hex('#ff5252').bold(req.hostname + tokens.url(req, res)),
|
||||
chalk.hex('#2ed573').bold(tokens['response-time'](req, res) + 'ms'),
|
||||
chalk.hex('#f78fb3').bold('@ ' + tokens.date(req, res))
|
||||
].join(' ');
|
||||
})
|
||||
);
|
||||
let support = 'https://discord.gg/' + Backend.get('Info.invite');
|
||||
module.exports = (client) => {
|
||||
app.get('/', async (req, res) => {
|
||||
res.status(200).render('index', {
|
||||
layout: 'main',
|
||||
title: 'Thaldrin',
|
||||
subtitle: 'A Random Image and Utility Bot',
|
||||
bot: {
|
||||
users: client.users.size,
|
||||
guilds: client.guilds.size,
|
||||
channels: client.channels.size,
|
||||
commands: client.commands.size,
|
||||
invite: `https://${req.hostname}${type.beta ? ':8080' : ''}/invite`,
|
||||
source: `https://${req.hostname}${type.beta ? ':8080' : ''}/source`,
|
||||
support: `https://${req.hostname}${type.beta ? ':8080' : ''}/discord`
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
app.get('/discord', async (req, res) => {
|
||||
res.redirect(support);
|
||||
});
|
||||
app.get('/source', async (req, res) => {
|
||||
res.redirect(source);
|
||||
});
|
||||
app.get('/invite', async (req, res) => {
|
||||
res.redirect(invite);
|
||||
});
|
||||
/* app.get('/this', async (req, res) => {
|
||||
res.json(client);
|
||||
}); */
|
||||
|
||||
/* app.post('/vote', async (req, res) => {
|
||||
const body = req.body;
|
||||
const auth = req.header('Authorization');
|
||||
|
||||
if (auth != authorization) return res.status(403), console.warn(`Vote rejected with authorization '${auth}'`);
|
||||
// if (body.bot != client.user.id) return res.status(403), console.warn(`Vote rejected with ID '${body.bot}'`);
|
||||
|
||||
if (body.type == 'test') {
|
||||
console.log(`Test succeeded, is weekend:`, body.isWeekend);
|
||||
} else {
|
||||
console.log(`Vote`)
|
||||
client.vote(body.user);
|
||||
}
|
||||
}); */
|
||||
|
||||
app.listen(port, hostname, () => {
|
||||
setTimeout(() => {
|
||||
console.log(`Listening on ${hostname}:${port}`);
|
||||
}, 1000 * 3);
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue