This commit is contained in:
parent
a8d8f7014a
commit
e6b8175662
5 changed files with 24 additions and 19 deletions
|
@ -10,7 +10,7 @@ const build = async () => {
|
||||||
minify: !development,
|
minify: !development,
|
||||||
sourcemap: development ? "inline" : "none",
|
sourcemap: development ? "inline" : "none",
|
||||||
splitting: true,
|
splitting: true,
|
||||||
publicPath: "/assets/"
|
publicPath: "/assets/",
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -65,10 +65,7 @@ const postAnalytics = async (
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"User-Agent": req.headers.get("user-agent") || "",
|
"User-Agent": req.headers.get("user-agent") || "",
|
||||||
"X-Forwarded-For": String(
|
"X-Forwarded-For": String(
|
||||||
cfIp ||
|
cfIp || realIp || forwardedIp?.split(",")[0] || serverIp,
|
||||||
realIp ||
|
|
||||||
forwardedIp?.split(",")[0] ||
|
|
||||||
serverIp,
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
|
|
|
@ -24,4 +24,4 @@ export default () => {
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -37,13 +37,18 @@ export default () => {
|
||||||
container.current.textContent = JSON.stringify(
|
container.current.textContent = JSON.stringify(
|
||||||
{
|
{
|
||||||
status: lanyard.discord_status,
|
status: lanyard.discord_status,
|
||||||
activities: [... new Set(lanyard.activities.map((act) => {
|
activities: [
|
||||||
const type = activityTypes[act.type];
|
...new Set(
|
||||||
const parts = [`${type} ${act.name}`];
|
lanyard.activities.map((act) => {
|
||||||
if (act.details && act.details !== act.name) parts.push(act.details);
|
const type = activityTypes[act.type];
|
||||||
if (act.state && act.state !== act.name) parts.push(act.state);
|
const parts = [`${type} ${act.name}`];
|
||||||
return parts;
|
if (act.details && act.details !== act.name)
|
||||||
}))],
|
parts.push(act.details);
|
||||||
|
if (act.state && act.state !== act.name) parts.push(act.state);
|
||||||
|
return parts;
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
2,
|
2,
|
||||||
|
|
|
@ -14,9 +14,11 @@ body {
|
||||||
body {
|
body {
|
||||||
color: #dedede;
|
color: #dedede;
|
||||||
text-shadow: 0 0 5px #c8c8c8;
|
text-shadow: 0 0 5px #c8c8c8;
|
||||||
background: radial-gradient(at bottom right,
|
background: radial-gradient(
|
||||||
var(--gradient-color, rgba(150, 150, 150, 0.1)) 0%,
|
at bottom right,
|
||||||
rgba(0, 0, 0, 1) 100%);
|
var(--gradient-color, rgba(150, 150, 150, 0.1)) 0%,
|
||||||
|
rgba(0, 0, 0, 1) 100%
|
||||||
|
);
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
|
@ -39,4 +41,4 @@ p {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
gap: 0.4em;
|
gap: 0.4em;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ let lanyard: LanyardData = {
|
||||||
activities: [],
|
activities: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
await fs.rm("./dist", { recursive: true, force: true }).catch(() => { });
|
await fs.rm("./dist", { recursive: true, force: true }).catch(() => {});
|
||||||
|
|
||||||
if (!Backend.development) {
|
if (!Backend.development) {
|
||||||
await Backend.build();
|
await Backend.build();
|
||||||
|
@ -30,7 +30,8 @@ const server = serve({
|
||||||
"/assets/:file": async (req) =>
|
"/assets/:file": async (req) =>
|
||||||
Backend.Responses.file(file(`./dist/${req.params.file}`)),
|
Backend.Responses.file(file(`./dist/${req.params.file}`)),
|
||||||
|
|
||||||
"/robots.txt": async () => Backend.Responses.file(file("./public/robots.txt")),
|
"/robots.txt": async () =>
|
||||||
|
Backend.Responses.file(file("./public/robots.txt")),
|
||||||
"/favicon.svg": async () =>
|
"/favicon.svg": async () =>
|
||||||
Backend.Responses.file(file("./public/favicon.svg")),
|
Backend.Responses.file(file("./public/favicon.svg")),
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue