mirror of
https://github.com/NohamR/lanyard-profile-readme.git
synced 2026-05-26 04:17:19 +00:00
native emoji support
This commit is contained in:
@@ -7,7 +7,7 @@ _Special thanks to [@Phineas](https://github.com/Phineas/) for creating Lanyard,
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
First, join the Lanyard [Discord](https://discord.gg/gYTp9JHrhg) (if you haven't already) for this to work.
|
First, join the Lanyard [Discord](https://discord.com/invite/WScAm7vNGF) (if you haven't already) for this to work.
|
||||||
|
|
||||||
In a `README.md` file, include the following, replacing `:id` with your Discord user ID:
|
In a `README.md` file, include the following, replacing `:id` with your Discord user ID:
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export default function Home() {
|
|||||||
|
|
||||||
<Container>
|
<Container>
|
||||||
|
|
||||||
<p style={{fontSize: "1rem", fontWeight: "bold", marginTop: "1rem"}}>Make sure you're in the <a style={{color: "#fff"}} rel="noreferrer" href="https://discord.gg/gYTp9JHrhg">Discord</a> for this to work.</p>
|
<p style={{fontSize: "1rem", fontWeight: "bold", marginTop: "1rem"}}>Make sure you're in the <a style={{color: "#fff"}} rel="noreferrer" href="https://discord.com/invite/WScAm7vNGF">Discord</a> for this to work.</p>
|
||||||
|
|
||||||
<Input maxLength={18} type="text" placeholder="Paste your Discord user ID here" onChange={((e) => setUserId(e.target.value))}>
|
<Input maxLength={18} type="text" placeholder="Paste your Discord user ID here" onChange={((e) => setUserId(e.target.value))}>
|
||||||
|
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise<
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
">
|
">
|
||||||
${body.data.activities[0].emoji ?
|
${body.data.activities[0].emoji && body.data.activities[0].emoji.id ?
|
||||||
`<img src="data:image/png;base64,${await encodeBase64(`https://cdn.discordapp.com/emojis/${body.data.activities[0].emoji.id}.${statusExtension}`)}" style="
|
`<img src="data:image/png;base64,${await encodeBase64(`https://cdn.discordapp.com/emojis/${body.data.activities[0].emoji.id}.${statusExtension}`)}" style="
|
||||||
width: 15px;
|
width: 15px;
|
||||||
height: 15px;
|
height: 15px;
|
||||||
@@ -172,7 +172,13 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise<
|
|||||||
margin: 0 2px 0 0;
|
margin: 0 2px 0 0;
|
||||||
" />`
|
" />`
|
||||||
: ``}
|
: ``}
|
||||||
${userStatus}
|
|
||||||
|
${body.data.activities[0].emoji && !body.data.activities[0].emoji.id ?
|
||||||
|
body.data.activities[0].emoji.name + ' ' + userStatus
|
||||||
|
:
|
||||||
|
userStatus
|
||||||
|
}
|
||||||
|
|
||||||
</h1>`
|
</h1>`
|
||||||
: ``}
|
: ``}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user