Skip to content
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

Merged
merged 5 commits into from Jan 14, 2022
Merged

feat: add reversed mode & improvements to lyrics animation #1226

merged 5 commits into from Jan 14, 2022

Conversation

GalvinGao
Copy link
Contributor

@GalvinGao GalvinGao commented Jan 11, 2022

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.

ezgif-3-dcf06ca065

Also I've get rid of v-html by using v-if and v-if-else, just to make the code more readable and to get rid of extra DOM parsing.

@vercel
Copy link

vercel bot commented Jan 11, 2022

Someone is attempting to deploy a commit to a Personal Account owned by @qier222 on Vercel.

@qier222 first needs to authorize it.

@GalvinGao GalvinGao changed the title feat(reversed-mode): add reversed mode & improvements to lyrics animation feat: add reversed mode & improvements to lyrics animation Jan 11, 2022
src/views/lyrics.vue Outdated Show resolved Hide resolved
}
set reversed(reversed) {
if (this._isPersonalFM) return;
if (reversed !== true && reversed !== false) {
Copy link
Collaborator

@pan93412 pan93412 Jan 12, 2022

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;
Copy link
Collaborator

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];
// 循环模式开启,则重新播放当前模式下的相对的下一首
Copy link
Collaborator

Choose a reason for hiding this comment

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

能有 Unit Test 更好。

@qier222 qier222 merged commit 42f3da9 into qier222:master Jan 14, 2022
@GalvinGao GalvinGao deleted the feat/reversed-mode branch January 16, 2022 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants