mirror of
https://github.com/NohamR/lanyard-profile-readme.git
synced 2026-05-26 04:17:19 +00:00
chore(landing): general cleanup + ui touchup
This commit is contained in:
@@ -2,16 +2,8 @@
|
||||
import redis from "@/utils/redis";
|
||||
|
||||
export async function getUserCount() {
|
||||
let users = await redis.hgetall("users");
|
||||
let count = Object.keys(users);
|
||||
let users = await redis.hgetall("users");
|
||||
let count = Object.keys(users);
|
||||
|
||||
return count.length;
|
||||
}
|
||||
|
||||
export async function isUserMonitored(userId: string) {
|
||||
const user = await fetch(`https://api.lanyard.rest/v1/users/${userId}`, {
|
||||
cache: "no-store",
|
||||
}).then((res) => res.json());
|
||||
|
||||
return user.success === true;
|
||||
return count.length;
|
||||
}
|
||||
|
||||
@@ -1,205 +0,0 @@
|
||||
export type Parameters = {
|
||||
theme?: string;
|
||||
bg?: string;
|
||||
clanbg?: string;
|
||||
animated?: string;
|
||||
animatedDecoration?: string;
|
||||
hideDiscrim?: string;
|
||||
hideStatus?: string;
|
||||
hideTimestamp?: string;
|
||||
hideBadges?: string;
|
||||
hideProfile?: string;
|
||||
hideActivity?: string;
|
||||
hideSpotify?: string;
|
||||
hideClan?: string;
|
||||
hideDecoration?: string;
|
||||
ignoreAppId?: string;
|
||||
showDisplayName?: string;
|
||||
borderRadius?: string;
|
||||
idleMessage?: string;
|
||||
};
|
||||
|
||||
export const parameterInfo: Array<
|
||||
| {
|
||||
parameter: string;
|
||||
type: "boolean";
|
||||
title: string;
|
||||
description?: string;
|
||||
options?: {
|
||||
defaultBool?: boolean;
|
||||
};
|
||||
}
|
||||
| {
|
||||
parameter: string;
|
||||
type: "string";
|
||||
title: string;
|
||||
description?: string;
|
||||
options?: {
|
||||
placeholder?: string;
|
||||
omit?: string[];
|
||||
};
|
||||
}
|
||||
| {
|
||||
parameter: string;
|
||||
type: "list";
|
||||
title: string;
|
||||
description?: string;
|
||||
options: {
|
||||
list: Array<{
|
||||
name: string;
|
||||
value: string;
|
||||
}>;
|
||||
};
|
||||
}
|
||||
> = [
|
||||
{
|
||||
parameter: "theme",
|
||||
type: "list",
|
||||
title: "Theme",
|
||||
description:
|
||||
'This will change the background and the font colors, but the background can be overridden with the "Background Color" parameter.',
|
||||
options: {
|
||||
list: [
|
||||
{
|
||||
name: "Light",
|
||||
value: "light",
|
||||
},
|
||||
{
|
||||
name: "Dark",
|
||||
value: "dark",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
parameter: "bg",
|
||||
type: "string",
|
||||
title: "Background Color",
|
||||
description:
|
||||
"This will change the background color. Must be in hex format. Omit the # symbol.",
|
||||
options: {
|
||||
placeholder: "1A1C1F",
|
||||
omit: ["#"],
|
||||
},
|
||||
},
|
||||
{
|
||||
parameter: "borderRadius",
|
||||
type: "string",
|
||||
title: "Border Radius",
|
||||
description:
|
||||
"This will change the border radius of the card. Must have a size unit (px, rem, em, and more).",
|
||||
options: {
|
||||
placeholder: "10px",
|
||||
},
|
||||
},
|
||||
{
|
||||
parameter: "animated",
|
||||
type: "boolean",
|
||||
title: "Toggle Animated Avatar",
|
||||
description:
|
||||
"If you have an animated avatar, but don't want it animated, this is the right option.",
|
||||
options: {
|
||||
defaultBool: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
parameter: "idleMessage",
|
||||
type: "string",
|
||||
title: "Idle Message",
|
||||
description:
|
||||
"If you don't want the default \"I'm not currently doing anything!\" as your idle message, this is the right option.",
|
||||
options: {
|
||||
placeholder: "I'm not currently doing anything!",
|
||||
},
|
||||
},
|
||||
{
|
||||
parameter: "showDisplayName",
|
||||
type: "boolean",
|
||||
title: "Show Display Name",
|
||||
description:
|
||||
"If you'd like to show your global display name as well as your username, this is the right option.",
|
||||
},
|
||||
{
|
||||
parameter: "animatedDecoration",
|
||||
type: "boolean",
|
||||
title: "Toggle Animated Avatar Decoration",
|
||||
description:
|
||||
"If you have an Animated Avatar Decoration, but don't want it animated, this is the right option.",
|
||||
options: {
|
||||
defaultBool: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
parameter: "hideDecoration",
|
||||
type: "boolean",
|
||||
title: "Hide Avatar Decoration",
|
||||
description:
|
||||
"If you don't want people seeing your Avatar Decoration, this is the right option.",
|
||||
},
|
||||
{
|
||||
parameter: "hideStatus",
|
||||
type: "boolean",
|
||||
title: "Hide Status",
|
||||
description:
|
||||
"If you don't want people seeing your status, this is the right option.",
|
||||
},
|
||||
{
|
||||
parameter: "hideTimestamp",
|
||||
type: "boolean",
|
||||
title: "Hide Elapsed Time",
|
||||
description:
|
||||
"If you don't want people seeing the elapsed time on an activity, this is the right option.",
|
||||
},
|
||||
{
|
||||
parameter: "hideClan",
|
||||
type: "boolean",
|
||||
title: "Hide Clan Tag",
|
||||
description:
|
||||
"If you don't want people seeing your Guild Tag (formerly known as Clans), this is the right option.",
|
||||
},
|
||||
{
|
||||
parameter: "hideBadges",
|
||||
type: "boolean",
|
||||
title: "Hide Badges",
|
||||
description:
|
||||
"If you don't want people seeing your Badges, this is the right option.",
|
||||
},
|
||||
{
|
||||
parameter: "hideProfile",
|
||||
type: "boolean",
|
||||
title: "Hide Profile",
|
||||
description:
|
||||
"If you don't want people seeing your Profile, this is the right option.",
|
||||
},
|
||||
{
|
||||
parameter: "hideActivity",
|
||||
type: "boolean",
|
||||
title: "Hide Activity",
|
||||
description:
|
||||
"If you don't want people seeing your activity, this is the right option.",
|
||||
},
|
||||
{
|
||||
parameter: "hideSpotify",
|
||||
type: "boolean",
|
||||
title: "Hide Spotify",
|
||||
description:
|
||||
"If you don't want people seeing your Spotify activity, this is the right option.",
|
||||
},
|
||||
{
|
||||
parameter: "ignoreAppId",
|
||||
type: "string",
|
||||
title: "Hide App by ID",
|
||||
description:
|
||||
"If you don't want to display a specific application, this is the right option. IDs separate by ','",
|
||||
options: {
|
||||
placeholder: "1302143410907648071, 1302132259368861759",
|
||||
},
|
||||
},
|
||||
{
|
||||
parameter: "hideDiscrim",
|
||||
type: "boolean",
|
||||
title: "Hide Discriminator (DEPRECATED)",
|
||||
description:
|
||||
"If you don't want people seeing your Discriminator, this is the right option. (DEPRECATED)",
|
||||
},
|
||||
];
|
||||
191
src/utils/parameters.ts
Normal file
191
src/utils/parameters.ts
Normal file
@@ -0,0 +1,191 @@
|
||||
export type Parameters = {
|
||||
theme?: string;
|
||||
bg?: string;
|
||||
clanbg?: string;
|
||||
animated?: string;
|
||||
animatedDecoration?: string;
|
||||
hideDiscrim?: string;
|
||||
hideStatus?: string;
|
||||
hideTimestamp?: string;
|
||||
hideBadges?: string;
|
||||
hideProfile?: string;
|
||||
hideActivity?: string;
|
||||
hideSpotify?: string;
|
||||
hideClan?: string;
|
||||
hideDecoration?: string;
|
||||
ignoreAppId?: string;
|
||||
showDisplayName?: string;
|
||||
borderRadius?: string;
|
||||
idleMessage?: string;
|
||||
};
|
||||
|
||||
export const PARAMETERS: Array<
|
||||
{ deprecated?: boolean } & (
|
||||
| {
|
||||
parameter: string;
|
||||
type: "boolean";
|
||||
title: string;
|
||||
description?: string;
|
||||
options?: {
|
||||
defaultBool?: boolean;
|
||||
};
|
||||
}
|
||||
| {
|
||||
parameter: string;
|
||||
type: "string";
|
||||
title: string;
|
||||
description?: string;
|
||||
options?: {
|
||||
placeholder?: string;
|
||||
omit?: string[];
|
||||
};
|
||||
}
|
||||
| {
|
||||
parameter: string;
|
||||
type: "list";
|
||||
title: string;
|
||||
description?: string;
|
||||
options: {
|
||||
list: Array<{
|
||||
name: string;
|
||||
value: string;
|
||||
}>;
|
||||
};
|
||||
}
|
||||
)
|
||||
> = [
|
||||
{
|
||||
parameter: "theme",
|
||||
type: "list",
|
||||
title: "Theme",
|
||||
description: "Changes the background and text colors. Can be overridden with the `bg` parameter.",
|
||||
options: {
|
||||
list: [
|
||||
{
|
||||
name: "Light",
|
||||
value: "light",
|
||||
},
|
||||
{
|
||||
name: "Dark",
|
||||
value: "dark",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
parameter: "bg",
|
||||
type: "string",
|
||||
title: "Background Color",
|
||||
description: "Changes the background color to a hex color (no octothorpe).",
|
||||
options: {
|
||||
placeholder: "1A1C1F",
|
||||
omit: ["#"],
|
||||
},
|
||||
},
|
||||
{
|
||||
parameter: "borderRadius",
|
||||
type: "string",
|
||||
title: "Border Radius",
|
||||
description: "Changes the border radius of the card. Follows the CSS <length> spec (px, rem, etc.).",
|
||||
options: {
|
||||
placeholder: "10px",
|
||||
},
|
||||
},
|
||||
{
|
||||
parameter: "animated",
|
||||
type: "boolean",
|
||||
title: "Disable Animated Avatar",
|
||||
description: "Disables an animated avatar.",
|
||||
options: {
|
||||
defaultBool: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
parameter: "idleMessage",
|
||||
type: "string",
|
||||
title: "Idle Message",
|
||||
description: 'Changes the idle message. Defaults to "I\'m not currently doing anything!".',
|
||||
options: {
|
||||
placeholder: "I'm not currently doing anything!",
|
||||
},
|
||||
},
|
||||
{
|
||||
parameter: "showDisplayName",
|
||||
type: "boolean",
|
||||
title: "Show Display Name",
|
||||
description: "Shows your global display name alongside your username.",
|
||||
},
|
||||
{
|
||||
parameter: "animatedDecoration",
|
||||
type: "boolean",
|
||||
title: "Disable Animated Avatar Decoration",
|
||||
description: "Disables animated avatar decorations.",
|
||||
options: {
|
||||
defaultBool: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
parameter: "hideDecoration",
|
||||
type: "boolean",
|
||||
title: "Hide Avatar Decoration",
|
||||
description: "Hides any avatar decorations.",
|
||||
},
|
||||
{
|
||||
parameter: "hideStatus",
|
||||
type: "boolean",
|
||||
title: "Hide Status",
|
||||
description: "Hides your custom Discord status.",
|
||||
},
|
||||
{
|
||||
parameter: "hideTimestamp",
|
||||
type: "boolean",
|
||||
title: "Hide Activity Time",
|
||||
description: "Hides the time spent on an activity.",
|
||||
},
|
||||
{
|
||||
parameter: "hideClan",
|
||||
type: "boolean",
|
||||
title: "Hide Clan Tag",
|
||||
description: "Hides your Guild Tag (formerly Clan Tag)",
|
||||
},
|
||||
{
|
||||
parameter: "hideBadges",
|
||||
type: "boolean",
|
||||
title: "Hide Badges",
|
||||
description: "Hides your profile badges.",
|
||||
},
|
||||
{
|
||||
parameter: "hideProfile",
|
||||
type: "boolean",
|
||||
title: "Hide Profile",
|
||||
description: "Hides your profile, keeps your activity.",
|
||||
},
|
||||
{
|
||||
parameter: "hideActivity",
|
||||
type: "boolean",
|
||||
title: "Hide Activity",
|
||||
description: "Hides your activity, keeps your profile.",
|
||||
},
|
||||
{
|
||||
parameter: "hideSpotify",
|
||||
type: "boolean",
|
||||
title: "Hide Spotify",
|
||||
description: "Hides your Spotify activity only.",
|
||||
},
|
||||
{
|
||||
parameter: "ignoreAppId",
|
||||
type: "string",
|
||||
title: "Hide App by ID",
|
||||
description: "Hide apps by their respective ID, as a comma-separated list.",
|
||||
options: {
|
||||
placeholder: "1302143410907648071, 1302132259368861759",
|
||||
},
|
||||
},
|
||||
{
|
||||
parameter: "hideDiscrim",
|
||||
type: "boolean",
|
||||
title: "Hide Discriminator",
|
||||
description: "Hides your discriminator. (DEPRECATED, RIP)",
|
||||
deprecated: true,
|
||||
},
|
||||
].sort((a, b) => b.type.localeCompare(a.type));
|
||||
Reference in New Issue
Block a user