Error page, code font

This commit is contained in:
bingus_violet 2023-12-18 21:38:09 +00:00
parent e574f3b4b5
commit 73d4d1511e
4 changed files with 19 additions and 4 deletions

View file

@ -79,7 +79,21 @@ app.get('/getUser', async (req, res) => {
res.header("Content-Type", "text/html")
var html = fs.readFileSync(path.join(__dirname, 'resources/userPage.html')).toString()
var result = (await fetch(`https://api.lanyard.rest/v1/users/${discID}`).then(response => response.json())).data
var data = (await fetch(`https://api.lanyard.rest/v1/users/${discID}`).then(response => response.json()))
var result = data.data
if (data.error) {
res.send(`
<link rel="stylesheet" href="./style.css">
<h1>Error!</h1>
<p>Code: ${data.error.code}<br>
Message: ${data.error.message}<br>
Double check the main page to ensure you've set things up right!
</p>
`)
return
}
var user = result.discord_user

View file

@ -7,12 +7,14 @@
<link rel="stylesheet" href="./style.css">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro&display=swap" rel="stylesheet">
<title>User - {DISPLAY_NAME}</title>
</head>
<body>
<h1>{DISPLAY_NAME}</h1>
<p style="color: gray">{USERNAME}</p>
<iframe style="width: 90%; max-width: 750px; height: 300px; overflow: visible;" src="./embedCard?discordid={DISCORD_ID}"></iframe>
<p>Code to embed:<br> <span style="font-family: Roboto;">&lt;iframe style="width: 90%; max-width: 750px; height: 300px;" src="{BASE_LINK}embedCard?discordid={DISCORD_ID}"&gt;&lt;/iframe&gt;</p></span>
<p>Code to embed:<br> <span style="font-family: 'Source Code Pro'; background-color: rgb(40, 40, 50); display: block;">&lt;iframe style="width: 90%; max-width: 750px; height: 300px;" src="{BASE_LINK}embedCard?discordid={DISCORD_ID}"&gt;&lt;/iframe&gt;</p></span>
</body>
</html>

View file

@ -1,5 +1,5 @@
@import url("https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css");
@import url('https://fonts.googleapis.com/css2?family=Rubik&family=Source+Code+Pro&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Rubik&display=swap');
body, input {
font-family: 'Rubik', Verdana, Geneva, Tahoma, sans-serif;

View file

@ -1,5 +1,4 @@
@import url("https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css");
@import url('https://fonts.googleapis.com/css2?family=Rubik&display=swap');
body {
background-color: rgb(40, 30, 60);