Remove appearance builtins

This commit is contained in:
Zack Rauen 2022-01-28 14:00:59 -05:00
parent a0a4670ece
commit f078e3b2dc
10 changed files with 0 additions and 579 deletions

View File

@ -30,29 +30,6 @@
"note": "Prevents Discord from hijacking your media keys after playing a video."
}
},
"appearance": {
"name": "Appearance",
"minimalMode": {
"name": "Minimal Mode",
"note": "Hide elements and reduce the size of elements"
},
"twentyFourHour": {
"name": "24-Hour Timestamps",
"note": "Converts 12-hour timestamps to 24-hour format"
},
"coloredText": {
"name": "Colored Text",
"note": "Make text colour the same as role color"
},
"hideGIFButton": {
"name": "Hide GIF Button",
"note": "Hides the GIF picker button in the textarea"
},
"hideGiftButton": {
"name": "Hide Gift Button",
"note": "Hides the Nitro Gift button in the textarea"
}
},
"addons": {
"name": "Addon Manager",
"addonErrors": {

View File

@ -1,29 +0,0 @@
import Builtin from "../../structs/builtin";
import {DiscordModules} from "modules";
export default new class TwentyFourHour extends Builtin {
get name() {return "24Hour";}
get category() {return "appearance";}
get id() {return "twentyFourHour";}
enabled() {
this.inject24Hour();
}
disabled() {
this.unpatchAll();
}
inject24Hour() {
const twelveHour = new RegExp(`([0-9]{1,2}):([0-9]{1,2})\\s(AM|PM)`);
const convert = (thisObject, args, returnValue) => {
const matched = returnValue.match(twelveHour);
if (!matched || matched.length !== 4) return;
if (matched[3] === "AM") return returnValue.replace(matched[0], `${matched[1] === "12" ? "00" : matched[1].padStart(2, "0")}:${matched[2]}`);
return returnValue.replace(matched[0], `${matched[1] === "12" ? "12" : parseInt(matched[1]) + 12}:${matched[2]}`);
};
this.after(DiscordModules.TimeFormatter, "calendarFormat", convert); // Called in Cozy mode
this.after(DiscordModules.TimeFormatter, "dateFormat", convert); // Called in Compact mode
}
};

View File

@ -1,41 +0,0 @@
import Builtin from "../../structs/builtin";
import {WebpackModules, DiscordModules} from "modules";
export default new class ColoredText extends Builtin {
get name() {return "ColoredText";}
get category() {return "appearance";}
get id() {return "coloredText";}
enabled() {
this.injectColoredText();
}
disabled() {
this.removeColoredText();
this.unpatchAll();
}
injectColoredText() {
const MessageContent = WebpackModules.getModule(m => m.type && m.type.displayName === "MessageContent");
this.after(MessageContent, "type", (thisObject, [props], returnValue) => {
const roleColor = this.getRoleColor(props.message.channel_id, props.message.author.id) || "";
returnValue.props.style = {color: roleColor};
});
}
getRoleColor(channelId, memberId) {
const channel = DiscordModules.ChannelStore.getChannel(channelId);
if (!channel) return "";
const member = DiscordModules.GuildMemberStore.getMember(channel.guild_id, memberId);
if (!member) return "";
return member.colorString;
}
removeColoredText() {
document.querySelectorAll(".markup-2BOw-j").forEach(elem => {
elem.style.setProperty("color", "");
});
}
};

View File

@ -1,32 +0,0 @@
import Builtin from "../../structs/builtin";
import WebpackModules from "../../modules/webpackmodules";
import Utilities from "../../modules/utilities";
export default new class HideGIFButton extends Builtin {
get name() {return "HideGIFButton";}
get category() {return "appearance";}
get id() {return "hideGIFButton";}
enabled() {
this.after(WebpackModules.find(m => m.type && m.type.render && m.type.render.displayName === "ChannelTextAreaContainer").type, "render", (_, __, returnValue) => {
const buttons = Utilities.getNestedProp(returnValue, "props.children.0.props.children.1.props.children.2.props.children.2.props.children");
if (Array.isArray(buttons)) {
for (const button of buttons) {
if (!button) continue;
const renderFunc = Utilities.getNestedProp(button, "type.type.render");
if (!renderFunc) continue;
// ChannelStickerPickerButton for sticker button
if (renderFunc.displayName === "ChannelGIFPickerButton") {
button.props.disabled = true;
break;
}
}
}
});
}
disabled() {
this.unpatchAll();
}
};

View File

@ -1,31 +0,0 @@
import Builtin from "../../structs/builtin";
import WebpackModules from "../../modules/webpackmodules";
import Utilities from "../../modules/utilities";
export default new class HideGiftButton extends Builtin {
get name() {return "HideGiftButton";}
get category() {return "appearance";}
get id() {return "hideGiftButton";}
enabled() {
this.after(WebpackModules.find(m => m.type && m.type.render && m.type.render.displayName === "ChannelTextAreaContainer").type, "render", (_, __, returnValue) => {
const buttons = Utilities.getNestedProp(returnValue, "props.children.0.props.children.1.props.children.2.props.children.2.props.children");
if (Array.isArray(buttons)) {
for (const button of buttons) {
if (!button) continue;
const renderFunc = Utilities.getNestedProp(button, "type.type");
if (!renderFunc) continue;
if (renderFunc.displayName === "ChannelPremiumGiftButton") {
button.props.disabled = true;
break;
}
}
}
});
}
disabled() {
this.unpatchAll();
}
};

View File

@ -1,15 +0,0 @@
import Builtin from "../../structs/builtin";
export default new class MinimalMode extends Builtin {
get name() {return "MinimalMode";}
get category() {return "appearance";}
get id() {return "minimalMode";}
enabled() {
document.body.classList.add("bd-minimal");
}
disabled() {
document.body.classList.remove("bd-minimal");
}
};

View File

@ -6,12 +6,6 @@ export {default as PublicServers} from "./general/publicservers";
export {default as VoiceDisconnect} from "./general/voicedisconnect";
export {default as MediaKeys} from "./general/mediakeys";
export {default as TwentyFourHour} from "./appearance/24hour";
export {default as ColoredText} from "./appearance/coloredtext";
export {default as HideGIFButton} from "./appearance/hidegifbutton";
export {default as HideGiftButton} from "./appearance/hidegiftbutton";
export {default as MinimalMode} from "./appearance/minimalmode";
export {default as EmoteModule} from "./emotes/emotes";
export {default as EmoteMenu} from "./emotes/emotemenu";
// export {default as EmoteAutocaps} from "./emotes/emoteautocaps";

View File

@ -11,18 +11,6 @@ export default [
{type: "switch", id: "mediaKeys", value: false}
]
},
{
type: "category",
id: "appearance",
collapsible: true,
settings: [
{type: "switch", id: "twentyFourHour", value: false},
{type: "switch", id: "hideGiftButton", value: false},
{type: "switch", id: "hideGIFButton", value: false},
{type: "switch", id: "minimalMode", value: false},
{type: "switch", id: "coloredText", value: false}
]
},
{
type: "category",
id: "addons",

View File

@ -1,129 +0,0 @@
/* Emoji Picker */
.bd-dark #bd-qem-favourite-container,
.bd-dark #bd-qem-twitch-container {
background-color: #353535;
}
.bd-dark #bd-qem {
border-bottom: 1px solid #464646;
background: #353535;
}
.bd-dark #bd-qem button {
background: #353535;
border-left: 1px solid #242424;
box-shadow: #424242 1px 0 0 0;
color: #fff;
}
.bd-dark #bd-qem button.active {
background-color: #292929;
}
.bd-dark #bd-qem button:hover {
background-color: #303030;
}
.bd-dark .emojiPicker-3m1S-j {
background-color: #353535;
}
.bd-dark .emojiPicker-3m1S-j .category-2U57w6 {
background-color: #353535;
}
.bd-dark .emojiPicker-3m1S-j .header-1nkwgG .searchBar-2pWH0_ {
background-color: #2b2b2b;
}
.bd-dark .emojiPicker-3m1S-j .searchBar-2pWH0_ input {
color: #fff;
}
.bd-dark .emojiPicker-3m1S-j .searchBar-2pWH0_ input::-webkit-input-placeholder {
color: #fff;
}
.bd-dark .emojiPicker-3m1S-j .scroller-3vODG7 .emojiItem-109bjA.selected-39BZ4S {
background-color: rgba(123, 123, 123, 0.37);
}
.bd-dark .emojiPicker-3m1S-j .dimmer-3iH-5D.visible-3k45bQ {
background-color: rgba(62, 62, 62, 0.65);
}
.bd-dark .emojiPicker-3m1S-j .diversitySelector-tmmMv0 .popout-2nUePc {
background: #353535;
border-color: #202020;
}
.bd-dark #bd-qem-favourite-container .scroller::-webkit-scrollbar,
.bd-dark #bd-qem-favourite-container .scroller::-webkit-scrollbar-track,
.bd-dark #bd-qem-favourite-container .scroller::-webkit-scrollbar-track-piece,
.bd-dark #bd-qem-twitch-container .scroller::-webkit-scrollbar,
.bd-dark #bd-qem-twitch-container .scroller::-webkit-scrollbar-track,
.bd-dark #bd-qem-twitch-container .scroller::-webkit-scrollbar-track-piece,
.bd-dark .emojiPicker-3m1S-j .scroller-3vODG7::-webkit-scrollbar,
.bd-dark .emojiPicker-3m1S-j .scroller-3vODG7::-webkit-scrollbar-track,
.bd-dark .emojiPicker-3m1S-j .scroller-3vODG7::-webkit-scrollbar-track-piece {
background-color: #303030 !important;
border-color: #303030 !important;
}
.bd-dark #bd-qem-twitch-container .scroller::-webkit-scrollbar-thumb,
.bd-dark #bd-qem-favourite-container .scroller::-webkit-scrollbar-thumb,
.bd-dark .emojiPicker-3g68GS .scroller-3vODG7::-webkit-scrollbar-thumb {
border-color: #202020 !important;
background-color: #202020 !important;
}
/* add/create server */
.bd-dark .theme-light .slide-2pHaq5 {
background: #36393f;
}
.bd-dark .theme-dark .action-1lSjCi,
.bd-dark .theme-light .action-1lSjCi {
background: #2f3136;
}
/* centered or */
.bd-dark .theme-dark .or-3THJsp,
.bd-dark .theme-light .or-3THJsp {
background: #2f3136;
order: 2;
height: 56px;
width: 56px;
top: 103px;
line-height: 56px;
left: calc(50% - 29px);
border-radius: 50%;
border: 2px solid #484b52;
}
.bd-dark .create-3jownz {
order: 1;
}
.bd-dark .join-33Tr-7 {
order: 3;
}
.bd-dark .theme-dark .actionIcon-2IISM_,
.bd-dark .theme-light .actionIcon-2IISM_ {
filter: grayscale(100%) brightness(60%);
}
.bd-dark .theme-light .footer-2yfCgX {
background: #2f3136;
}
/* Region Select */
.bd-dark .regionSelectModal-12e-57 {
background: #36393f;
}
.bd-dark .regionSelectModal-12e-57 .regionSelectModalOption-2DSIZ3 {
background: #2f3136;
border: 2px solid #484b52;
}

View File

@ -1,261 +0,0 @@
/* Sidebars */
.bd-minimal .sidebar-2K8pFh,
.bd-minimal .members-1998pB,
.bd-minimal .membersWrap-2h-GB4,
.bd-minimal .nowPlayingColumn-2sl4cE,
.bd-minimal .bannerImage-3KhIJ6 {
width: 200px;
min-width: auto;
}
/* User Container */
.bd-minimal .container-3baos1 .noWrap-3jynv6 {
display: none;
opacity: 0;
pointer-events: none;
}
.bd-minimal .container-3baos1:hover .noWrap-3jynv6 {
display: flex;
opacity: 1;
pointer-events: all;
}
.bd-minimal .container-3baos1 {
height: 45px;
}
/* Header container heights */
.bd-minimal .container-1r6BKw,
.bd-minimal .header-2V-4Sw,
.bd-minimal .searchBar-6Kv8R2 {
height: 40px;
}
.bd-minimal .libraryHeader-3g95kE::before {
top: 40px;
}
/* Settings */
.bd-minimal .sidebarRegion-VFTUkN {
flex: 0;
}
.bd-minimal .contentColumn-2hrIYH,
.bd-minimal .customColumn-Rb6toI {
flex-grow: 1;
max-width: 100%;
}
.bd-minimal .customScroller-26gWhv > div,
.bd-minimal .sidebarScrollable-1qPI87 + .content-1rPSz4 {
max-width: unset;
}
.bd-minimal .bd-addon-list .bd-addon-card {
margin-bottom: 10px;
}
.bd-minimal .bd-addon-list.bd-grid-view {
grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
}
/* Friends (https://tropix126.github.io/BetterDiscordStuff/midnight/css/base.css) */
@keyframes slide-out-enable {
0% {
pointer-events: none;
}
100% {
pointer-events: all;
}
}
.bd-minimal .nowPlayingColumn-2sl4cE {
min-width: unset;
position: absolute;
right: 0;
height: 100%;
width: 300px;
transform: translateX(250px);
background: var(--background-secondary-alt);
transition: 250ms cubic-bezier(0.52, 0, 0.74, 0);
z-index: 1;
}
.bd-minimal .nowPlayingColumn-2sl4cE::after {
content: '|||';
color: var(--header-primary);
font-size: 12px;
position: absolute;
left: 25px;
top: 50%;
transform: translateY(-50%) translateX(-50%);
transition: 250ms ease;
}
.bd-minimal .nowPlayingColumn-2sl4cE:hover::after {
opacity: 0;
}
.bd-minimal .nowPlayingColumn-2sl4cE:hover {
transform: none;
}
.bd-minimal .peopleColumn-29fq28 {
margin-right: 50px;
}
@media (max-width: 1200px) {
.bd-minimal .peopleColumn-29fq28 {
margin-right: 0;
}
}
.bd-minimal .nowPlayingColumn-2sl4cE .nowPlayingScroller-2XrVUt {
pointer-events: none;
opacity: 0;
transform: scale(0.95);
transition: 250ms cubic-bezier(0.52, 0, 0.74, 0);
}
.bd-minimal .nowPlayingColumn-2sl4cE:hover .nowPlayingScroller-2XrVUt {
opacity: 1;
transform: none;
}
.bd-minimal .nowPlayingColumn-2sl4cE:hover .itemCard-v9viV7 {
animation: slide-out-enable 450ms linear forwards;
}
/* Context menus (status picker) */
.bd-minimal .item-1tOPte {
min-height: 18px;
}
.bd-minimal .styleFixed-sX-yHV {
width: 180px;
}
.bd-minimal .description-2L932D {
display: none;
}
/* Tooltips */
.bd-minimal .tooltip-2QfLtc {
border-radius: 4px;
}
.bd-minimal .tooltipContent-bqVLWK {
padding: 4px 8px;
font-size: 13px;
}
/* Messages */
.bd-minimal .cozy-3raOZG.wrapper-2a6GCs .avatar-1BDn8e {
transform: scale(0.75);
width: 32px;
height: 32px;
}
.bd-minimal .cozy-3raOZG.wrapper-2a6GCs {
padding-left: 64px;
}
.bd-minimal .buttons-cl5qTG {
transform: scale(0.75);
transform-origin: right;
}
/* Chat input */
.bd-minimal .form-2fGMdU {
padding-left: 10px;
padding-right: 10px;
}
/* Guilds */
.bd-minimal .guilds-1SWlCJ {
width: 55px;
}
.bd-minimal .guilds-1SWlCJ .wrapper-sa6paO {
height: 35px;
}
.bd-minimal .guilds-1SWlCJ .wrapper-sa6paO span {
max-height: 20px;
}
.bd-minimal .guilds-1SWlCJ div[style*="height: 56px"],
.bd-minimal .guilds-1SWlCJ [role=group] {
height: auto !important;
}
.bd-minimal .guilds-1SWlCJ .listItem-GuPuDH,
.bd-minimal .guilds-1SWlCJ [class*="unreadMentionsIndicator"],
.bd-minimal .guilds-1SWlCJ .wrapper-3Njo_c {
width: 100%;
}
.bd-minimal .guilds-1SWlCJ .wrapper-25eVIn,
.bd-minimal .guilds-1SWlCJ [class*="guildsError-"],
.bd-minimal .guilds-1SWlCJ svg[width="48"] {
width: 35px;
height: 35px;
}
.bd-minimal .guilds-1SWlCJ .wrapper-3Njo_c > span {
left: 10px;
width: 35px;
}
.bd-minimal .guilds-1SWlCJ #bd-pub-button {
height: 20px;
line-height: 20px;
font-size: 10px;
}
/* Private channels horizontal icons */
.bd-minimal .channel-2QD9_O[href="/channels/@me"],
.bd-minimal .channel-2QD9_O[href="/discovery"],
.bd-minimal .channel-2QD9_O[href="/library"],
.bd-minimal .channel-2QD9_O[href="/store"] {
width: calc(25% - 8px);
margin-left: 8px;
padding: 0;
display: inline-block;
}
.bd-minimal .channel-2QD9_O[href="/channels/@me"] .content-3QAtGj,
.bd-minimal .channel-2QD9_O[href="/discovery"] .content-3QAtGj,
.bd-minimal .channel-2QD9_O[href="/library"] .content-3QAtGj,
.bd-minimal .channel-2QD9_O[href="/store"] .content-3QAtGj,
.bd-minimal .channel-2QD9_O[href="/channels/@me"] .children-gzQq2t,
.bd-minimal .channel-2QD9_O[href="/discovery"] .children-gzQq2t,
.bd-minimal .channel-2QD9_O[href="/library"] .children-gzQq2t,
.bd-minimal .channel-2QD9_O[href="/store"] .children-gzQq2t {
display: none;
}
.bd-minimal .channel-2QD9_O[href="/channels/@me"] .avatar-3uk_u9,
.bd-minimal .channel-2QD9_O[href="/discovery"] .avatar-3uk_u9,
.bd-minimal .channel-2QD9_O[href="/library"] .avatar-3uk_u9,
.bd-minimal .channel-2QD9_O[href="/store"] .avatar-3uk_u9 {
margin: 0;
flex-grow: 1;
}
.bd-minimal .layout-2DM8Md {
justify-content: center;
}