Skip to content

Commit

Permalink
SpotOn V3.0.2 (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
SenpaiHunters authored Mar 5, 2024
1 parent 50c1d6b commit 9feab2f
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 60 deletions.
8 changes: 8 additions & 0 deletions SpotOn/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ const defaultOptions = {
hiddenPInfo: false,
hiddenSPL: false,
hiddenSTime: false,
hiddenSInfo: false,
hiddenSAlbum: false,
hiddenSDate: false,
hiddenSHeart: false,
hiddenSDura: false,
hideSpotifyOffers: false,
scrollNPB: false,
removeprembutton: true,
removemusixmatch: true,
Expand Down Expand Up @@ -226,6 +232,8 @@ const defaultOptions = {
darkness: false,
fontMain: true,
removeLikedCover: false,
hometopsel: false,
youwontlike: false,
};

function handleOption(option, tabId, options) {
Expand Down
8 changes: 8 additions & 0 deletions SpotOn/js/settings/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
hiddenPInfo: false,
hiddenSPL: false,
hiddenSTime: false,
hiddenSInfo: false,
hiddenSAlbum: false,
hiddenSDate: false,
hiddenSHeart: false,
hideSpotifyOffers: false,
hiddenSDura: false,
scrollNPB: false,
removeprembutton: true,
removemusixmatch: true,
Expand Down Expand Up @@ -66,6 +72,8 @@
darkness: false,
fontMain: true,
removeLikedCover: false,
hometopsel: false,
youwontlike: false,
};

function updateToggleCounts() {
Expand Down
2 changes: 1 addition & 1 deletion SpotOn/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "SpotOn",
"version": "3.0.0",
"version": "3.0.2",
"description": "Upgrade your Spotify Web Player with SpotOn, and enjoy a completely customizable UX/UI redesign!",
"author": "Kami",
"homepage_url": "https://github.com/senpaihunters/spoton",
Expand Down
34 changes: 19 additions & 15 deletions SpotOn/options/addLyrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,21 @@ function getCSS(das) {
transform: translateX(-80px) !important;
}
/* temp fix for the album white border??? */
button,
.rVxzkDirgkuRPv5V1HYF.IcyWfMS5VkeOhaI7OWIx {
border: none !important;
}
.FqmFsMhuF4D0s35Z62Js,
.rVxzkDirgkuRPv5V1HYF.IcyWfMS5VkeOhaI7OWIx,
.H0HbpIM3UrcupWIAjLWu,
.BFR9Zt3zpL8BATBMiwQB {
border-radius: 4% !important;
border-color: #000 !important;
background: #000 !important;
}
.kpRBcW:hover,
.RowButton-sc-xxkq4e-0.hIehTT:hover,
.bgTbzH:hover:after,
Expand Down Expand Up @@ -307,9 +322,9 @@ function getCSS(das) {
}
/* right click menu */
[role="menu"] [role="presentation"] :first-child:has(.ellipsis-one-line) {
background: var(--hoverback) !important;
border-radius: var(--main-border-radius) !important;
ul.NbcaczStd8vD2rHWwaKv {
background: var(--hoverback) !important;
border-radius: var(--main-border-radius) !important;
}
.SboKmDrCTZng7t4EgNoM,
Expand Down Expand Up @@ -454,6 +469,7 @@ function getCSS(das) {
#main>div.Root.encore-dark-theme>div,
#context-menu>ul,
#context-menu>div>ul {
-webkit-backdrop-filter: blur(var(--bg-blur));
backdrop-filter: blur(var(--bg-blur));
}
Expand Down Expand Up @@ -645,11 +661,8 @@ function getCSS(das) {
overflow: visible;
background-color: transparent !important;
background-image: none !important;
/* transition-duration: 0s; */
transition-duration: 0.5s;
/* Increased duration */
transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
/* Adjusted timing function */
}
#main>div.Root.encore-dark-theme>div>nav>div>ul>li:nth-child(3)>div,
Expand Down Expand Up @@ -678,14 +691,9 @@ function getCSS(das) {
div.os-padding>div>div>div.main-view-container__scroll-node-child>main>section>div>div>section>div>div:hover>div>div:first-child>div,
div.os-padding>div>div>div.main-view-container__scroll-node-child>main>section>div>section:nth-child(n+4)>div:nth-child(2)>div:hover>div>div:first-child>div,
div.os-padding>div>div>div>main>section>div:nth-child(2)>div>div:nth-child(n+2):hover>div>div>div:first-child {
/* transform: scale(1.05);
transition-duration: 0.2s;
transition-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1); */
transform: scale(1.1) translateX(3px);
transition-duration: 0.5s;
/* Increased duration */
transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
/* Adjusted timing function */
}
main-card-imageContainer,
Expand All @@ -704,12 +712,8 @@ function getCSS(das) {
.KL469QQzoRZLOmKomNzk .B3i7kN8tRTwP9s4XEK10,
view-homeShortcutsGrid-shortcut view-homeShortcutsGrid-imageContainer,
.icV9eS36uZs9fhQmUujh {
/* transition-duration: 0.2s !important;
transition-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1) !important; */
transition-duration: 0.5s;
/* Increased duration */
transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
/* Adjusted timing function */
}
._560fb0a89f4ec24665eb945cfe2c97b0-scss,
Expand Down
41 changes: 0 additions & 41 deletions SpotOn/options/featInDev.js
Original file line number Diff line number Diff line change
@@ -1,42 +1 @@
console.log("%cSpotOn Started", "font-size: 40px; padding-bottom: 3px; color: white; text-shadow: -1px -1px #2e51a2, 1px -1px #2e51a2, -1px 1px #2e51a2, 1px 1px #2e51a2, 2px 2px #2e51a2, 3px 3px #2e51a2;");

// Select the parent element that is consistent and won't change.
const container = document.body;

let lastLoggedSong = ""; // Variable to keep track of the last logged song name.

// Function to handle mutation observations
const handleMutations = (mutations) => {
const liveRegionElement = document.querySelector('span[aria-live="polite"][role="status"]');
if (!liveRegionElement) return;

const liveRegionText = liveRegionElement.textContent.trim();
// Check if the song name has changed since the last log and is not blank.
if (liveRegionText && liveRegionText !== lastLoggedSong) {
console.log(liveRegionText);
lastLoggedSong = liveRegionText; // Update the last logged song name.
}
};

// Create a MutationObserver to observe changes in the container.
const observer = new MutationObserver((mutations) => {
// Check if any mutation is related to childList or subtree.
const isRelevantMutation = mutations.some(mutation => mutation.type === "childList" || mutation.type === "subtree");
if (isRelevantMutation) {
handleMutations(mutations);
}
});

// Start observing the container for changes in child elements and subtree.
observer.observe(container, {
childList: true,
subtree: true,
characterData: true
});

// This should be called when your application or the relevant part of your page is unloaded or no longer needs the observer.
function disconnectObserver() {
observer.disconnect();
console.log("MutationObserver disconnected to avoid memory leaks.");
}
// May lead to errors, add log to check when disconnected.
2 changes: 1 addition & 1 deletion SpotOn/options/hiddenNPVqueue.css
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.os-content [data-testid="NPV_Panel_OpenDiv"]> :last-child:has([data-testid="play-next-button"]) { display: none !important; }
.Ai_McRq9wJEYK21w8nX_.qbOrWcMUhSri1nPkZLQA { display: none !important; }
2 changes: 1 addition & 1 deletion SpotOn/options/hiddenSInfo.css
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.contentSpacing [data-testid="track-list"] [role="row"] [aria-label="Duration"],.contentSpacing [data-testid="track-list"] [role="presentation"] [role="columnheader"],.koyeY6AgGRPmyPITi7yO,.contentSpacing [data-testid="track-list"] [role="presentation"]:has([role="columnheader"]) { display: none !important; }
.koyeY6AgGRPmyPITi7yO { display: none !important; }
1 change: 1 addition & 0 deletions SpotOn/options/hometopsel.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
zyeJ9w99yrvGokL3BsMc rX_OmqCngvY5ZCoYBZgb { display: none !important; }
1 change: 1 addition & 0 deletions SpotOn/options/youwontlike.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.bjB8WZd0Ev30ZFbiScDm { display: none !important }
42 changes: 41 additions & 1 deletion SpotOn/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ <h2>Importing Your Settings</h2>

<div class="option checkbox">
<input type="checkbox" id="darkness" />
<label for="darkness">Add a 10% darkness to the background</label>
<label for="darkness">Add a 10% darkness site-wide</label>
</div>
</div>

Expand Down Expand Up @@ -283,6 +283,11 @@ <h1>Removal Options <i class="chevron fas fa-chevron-down"></i></h1>
<label for="removeLikedCover">Remove Liked Songs Covert Art</label>
</div>

<div class="option checkbox">
<input type="checkbox" id="hometopsel" />
<label for="hometopsel">Remove top home selector (Podcasts, etc)</label>
</div>

<div class="option checkbox">
<input type="checkbox" id="hideCB" />
<label for="hideCB">Remove the content bar</label>
Expand All @@ -293,11 +298,21 @@ <h1>Removal Options <i class="chevron fas fa-chevron-down"></i></h1>
<label for="hiddenPIcon">Hides Profile button</label>
</div>

<div class="option checkbox">
<input type="checkbox" id="youwontlike" />
<label for="youwontlike">Remove the "You May Also Like" at the bottoms of albums</label>
</div>

<div class="option checkbox">
<input type="checkbox" id="removeprembutton" />
<label for="removeprembutton"> Remove premium button</label>
</div>

<div class="option checkbox">
<input type="checkbox" id="hideSpotifyOffers" />
<label for="hideSpotifyOffers"> Remove any Spotify offer</label>
</div>

<div class="option checkbox">
<input type="checkbox" id="removemusixmatch" />
<label for="removemusixmatch">Remove "Lyrics provided by Musixmatch"</label>
Expand Down Expand Up @@ -403,6 +418,31 @@ <h1>Removal Options <i class="chevron fas fa-chevron-down"></i></h1>
<label for="hiddenSPL">Hides songs album/playlist</label>
</div>

<div class="option checkbox">
<input type="checkbox" id="hiddenSAlbum" />
<label for="hiddenSAlbum">Hides songs album</label>
</div>

<div class="option checkbox">
<input type="checkbox" id="hiddenSDate" />
<label for="hiddenSDate">Hides songs date</label>
</div>

<div class="option checkbox">
<input type="checkbox" id="hiddenSDura" />
<label for="hiddenSDura">Hides songs duration</label>
</div>

<div class="option checkbox">
<input type="checkbox" id="hiddenSHeart" />
<label for="hiddenSHeart">Hides songs heart icon</label>
</div>

<div class="option checkbox">
<input type="checkbox" id="hiddenSInfo" />
<label for="hiddenSInfo">Remove top info header</label>
</div>

<div class="option checkbox">
<input type="checkbox" id="footernomore" />
<label for="footernomore">Send the footer to another dimension</label>
Expand Down

0 comments on commit 9feab2f

Please sign in to comment.