From ea4b20755d96b89ab67be47cbfc6ae54abc7c933 Mon Sep 17 00:00:00 2001 From: GalvinGao Date: Tue, 12 Apr 2022 16:16:46 +0800 Subject: [PATCH] feat: add copy track link & fixed various visual defects (#1489) * feat: add copy track link * fix: various visual defects * feat: add track low res fallback * chore: remove redundant locale strings * chore: separate playbackState for a new PR * build: fix netlify failing to build site --- .nvmrc | 1 + src/components/ArtistsInLine.vue | 20 ++++++++++++----- src/components/ContextMenu.vue | 16 ++++++++++---- src/components/ExplicitSymbol.vue | 2 ++ src/components/Modal.vue | 5 +++++ src/components/ModalNewPlaylist.vue | 1 + src/components/TrackList.vue | 10 +++++++++ src/components/TrackListItem.vue | 9 ++++++-- src/utils/Player.js | 5 +++++ src/views/library.vue | 34 ++++++++++++++++++++++++++--- 10 files changed, 89 insertions(+), 14 deletions(-) create mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..da2d398 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +14 \ No newline at end of file diff --git a/src/components/ArtistsInLine.vue b/src/components/ArtistsInLine.vue index cc13384..e2c619d 100644 --- a/src/components/ArtistsInLine.vue +++ b/src/components/ArtistsInLine.vue @@ -2,11 +2,13 @@ {{ computedPrefix }} - - {{ ar.name }} - + {{ + ar.name + }} {{ ar.name }} - , + , @@ -40,4 +42,12 @@ export default { }; - + diff --git a/src/components/ContextMenu.vue b/src/components/ContextMenu.vue index a290a47..186448f 100644 --- a/src/components/ContextMenu.vue +++ b/src/components/ContextMenu.vue @@ -80,11 +80,13 @@ export default { box-shadow: 0 6px 12px -4px rgba(0, 0, 0, 0.08); border: 1px solid rgba(0, 0, 0, 0.06); backdrop-filter: blur(12px); - border-radius: 8px; + border-radius: 12px; box-sizing: border-box; padding: 6px; z-index: 1000; -webkit-app-region: no-drag; + transition: background 125ms ease-out, opacity 125ms ease-out, + transform 125ms ease-out; &:focus { outline: none; @@ -94,8 +96,9 @@ export default { [data-theme='dark'] { .menu { background: rgba(36, 36, 36, 0.78); - backdrop-filter: blur(16px) contrast(120%); + backdrop-filter: blur(16px) contrast(120%) brightness(60%); border: 1px solid rgba(255, 255, 255, 0.08); + box-shadow: 0 0 6px rgba(255, 255, 255, 0.08); } .menu .item:hover { color: var(--color-text); @@ -112,7 +115,7 @@ export default { font-weight: 600; font-size: 14px; padding: 10px 14px; - border-radius: 7px; + border-radius: 8px; cursor: default; color: var(--color-text); display: flex; @@ -120,6 +123,11 @@ export default { &:hover { color: var(--color-primary); background: var(--color-primary-bg-for-transparent); + transition: opacity 125ms ease-out, transform 125ms ease-out; + } + &:active { + opacity: 0.75; + transform: scale(0.95); } .svg-icon { @@ -149,7 +157,7 @@ hr { border-radius: 4px; } .info { - margin-left: 8px; + margin-left: 10px; } .title { font-size: 16px; diff --git a/src/components/ExplicitSymbol.vue b/src/components/ExplicitSymbol.vue index 99b2cd4..f8ed871 100644 --- a/src/components/ExplicitSymbol.vue +++ b/src/components/ExplicitSymbol.vue @@ -25,6 +25,8 @@ export default { this.svgStyle = { height: this.size + 'px', width: this.size + 'px', + position: 'relative', + left: '-1px', }; }, }; diff --git a/src/components/Modal.vue b/src/components/Modal.vue index 4ddc909..6657369 100644 --- a/src/components/Modal.vue +++ b/src/components/Modal.vue @@ -39,11 +39,16 @@ export default { type: Boolean, default: false, }, + minWidth: { + type: String, + default: 'calc(min(23rem, 100vw))', + }, }, computed: { modalStyles() { return { width: this.width, + minWidth: this.minWidth, }; }, }, diff --git a/src/components/ModalNewPlaylist.vue b/src/components/ModalNewPlaylist.vue index 29e997e..0bbc8f4 100644 --- a/src/components/ModalNewPlaylist.vue +++ b/src/components/ModalNewPlaylist.vue @@ -147,6 +147,7 @@ export default { label { font-size: 12px; } + user-select: none; } } } diff --git a/src/components/TrackList.vue b/src/components/TrackList.vue index a37eb18..5289cee 100644 --- a/src/components/TrackList.vue +++ b/src/components/TrackList.vue @@ -46,6 +46,9 @@ @click="addTrackToPlaylist" >{{ $t('contextMenu.addToPlaylist') }} +
{{ + $t('contextMenu.copyUrl') + }}
- -