add: connect bar state

fix: elapsed time text
fix: bookmark select box text color
This commit is contained in:
Julien Maille 2021-07-09 23:07:18 +02:00
parent d8e507b5fa
commit fa97b3f611
3 changed files with 18 additions and 3 deletions

View file

@ -1,4 +1,4 @@
let current = '1.6'
let current = '1.7'
/* css is injected so this works with untouched user.css from Dribbblish */
/* dark theme */

View file

@ -140,8 +140,9 @@ waitForElement([".Root__main-view .os-resize-observer-host"], ([resizeHost]) =>
(function Dribbblish() {
const progBar = document.querySelector(".playback-bar");
const root = document.querySelector(".Root");
if (!Spicetify.Player.origin || !progBar) {
if (!Spicetify.Player.origin || !progBar || !root) {
setTimeout(Dribbblish, 300);
return;
}
@ -152,7 +153,7 @@ waitForElement([".Root__main-view .os-resize-observer-host"], ([resizeHost]) =>
const progKnob = progBar.querySelector(".progress-bar__slider");
Spicetify.Player.addEventListener("onprogress", ({ data: e }) => {
function updateProgTime({ data: e }) {
const offsetX = progKnob.offsetLeft + progKnob.offsetWidth / 2;
const maxWidth = progBar.offsetWidth;
const curWidth = Spicetify.Player.getProgressPercent() * maxWidth;
@ -166,6 +167,17 @@ waitForElement([".Root__main-view .os-resize-observer-host"], ([resizeHost]) =>
}
tooltip.innerText = Spicetify.Player.formatTime(e) + " / " +
Spicetify.Player.formatTime(Spicetify.Player.getDuration());
}
Spicetify.Player.addEventListener("onprogress", updateProgTime);
updateProgTime({ data: Spicetify.Player.getProgress() });
Spicetify.CosmosAsync.sub("sp://connect/v1", (state) => {
const isExternal = state.devices.some(a => a.is_active);
if (isExternal) {
root.classList.add("is-connectBarVisible");
} else {
root.classList.remove("is-connectBarVisible");
}
});
const filePickerForm = document.createElement("form");

View file

@ -817,6 +817,9 @@ html.right-expanded-cover.buddyfeed-visible .main-coverSlotExpanded-container {
background-color: rgba(var(--spice-rgb-selected-row), .3);
}
.bookmark-filter {
color: var(--spice-main) !important;
}
/* 1.1.56 */
.main-navBar-navBar {