diff --git a/src/equicordplugins/fullVcPfp/index.css b/src/equicordplugins/fullVcPfp/index.css new file mode 100644 index 00000000..f9ff0cb1 --- /dev/null +++ b/src/equicordplugins/fullVcPfp/index.css @@ -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; } +} diff --git a/src/equicordplugins/fullVcPfp/index.tsx b/src/equicordplugins/fullVcPfp/index.tsx new file mode 100644 index 00000000..ce764932 --- /dev/null +++ b/src/equicordplugins/fullVcPfp/index.tsx @@ -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); + }, +}); diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 9c64830e..85eb4619 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -975,7 +975,11 @@ export const EquicordDevs = Object.freeze({ OIRNOIR: { name: "OIRNOIR", id: 720842469024989195n - } + }, + mochienya: { + name: "mochie", + id: 1043599230247374869n, + }, } satisfies Record); // iife so #__PURE__ works correctly