From d035105819ceb06b8445984f04a69e2b5eb9e5fe Mon Sep 17 00:00:00 2001 From: lemonslut Date: Mon, 26 May 2025 01:02:10 -0600 Subject: [PATCH 1/2] add toggle to hide gift sub buttons adds a toggle under `Channel > Appearance >> General` to hide the "gift a sub" buttons from the channel header (right under the player) and from the channel goals. because i have poor impulse control sometimes <3 tyvm; i love the extension --- .../twitch-twilight/modules/css_tweaks/index.js | 13 +++++++++++++ .../styles/hide-channel-gift-sub-buttons.scss | 3 +++ 2 files changed, 16 insertions(+) create mode 100644 src/sites/twitch-twilight/modules/css_tweaks/styles/hide-channel-gift-sub-buttons.scss diff --git a/src/sites/twitch-twilight/modules/css_tweaks/index.js b/src/sites/twitch-twilight/modules/css_tweaks/index.js index 50be58c4..e9c96217 100644 --- a/src/sites/twitch-twilight/modules/css_tweaks/index.js +++ b/src/sites/twitch-twilight/modules/css_tweaks/index.js @@ -481,6 +481,18 @@ export default class CSSTweaks extends Module { changed: val => this.toggle('square-avatars', !val) }); + this.settings.add('channel.gift-sub-buttons.hide', { + default: false, + ui: { + order: -1, + path: 'Channel > Appearance >> General', + title: 'Hide the sub gifting buttons in the channel header and channel goals.', + description: 'Note: This will not hide sub gifting buttons in chat.', + component: 'setting-check-box' + }, + changed: val => this.toggle('hide-channel-gift-sub-buttons', val) + }); + /*this.settings.add('channel.hide-not-live-bar', { default: false, ui: { @@ -515,6 +527,7 @@ export default class CSSTweaks extends Module { this.toggleHide('pinned-hype-chat', ! this.settings.get('chat.hype.show-pinned')); this.toggle('square-avatars', ! this.settings.get('channel.round-avatars')); + this.toggle('hide-channel-gift-sub-buttons', this.settings.get('channel.gift-sub-buttons.hide')); //this.toggleHide('not-live-bar', this.settings.get('channel.hide-not-live-bar')); this.toggleHide('channel-live-ind', this.settings.get('channel.hide-live-indicator')); diff --git a/src/sites/twitch-twilight/modules/css_tweaks/styles/hide-channel-gift-sub-buttons.scss b/src/sites/twitch-twilight/modules/css_tweaks/styles/hide-channel-gift-sub-buttons.scss new file mode 100644 index 00000000..f99cb32b --- /dev/null +++ b/src/sites/twitch-twilight/modules/css_tweaks/styles/hide-channel-gift-sub-buttons.scss @@ -0,0 +1,3 @@ +button[data-a-target="gift-button"] { + display: none !important; +} From 67ac661e2ceda30fe065bd307c3f4047452af39b Mon Sep 17 00:00:00 2001 From: lemonslut Date: Thu, 29 May 2025 21:47:08 -0600 Subject: [PATCH 2/2] reimplement with CLASSES const over snippet & more specific selector that still covers both buttons i want to nix also remove unneeded `order: -1` that was cargo culted in there --- src/sites/twitch-twilight/modules/css_tweaks/index.js | 6 +++--- .../css_tweaks/styles/hide-channel-gift-sub-buttons.scss | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) delete mode 100644 src/sites/twitch-twilight/modules/css_tweaks/styles/hide-channel-gift-sub-buttons.scss diff --git a/src/sites/twitch-twilight/modules/css_tweaks/index.js b/src/sites/twitch-twilight/modules/css_tweaks/index.js index e9c96217..5f5dab77 100644 --- a/src/sites/twitch-twilight/modules/css_tweaks/index.js +++ b/src/sites/twitch-twilight/modules/css_tweaks/index.js @@ -49,6 +49,7 @@ const CLASSES = { 'profile-hover': '.preview-card .tw-relative:hover .ffz-channel-avatar', 'not-live-bar': 'div[data-test-selector="non-live-video-banner-layout"]', 'channel-live-ind': '.channel-header__user .tw-channel-status-text-indicator,.channel-info-content .tw-halo__indicator', + 'channel-gift-sub-buttons': '.channel-info-content button[data-a-target="gift-button"]', 'celebration': 'body .celebration__overlay', 'last-x-events': '.last-x-events_container', @@ -484,13 +485,12 @@ export default class CSSTweaks extends Module { this.settings.add('channel.gift-sub-buttons.hide', { default: false, ui: { - order: -1, path: 'Channel > Appearance >> General', title: 'Hide the sub gifting buttons in the channel header and channel goals.', description: 'Note: This will not hide sub gifting buttons in chat.', component: 'setting-check-box' }, - changed: val => this.toggle('hide-channel-gift-sub-buttons', val) + changed: val => this.toggleHide('channel-gift-sub-buttons', val) }); /*this.settings.add('channel.hide-not-live-bar', { @@ -527,7 +527,7 @@ export default class CSSTweaks extends Module { this.toggleHide('pinned-hype-chat', ! this.settings.get('chat.hype.show-pinned')); this.toggle('square-avatars', ! this.settings.get('channel.round-avatars')); - this.toggle('hide-channel-gift-sub-buttons', this.settings.get('channel.gift-sub-buttons.hide')); + this.toggleHide('channel-gift-sub-buttons', this.settings.get('channel.gift-sub-buttons.hide')); //this.toggleHide('not-live-bar', this.settings.get('channel.hide-not-live-bar')); this.toggleHide('channel-live-ind', this.settings.get('channel.hide-live-indicator')); diff --git a/src/sites/twitch-twilight/modules/css_tweaks/styles/hide-channel-gift-sub-buttons.scss b/src/sites/twitch-twilight/modules/css_tweaks/styles/hide-channel-gift-sub-buttons.scss deleted file mode 100644 index f99cb32b..00000000 --- a/src/sites/twitch-twilight/modules/css_tweaks/styles/hide-channel-gift-sub-buttons.scss +++ /dev/null @@ -1,3 +0,0 @@ -button[data-a-target="gift-button"] { - display: none !important; -}