mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-09 14:43:03 -04:00
Add fullVcPfp (#134)
This commit is contained in:
parent
e47a87dcad
commit
b94a062dcd
3 changed files with 56 additions and 1 deletions
8
src/equicordplugins/fullVcPfp/index.css
Normal file
8
src/equicordplugins/fullVcPfp/index.css
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
div[data-selenium-video-tile] div[role="img"] {
|
||||||
|
width: 100% !important;
|
||||||
|
height: 100% !important;
|
||||||
|
border-radius: unset !important;
|
||||||
|
background: center / contain no-repeat;
|
||||||
|
background-image: var(--full-res-avatar);
|
||||||
|
> * { display: none; }
|
||||||
|
}
|
43
src/equicordplugins/fullVcPfp/index.tsx
Normal file
43
src/equicordplugins/fullVcPfp/index.tsx
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
/*
|
||||||
|
* Vencord, a Discord client mod
|
||||||
|
* Copyright (c) 2025 Vendicated and contributors
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { disableStyle, enableStyle } from "@api/Styles";
|
||||||
|
import { EquicordDevs } from "@utils/constants";
|
||||||
|
import definePlugin from "@utils/types";
|
||||||
|
import { IconUtils, UserStore } from "@webpack/common";
|
||||||
|
|
||||||
|
import style from "./index.css?managed";
|
||||||
|
export default definePlugin({
|
||||||
|
name: "fullVcPfp",
|
||||||
|
description: "Makes avatars take up the entire vc tile for a more dynamic and immersive experience 🚀",
|
||||||
|
authors: [EquicordDevs.mochienya],
|
||||||
|
patches: [{
|
||||||
|
find: "\"data-selenium-video-tile\":",
|
||||||
|
replacement: {
|
||||||
|
match: /(?<=function\((\i),\i\)\{)(?=let.{20,40},style:)/,
|
||||||
|
replace: "$1.style=$self.getVoiceBackgroundStyles($1);",
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
|
||||||
|
getVoiceBackgroundStyles({ className, participantUserId }: any) {
|
||||||
|
if (!className.includes("tile_")) return;
|
||||||
|
|
||||||
|
const user = UserStore.getUser(participantUserId);
|
||||||
|
|
||||||
|
const avatarUrl = IconUtils.getUserAvatarURL(user, false, 1024);
|
||||||
|
|
||||||
|
return {
|
||||||
|
"--full-res-avatar": `url(${avatarUrl})`,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
start() {
|
||||||
|
enableStyle(style);
|
||||||
|
},
|
||||||
|
stop() {
|
||||||
|
disableStyle(style);
|
||||||
|
},
|
||||||
|
});
|
|
@ -975,7 +975,11 @@ export const EquicordDevs = Object.freeze({
|
||||||
OIRNOIR: {
|
OIRNOIR: {
|
||||||
name: "OIRNOIR",
|
name: "OIRNOIR",
|
||||||
id: 720842469024989195n
|
id: 720842469024989195n
|
||||||
}
|
},
|
||||||
|
mochienya: {
|
||||||
|
name: "mochie",
|
||||||
|
id: 1043599230247374869n,
|
||||||
|
},
|
||||||
} satisfies Record<string, Dev>);
|
} satisfies Record<string, Dev>);
|
||||||
|
|
||||||
// iife so #__PURE__ works correctly
|
// iife so #__PURE__ works correctly
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue