mirror of
https://github.com/NohamR/lanyard-profile-readme.git
synced 2026-05-26 13:41:32 +00:00
Merge pull request #42 from brokiem/patch-1
Add option to hide Discord profile with hideProfile=true
This commit is contained in:
@@ -61,6 +61,10 @@ If you don't want people seeing the elapsed time on an activity, append the quer
|
|||||||
|
|
||||||
If you don't want people seeing the badges you have on Discord, append the query param `hideBadges=true` to the end of the URL. Badges are shown by default.
|
If you don't want people seeing the badges you have on Discord, append the query param `hideBadges=true` to the end of the URL. Badges are shown by default.
|
||||||
|
|
||||||
|
### ___Hide Profile___
|
||||||
|
|
||||||
|
If you don't want people seeing the profile you have on Discord, append the query param `hideProfile=true` to the end of the URL. Profile are shown by default.
|
||||||
|
|
||||||
## ___Example URL and result___
|
## ___Example URL and result___
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ type Parameters = {
|
|||||||
hideStatus?: string;
|
hideStatus?: string;
|
||||||
hideTimestamp?: string;
|
hideTimestamp?: string;
|
||||||
hideBadges?: string;
|
hideBadges?: string;
|
||||||
|
hideProfile?: string;
|
||||||
borderRadius?: string;
|
borderRadius?: string;
|
||||||
idleMessage?: string;
|
idleMessage?: string;
|
||||||
};
|
};
|
||||||
@@ -55,6 +56,7 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise<
|
|||||||
hideStatus = "false",
|
hideStatus = "false",
|
||||||
hideTimestamp = "false",
|
hideTimestamp = "false",
|
||||||
hideBadges = "false",
|
hideBadges = "false",
|
||||||
|
hideProfile = "false",
|
||||||
borderRadius = "10px",
|
borderRadius = "10px",
|
||||||
idleMessage = "I'm not currently doing anything!";
|
idleMessage = "I'm not currently doing anything!";
|
||||||
|
|
||||||
@@ -65,6 +67,7 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise<
|
|||||||
if (params.hideTimestamp === "true") hideTimestamp = "true";
|
if (params.hideTimestamp === "true") hideTimestamp = "true";
|
||||||
if (params.hideBadges === "true") hideBadges = "true";
|
if (params.hideBadges === "true") hideBadges = "true";
|
||||||
if (params.hideDiscrim === "true") discrim = "hide";
|
if (params.hideDiscrim === "true") discrim = "hide";
|
||||||
|
if (params.hideProfile === "true") hideProfile = "true";
|
||||||
if (params.theme === "light") {
|
if (params.theme === "light") {
|
||||||
backgroundColor = "#eee";
|
backgroundColor = "#eee";
|
||||||
theme = "light";
|
theme = "light";
|
||||||
@@ -132,12 +135,12 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise<
|
|||||||
activity = Array.isArray(activities) ? activities[0] : activities;
|
activity = Array.isArray(activities) ? activities[0] : activities;
|
||||||
|
|
||||||
return `
|
return `
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xhtml="http://www.w3.org/1999/xhtml" width="410px" height="210px">
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xhtml="http://www.w3.org/1999/xhtml" width="410px" height="${hideProfile === "true" ? "130px" : "210px"}">
|
||||||
<foreignObject x="0" y="0" width="410" height="210">
|
<foreignObject x="0" y="0" width="410" height="${hideProfile === "true" ? "130" : "210"}">
|
||||||
<div xmlns="http://www.w3.org/1999/xhtml" style="
|
<div xmlns="http://www.w3.org/1999/xhtml" style="
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 400px;
|
width: 400px;
|
||||||
height: 200px;
|
height: ${hideProfile === "true" ? "120px" : "200px"};
|
||||||
inset: 0;
|
inset: 0;
|
||||||
background-color: #${backgroundColor};
|
background-color: #${backgroundColor};
|
||||||
color: ${theme === "dark" ? "#fff" : "#000"};
|
color: ${theme === "dark" ? "#fff" : "#000"};
|
||||||
@@ -148,6 +151,9 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise<
|
|||||||
padding: 5px;
|
padding: 5px;
|
||||||
border-radius: ${borderRadius};
|
border-radius: ${borderRadius};
|
||||||
">
|
">
|
||||||
|
|
||||||
|
${
|
||||||
|
hideProfile === "true" ? "" : `
|
||||||
<div style="
|
<div style="
|
||||||
width: 400px;
|
width: 400px;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
@@ -252,7 +258,8 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise<
|
|||||||
</h1>` : ``
|
</h1>` : ``
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>`
|
||||||
|
}
|
||||||
|
|
||||||
${
|
${
|
||||||
activity ? `
|
activity ? `
|
||||||
|
|||||||
Reference in New Issue
Block a user