Skip to content

feat(lyrics-plus): change ♪ to idle dots #3455

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 49 additions & 3 deletions CustomApps/lyrics-plus/Pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,24 @@ const IdlingIndicator = ({ isActive, progress, delay }) => {
"--indicator-delay": `${delay}ms`,
},
},
react.createElement("div", { className: `lyrics-idling-indicator__circle ${progress >= 0.05 ? "active" : ""}` }),
react.createElement("div", { className: `lyrics-idling-indicator__circle ${progress >= 0.33 ? "active" : ""}` }),
react.createElement("div", { className: `lyrics-idling-indicator__circle ${progress >= 0.66 ? "active" : ""}` })
[0.05, 0.33, 0.66].map((threshold) =>
react.createElement("div", { className: `lyrics-idling-indicator__circle ${progress >= threshold ? "active" : ""}` })
)
);
};

const InlineIdlingIndicator = ({ progress, isActive }) => {
return react.createElement(
"span",
{
className: `lyrics-inline-idling-indicator${isActive ? " active" : ""}`,
},
[0.05, 0.33, 0.66].map((threshold, idx) =>
react.createElement("span", {
key: idx,
className: `lyrics-inline-idling-dot${progress >= threshold ? " active" : ""}`,
})
)
);
};

Expand Down Expand Up @@ -145,6 +160,37 @@ const SyncedLyricsPage = react.memo(({ lyrics = [], provider, copyright, isKara
delay: activeLines[2].startTime / 3,
});
}
if (text === "♪") {
let className = "lyrics-lyricsContainer-LyricsLine";
let ref;
if (Math.min(activeLineIndex, CONFIG.visual["lines-before"] + 1) === i) {
className += " lyrics-lyricsContainer-LyricsLine-active";
ref = activeLineEle;
}
const animationIndex = activeLineIndex <= CONFIG.visual["lines-before"] ? i - activeLineIndex : i - CONFIG.visual["lines-before"] - 1;
const nextLine = activeLines[i + 1];
const timeToNext = nextLine ? nextLine.startTime - startTime : 1000;
const progress = Math.min(1, (position - startTime) / (timeToNext || 1));
return react.createElement(
"div",
{
className,
style: {
cursor: "pointer",
"--position-index": animationIndex,
"--animation-index": (animationIndex < 0 ? 0 : animationIndex) + 1,
"--blur-index": Math.abs(animationIndex),
},
key: lineNumber,
dir: "auto",
ref,
onClick: () => {
if (startTime) Spicetify.Player.seek(startTime);
},
},
react.createElement("p", {}, react.createElement(InlineIdlingIndicator, { progress, isActive: progress >= 1 }))
);
}

let className = "lyrics-lyricsContainer-LyricsLine";
const activeElementIndex = Math.min(activeLineIndex, CONFIG.visual["lines-before"] + 1);
Expand Down
62 changes: 62 additions & 0 deletions CustomApps/lyrics-plus/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -728,3 +728,65 @@ div.lyrics-tabBar-headerItemLink {
margin-left: 100px;
}
}

.lyrics-inline-idling-indicator {
display: inline-flex;
align-items: center;
gap: 0.25em;
margin-left: 0.2em;
opacity: 0.5;
transition: opacity 0.2s;
vertical-align: middle;
}
.lyrics-inline-idling-indicator.active {
opacity: 1;
}
.lyrics-inline-idling-dot {
width: 0.5em;
height: 0.5em;
border-radius: 50%;
background: var(--lyrics-idling-dot-color, #888);
opacity: 0.3;
transform: scale(0.7);
transition:
background 0.2s,
opacity 0.2s,
transform 0.2s;
display: inline-block;
}
.lyrics-inline-idling-dot.active {
background: var(--lyrics-idling-dot-active-color, #fff);
opacity: 1;
transform: scale(1.1);
}

.lyrics-idling-indicator {
display: flex;
align-items: center;
gap: 0.4em;
justify-content: center;
margin: 0.5em 0;
opacity: 0.7;
transition: opacity 0.2s;
}
.lyrics-idling-indicator.active {
opacity: 1;
}
.lyrics-idling-dot {
width: 0.7em;
height: 0.7em;
border-radius: 50%;
background: var(--lyrics-idling-dot-color, #888);
opacity: 0.3;
transform: scale(0.7);
transition:
background 0.2s,
opacity 0.2s,
transform 0.2s;
display: inline-block;
}
.lyrics-idling-dot.active {
background: var(--lyrics-idling-dot-active-color, #fff);
opacity: 1;
transform: scale(1.1);
}
Comment on lines +775 to +792
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify usage of new .lyrics-idling-dot selectors.

Pages.js keeps using lyrics-idling-indicator__circle for the block indicator. If .lyrics-idling-dot isn’t referenced elsewhere, these rules are currently unused.

Run this to confirm usage and remove dead CSS if unused:


🏁 Script executed:

#!/bin/bash
# Find references to the new dot classes
rg -n -C2 'lyrics-idling-dot|lyrics-inline-idling-dot'

Length of output: 2162


🏁 Script executed:

#!/bin/bash
# Check for usage of the old block indicator class
rg -n -C2 'lyrics-idling-indicator__circle'

Length of output: 979


Remove or Integrate Unused .lyrics-idling-dot Styles

Our search confirms that:

  • .lyrics-inline-idling-dot is used in CustomApps/lyrics-plus/Pages.js (line 49).
  • .lyrics-idling-dot (defined in style.css lines 775–792) isn’t referenced anywhere in the codebase.
  • The block indicator in Pages.js (line 35) still uses lyrics-idling-indicator__circle.

Action items:

  • If you intended to replace the block‐indicator dots with .lyrics-idling-dot, update the Pages.js render logic:
    - className={`lyrics-idling-indicator__circle ${progress >= threshold ? "active" : ""}`}
    + className={`lyrics-idling-dot ${progress >= threshold ? "active" : ""}`}
  • Otherwise, remove the unused .lyrics-idling-dot rules from CustomApps/lyrics-plus/style.css (lines 775–792).
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.lyrics-idling-dot {
width: 0.7em;
height: 0.7em;
border-radius: 50%;
background: var(--lyrics-idling-dot-color, #888);
opacity: 0.3;
transform: scale(0.7);
transition:
background 0.2s,
opacity 0.2s,
transform 0.2s;
display: inline-block;
}
.lyrics-idling-dot.active {
background: var(--lyrics-idling-dot-active-color, #fff);
opacity: 1;
transform: scale(1.1);
}
className={`lyrics-idling-dot ${progress >= threshold ? "active" : ""}`}
🤖 Prompt for AI Agents
In CustomApps/lyrics-plus/style.css around lines 775 to 792 the
.lyrics-idling-dot rules are defined but not referenced anywhere; either delete
this unused CSS block, or update CustomApps/lyrics-plus/Pages.js (check the
block indicator at ~line 35 and the inline usage at ~line 49) to replace the
existing indicator classes (e.g., lyrics-idling-indicator__circle or
.lyrics-inline-idling-dot) with .lyrics-idling-dot and ensure you add the
.active class where the active state is toggled and the CSS custom properties
(--lyrics-idling-dot-color, --lyrics-idling-dot-active-color) are set or fall
back to desired defaults.