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
feat: add reversed mode & improvements to lyrics animation #1226
Conversation
Someone is attempting to deploy a commit to a Personal Account owned by @qier222 on Vercel. @qier222 first needs to authorize it. |
} | ||
set reversed(reversed) { | ||
if (this._isPersonalFM) return; | ||
if (reversed !== true && reversed !== false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
檢查類型建議用 typeof: typeof reversed !== 'boolean'
@@ -180,27 +193,43 @@ export default class { | |||
}, 1000); | |||
} | |||
_getNextTrack() { | |||
const next = this._reversed ? this.current - 1 : this.current + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const next = this.current + (this._reversed ? -1 : 1);
個人拙見。
// 当歌曲是列表最后一首 && 循环模式开启 | ||
if (this.list.length === this.current + 1 && this.repeatMode === 'on') { | ||
return [this.list[0], 0]; | ||
// 循环模式开启,则重新播放当前模式下的相对的下一首 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
能有 Unit Test 更好。
Reversed Mode
Allows the user to play music in a reversed order, opposite to the normal top-to-bottom direction. I found this feature plays quite nice with old playlists that I want to go back and have a taste with. With that saying, it is hidden by default behind a settings item located in the settings menu, to avoid confusion and clutter introduced to all users.
Lyrics Animation
Inspired by Apple Music, I've tried to replicate the same effect by using
font-size
animation. On my MacBook Pro 2021 it looks quite smoothly and it looks astonishing with dynamic background. This is just to try and have some fun and it turns out to be quite nicely.I also added a slight different styling to the translated lyrics, making it a bit transparent and a bit smaller to the original lyrics to distinguish the two.
Also I've get rid of
v-html
by usingv-if
andv-if-else
, just to make the code more readable and to get rid of extra DOM parsing.