-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨ Re-implemented track adding modal
It is now possible to add multiple tracks at once. The general UX was improved although the design is still not great. #73
- Loading branch information
1 parent
1e59b4e
commit e9dedeb
Showing
8 changed files
with
331 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
<template> | ||
<b-list-item class="playlist-item" tabindex="0"> | ||
<b-square-image :url="track.image" :size="36" class="image" /> | ||
<b-text class="time duration"> | ||
{{ track.duration_ms | formatTime('mm:ss') }} | ||
</b-text> | ||
<div class="artist-song-pair"> | ||
<b-text class="song"> | ||
{{ track.name }} | ||
</b-text> | ||
<b-text class="artist"> | ||
{{ track.artist }} | ||
</b-text> | ||
</div> | ||
</b-list-item> | ||
</template> | ||
|
||
<script> | ||
import formatTime from '../../utils/formatTime' | ||
export default { | ||
name: 'SearchPlaylistItem', | ||
filters: { | ||
formatTime(milliseconds, format = '') { | ||
return formatTime(milliseconds, format) | ||
}, | ||
}, | ||
props: { | ||
track: { | ||
type: Object, | ||
required: true, | ||
}, | ||
}, | ||
} | ||
</script> | ||
|
||
<style lang="scss"> | ||
:root { | ||
--small-track-item-height: 36px; | ||
--small-track-item-song-font-size: 12px; | ||
--small-track-item-song-line-height: 15px; | ||
--small-track-item-artist-font-size: 9px; | ||
--small-track-item-artist-line-height: 13px; | ||
} | ||
@media screen and (max-width: 1080px) { | ||
:root { | ||
--small-track-item-height: 36px; | ||
--small-track-item-song-font-size: 12px; | ||
--small-track-item-song-line-height: 15px; | ||
--small-track-item-artist-font-size: 9px; | ||
--small-track-item-artist-line-height: 13px; | ||
} | ||
} | ||
</style> | ||
|
||
<style lang="scss" scoped> | ||
.playlist-item { | ||
display: flex; | ||
align-items: center; | ||
width: 100%; | ||
height: var(--small-track-item-height); | ||
padding: 0; | ||
border-radius: 3px; | ||
background-color: var(--color-default-opposite); | ||
transition: background-color 0.1s ease; | ||
font-size: var(--small-track-item-song-font-size); | ||
&:not(:first-child) { | ||
margin-top: 5px; | ||
} | ||
&:focus { | ||
outline: none; | ||
} | ||
&:hover { | ||
background-color: white; | ||
box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.3); | ||
cursor: pointer; | ||
.track-menu { | ||
opacity: 0; /* TODO: enable */ | ||
pointer-events: initial; | ||
} | ||
} | ||
> * { | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
pointer-events: none; | ||
} | ||
} | ||
.image { | ||
min-width: var(--small-track-item-height); | ||
border-top-left-radius: 3px; | ||
border-bottom-left-radius: 3px; | ||
border-top-right-radius: 0; | ||
border-bottom-right-radius: 0; | ||
} | ||
.time { | ||
color: var(--color-default); | ||
min-width: 20px; | ||
text-align: right; | ||
margin-left: 14px; | ||
} | ||
.artist-song-pair { | ||
display: flex; | ||
flex-direction: column; | ||
width: 200px; | ||
margin-left: 14px; | ||
.song { | ||
font-size: var(--small-track-item-song-font-size); | ||
line-height: var(--small-track-item-song-line-height); | ||
color: var(--color-default); | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
.artist { | ||
font-size: var(--small-track-item-artist-font-size); | ||
line-height: var(--small-track-item-artist-line-height); | ||
color: var(--color-grey); | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.