Skip to content

Commit

Permalink
💄 Perfect song style
Browse files Browse the repository at this point in the history
  • Loading branch information
shianqi committed Sep 27, 2017
1 parent 0b62921 commit fd2a490
Show file tree
Hide file tree
Showing 2 changed files with 213 additions and 19 deletions.
190 changes: 178 additions & 12 deletions src/components/window/Playlist/PlaylistTab/SongList/index.css
Original file line number Diff line number Diff line change
@@ -1,29 +1,195 @@
.list-item {
font-size: 15px;
padding: 5px 0;
line-height: 18px;
box-sizing: border-box;
background: #fafafa;
user-select: none;
overflow: hidden;
}

.list-item:nth-child(2n) {
background: #f5f5f7;
}

.list-item:hover {
background: #ebeced;
}

.list-item-header {
line-height: 18px;
box-sizing: border-box;
background: #fafafa;
user-select: none;
overflow: hidden;
}

.list-item-index-header {
box-sizing: border-box;
border-right: 1px solid #ddd;
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
padding: 5px;
width: 8%;
text-align: center;
float: left;
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

.list-item-name-header {
box-sizing: border-box;
border-right: 1px solid #ddd;
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
padding: 5px;
width: 30%;
float: left;
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

.list-item-singers-header {
box-sizing: border-box;
border-right: 1px solid #ddd;
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
padding: 5px;
width: 20%;
float: left;
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

.list-item-album-header {
box-sizing: border-box;
border-right: 1px solid #ddd;
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
padding: 5px;
width: 30%;
float: left;
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

.list-item-time-header {
box-sizing: border-box;
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
padding: 5px;
width: 12%;
float: left;
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

.list-item-name-header:hover {
background: #ebeced;
}

.list-item-singers-header:hover {
background: #ebeced;
}

.list-item-album-header:hover {
background: #ebeced;
}

.list-item-time-header:hover {
background: #ebeced;
}

.list-item-index-box {
box-sizing: border-box;
padding: 5px;
width: 8%;
text-align: center;
float: left;
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

.list-item-name-box {
box-sizing: border-box;
padding: 5px;
width: 30%;
float: left;
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

.list-item-singers-box {
box-sizing: border-box;
padding: 5px;
width: 20%;
float: left;
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

.list-item-album-box {
box-sizing: border-box;
padding: 5px;
width: 30%;
float: left;
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

.list-item-time-box {
box-sizing: border-box;
padding: 5px;
width: 12%;
float: left;
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

.list-item-index {
display: inline-block;
width: 6%;
cursor: default;
color: #777;
text-align: center;
font-size: 13px;
}

.list-item-name {
display: inline-block;
width: 30%;
cursor: default;
font-size: 13px;
}

.list-item-singers {
display: inline-block;
width: 20%;
cursor: pointer;
color: #555;
font-size: 13px;
}

.list-item-album {
display: inline-block;
width: 30%;
cursor: pointer;
color: #555;
font-size: 13px;
}

.list-item-time {
display: inline-block;
width: 14%;
cursor: default;
color: #777;
font-size: 12px;
}
42 changes: 35 additions & 7 deletions src/components/window/Playlist/PlaylistTab/SongList/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,54 @@ class SongList extends Component {
if (i%2===0) {
res.push(<span>{ ar[i/2].name }</span>)
}else if(i!==(ar.length*2-1)) {
res.push(<span>/</span>)
res.push(<span> / </span>)
}
}
return res
}

return (
<div className={ Style['list-item'] }>
<span className={ Style['list-item-index'] }>{ index+1>=10?index+1:`0${index+1}` }</span>
<span className={ Style['list-item-name'] }>{ name }</span>
<span className={ Style['list-item-singers'] }>{ singer() }</span>
<span className={ Style['list-item-album'] }>{ al.name }</span>
<span className={ Style['list-item-time'] }>{ getTime() }</span>
<div className={ Style['list-item-index-box'] }>
<span className={ Style['list-item-index'] }>{ index+1>=10?index+1:`0${index+1}` }</span>
</div>
<div className={ Style['list-item-name-box'] }>
<span className={ Style['list-item-name'] }>{ name }</span>
</div>
<div className={ Style['list-item-singers-box'] }>
<span className={ Style['list-item-singers'] }>{ singer() }</span>
</div>
<div className={ Style['list-item-album-box'] }>
<span className={ Style['list-item-album'] }>{ al.name }</span>
</div>
<span className={ Style['list-item-time-box'] }>
<span className={ Style['list-item-time'] }>{ getTime() }</span>
</span>
</div>
)
})

return (
<div>
<div></div>
<div>
<div className={ Style['list-item-header'] }>
<div className={ Style['list-item-index-header'] }>
<span className={ Style['list-item-index'] }>#</span>
</div>
<div className={ Style['list-item-name-header'] }>
<span className={ Style['list-item-name'] }>音乐标题</span>
</div>
<div className={ Style['list-item-singers-header'] }>
<span className={ Style['list-item-singers'] }>歌手</span>
</div>
<div className={ Style['list-item-album-header'] }>
<span className={ Style['list-item-album'] }>专辑</span>
</div>
<span className={ Style['list-item-time-header'] }>
<span className={ Style['list-item-time'] }>时长</span>
</span>
</div>
</div>
<div>{ List }</div>
</div>
)
Expand Down

0 comments on commit fd2a490

Please sign in to comment.