diff --git a/CHANGELOG.md b/CHANGELOG.md index d4b2760..804b680 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,5 @@ +Added: +- Ability to hide premium features in addition to ads + Improved: - Add `embedWidgetGenerator` modals to custom modal styles. (Things like the [spicetify-marketplace](https://github.com/CharlieS1103/spicetify-marketplace) options) \ No newline at end of file diff --git a/src/js/main.js b/src/js/main.js index a3b76b2..2fb9ec9 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -217,12 +217,17 @@ Dribbblish.on("ready", () => { Dribbblish.config.register({ order: 999, - type: "checkbox", - key: "hideAds", - name: "Hide Ads", - description: `Hide ads / premium features (see: [SpotifyNoPremium](https://github.com/Daksh777/SpotifyNoPremium))`, - defaultValue: false, - onChange: (val) => $("#main").attr("hide-ads", val) + type: "select", + data: { none: "Hide Nothing", ads: "Hide Ads", premium: "Hide Premium Features", both: "Hide Both" }, + key: "hideAdsOrPremium", + name: "Hide Ads / Premium Features", + description: `Hide ads / premium features like Fullscreen and Download Buttons (see: [SpotifyNoPremium](https://github.com/Daksh777/SpotifyNoPremium))`, + defaultValue: "none", + onChange: (val) => { + if (val == "none") return $("#main").attr("hide-ads", null); + if (val == "both") return $("#main").attr("hide-ads", "ads premium"); + $("#main").attr("hide-ads", val); + } }); waitForElement([".main-rootlist-rootlist", ".main-rootlist-wrapper > :nth-child(2) > :first-child", "#spicetify-show-list"], ([rootlist]) => { diff --git a/src/styles/NoAds.scss b/src/styles/NoAds.scss index 364dbb0..8287155 100644 --- a/src/styles/NoAds.scss +++ b/src/styles/NoAds.scss @@ -1,17 +1,31 @@ -#main[hide-ads="true"] { - /* Remove upgrade button*/ - .main-topBar-UpgradeButton { - display: none; - } - - /* Remove upgrade to premium button in user menu */ - .main-contextMenu-menuItemButton[href="https://www.spotify.com/premium/"] - { - display: none; - } - - /* Remove ad placeholder in main screen */ +// Hide ads +#main[hide-ads~="ads"] { + // Remove ad placeholder in main screen .main-leaderboardComponent-container { display: none; } } + +// Hide premium features +#main[hide-ads~="premium"] { + // Remove upgrade button + .main-topBar-UpgradeButton { + display: none; + } + + // Remove upgrade to premium button in user menu + // prettier-ignore + .main-contextMenu-menuItemButton[href="https://www.spotify.com/premium/"] { + display: none; + } + + // Hide fullscreen button + .volume-bar + .control-button { + display: none; + } + + // Hide download buttons + .main-playButton-PlayButton.main-playButton-primary + button[role="switch"] { + display: none; + } +}